In the previous article we saw a simple implementation of HSRP which allows to manage gateway redundancy (among others). Although simple to set up, HSRP has the main defect of being Cisco owner. Here is an equivalent implementation of VRRP, standard protocol 
 "What is the difference between HSRP and VRRP",in order to allow an easy comparison with HSRP, I kept the same structure for the article. 


Topology 



The topology is similar to the one used in the article on HSRP . R1 and R2 will therefore be the two default gateways to operate in redundancy.
R1 and R2 will communicate using VRRP through their FastEthernet interfaces to negotiate their role.

General principle

VRRP is therefore, like HSRP, also a protocol that provides a solution of continuity of service mainly for the redundancy of gateways by default. 
How does VRRP work
For each network, the interfaces of the routers are associated with a VRRP group (the same group number for all interfaces that must perform the same role). To this group we associate a virtual IP address (in this case it will be 192.168.0.254).
Redundancy is implemented through the ARP protocol. When the PC must send a frame to its gateway, it sends an ARP request and responds by supplying its MAC address.
In the case of VRRP, routers will associate a particular MAC address with the virtual IP address in the form 00: 00: 5E: 00: 01: XX (where XX is the VRRP group number).
From then on, for the PC, whatever happens, it will be this MAC address that will identify its gateway. For their part, the routers dialogue by multicast (224.0.0.18) in order to negotiate and know who will be responsible for processing the frame intended for the VRRP MAC address.

Configuring R1
  
 R1 (config) # interface FastEthernet0 / 0

 R1 (config-if) # vrrp 1 ip 192.168.0.254

 R1 (config-if) # vrrp 1 priority 200

 R1 (config-if) # vrrp 1 preempt 

The interface Fa0 / 0 of R1 will work in group VRRP n ° 1 to which the virtual IP address 192.168.0.254 has been associated. In addition we defined a priority of 200 (the highest priority will be the effective gateway) and we activate the right of preemption (if R1 breaks down, R2 takes over ... but is R1 returns, it will resume its place without preemption , R2 would remain the gateway). 

Configuring R2 

 R2 (config) # interface FastEthernet0 / 0

 R2 (config-if) # vrrp 1 ip 192.168.0.254

 R2 (config-if) # vrrp 1 priority 100 

The configuration of R2 is similar to that of R1. Note that both routers must be configured in the same group and handle the same virtual address, otherwise there will be either no VRRP dialog or an address conflict.

Verification 

Configuring C1:
 NAME IP / MASK GATEWAY MAC
 VPCS1 192.168.0.10/24 192.168.0.254 00: 50: 79: 66: 68: 00 

Testing Communication to 1.1.1.1 

 VPCS [1]> ping 1.1.1.1

 1.1.1.1 icmp_seq = 1 timeout

 1.1.1.1 icmp_seq = 2 ttl = 254 time = 25,000 ms

 1.1.1.1 icmp_seq = 3 ttl = 254 time = 25,000 ms

 1.1.1.1 icmp_seq = 4 ttl = 254 time = 32,000 ms

 1.1.1.1 icmp_seq = 5 ttl = 254 time = 31,000 ms

It is interesting to analyze the table ARP of C1 ...

 VPCS [1]> arp

 00: 00: 5: 00: 01: 01 192.168.0.254 expires in 114 seconds
C1 has indeed emulated an ARP request to obtain the MAC address corresponding to 192.168.0.254, which corresponds well to a MAC address VRRP where the last byte is defined by the group number VRRP.
 VPCS [1]> trace 1.1.1.1

 Trace to 1.1.1.1, 8 hops max, press Ctrl + C to stop

  1 192.168.0.1 19.000 ms 10.000 ms 9.000 ms

  2 172.16.0.1 20.000 ms 10.000 ms 10.000 ms

  3 1.1.1.1 20.000 ms 10.000 ms 10.000 ms
It can be seen here that R1 does indeed play the role of 192.168.0.254 

Checking the configuration 

Checking VRRP on R1: 

  R1 # show vrrp

  FastEthernet0 / 0 - Group 1

  State is Master

  Virtual IP address is 192.168.0.254

  Virtual MAC address is 0000.5e00.0101

  Advertisement interval is 1.000 sec

  Preemption enabled

  Priority is 200

  Master Router is 192.168.0.1 (local), priority is 200

  Master Advertisement interval is 1.000 sec

  Master Down interval is 3.218 sec

  R1 #
The "State" indicates either Master (active) or Backup (standby). The rest of the information is explicit. 

What happens if R1 goes down ... 

Test running by setting Fa0 / 0 of R1 in shutdown ...
  R1 (config-if) #shutdown

 * Mar 1 02: 21: 46.399:% VRRP-6-STATECHANGE: Fa0 / 0 Grp 1 state Master ->      Init

 * Mar 1 02: 21: 48.403:% LINK-5-CHANGED: Interface FastEthernet0 / 0,  changed state to administratively down

 * Mar 1 02: 21: 49.403:% LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0 / 0, changed state to down

Immediate reaction of R2 ...
  R2 #

 * Mar 1 02: 21: 41.727:% VRRP-6-STATECHANGE: Fa0 / 0 Grp 1 state Backup ->   Master 

R2 has become the active gateway, check on C1 ... 

 VPCS [1]> ping 1.1.1.1

 1.1.1.1 icmp_seq = 1 ttl = 254 time = 26,000 ms

 1.1.1.1 icmp_seq = 2 ttl = 254 time = 19.000 ms

 1.1.1.1 icmp_seq = 3 ttl = 254 time = 19.000 ms

 1.1.1.1 icmp_seq = 4 ttl = 254 time = 19,000 ms

 1.1.1.1 icmp_seq = 5 ttl = 254 time = 19.000 ms

  VPCS [1]> arp
 00: 00: 5: 00: 01: 01 192.168.0.254 expires in 7 seconds
As for HSRP, the ARP table of C1 remains idendic. The transition between R1 and R2 is transparent for C1.
  VPCS [1]> trace 1.1.1.1

  Trace to 1.1.1.1, 8 hops max, press Ctrl + C to stop

  1 192.168.0.2 9,000 ms 9,000 ms 9,000 ms

  2 172.16.0.5 10.000 ms 10.000 ms 10.000 ms

  3 1.1.1.1 10.000 ms 11.000 ms 10.000 ms 

Conclusion 

For such a simple configuration, VRRP works almost like HSRP, so there is not much else to add. The major differences are in the workings of the protocol (multicast address used, MAC address etc.).

0 comments:

Post a Comment

 
Top