Configuring VRRP on the Gateway
The following steps are required to configure HSRP on the gateway:
- Configure the correct IP address and mask for the gateway interface using the ip address [address] [mask] [secondary] interface configuration command
- Create a VRRP group on the gateway interface and assign the group the virtual IP address via the vrrp [number] ip [virtual address][secondary] interface configuration command. The [secondary] keyword configures the virtual IP address as a secondary gateway address for the specified group
- Optionally, assign the VRRP group a description using the vrrp [number] description[name] interface configuration command
- Optionally, if you want to control the election of the virtual router master and virtual router backups, configure the group priority via the vrrp [number] priority [value] interface configuration command
The VRRP configuration examples in this section will be based on Figure 8-24.
Figure 8-24: VRRP Configuration Examples Topology
NOTE: It is assumed that the VLAN and trunking configuration between VTP-Server-1 and VTP-Server-2 is already in place and the switches are successfully able to ping each other across VLAN 172. For brevity, this configuration will be omitted from the configuration examples.
Example 8-31: Configuring VRRP Groups
| VTP-Server-1(config)#interface vlan 192 VTP-Server-1(config-if)#ip address 192.168.1.1 255.255.255.0 VTP-Server-1(config-if)#vrrp 1 ip 192.168.1.254 VTP-Server-1(config-if)#vrrp 1 priority 105 VTP-Server-1(config-if)#vrrp 1 description ‘SWITCH-VRRP-Example’ VTP-Server-1(config-if)#exit |
| VTP-Server-2(config)#interface vlan 192 VTP-Server-2(config-if)#ip address 192.168.1.2 255.255.255.0 VTP-Server-2(config-if)#vrrp 1 ip 192.168.1.254 VTP-Server-2(config-if)#vrrp 1 description ‘SWITCH-VRRP-Example’ VTP-Server-2(config-if)#exit |
NOTE: No priority value is manually assigned for the VRRP configuration applied to VTP-Server-2. By default, VRRP will use a priority value of 100, allowing VTP-Server-1, with a priority value of 105, to win the election and be elected the virtual router master for the VRRP group. In addition to this, a description has also optionally been configured for the group.
This configuration is validated using the show vrrp [all|brief|interface] command. The [all] keyword shows all information pertaining to the VRRP configuration, which includes the group state, description (if configured), local gateway priority, and virtual router master amongst other things. The [brief] keyword prints a summary of the VRRP configuration. The [interface] keyword prints VRRP information for the specified interface. Example 8-32 shows the output of the show vrrp all command.
Example 8-32: Verifying VRRP Configuration
| VTP-Server-1#show vrrp all Vlan192 – Group 1 ‘SWITCH-VRRP-Example’ State is Master Virtual IP address is 192.168.1.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1.000 sec Preemption enabled Priority is 105 Master Router is 192.168.1.1 (local), priority is 105 Master Advertisement interval is 1.000 sec Master Down interval is 3.589 sec |
| VTP-Server-2#show vrrp all Vlan192 – Group 1 ‘SWITCH-VRRP-Example’ State is Backup Virtual IP address is 192.168.1.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1.000 sec Preemption enabled Priority is 100 Master Router is 192.168.1.1, priority is 105 Master Advertisement interval is 1.000 sec Master Down interval is 3.609 sec (expires in 3.328 sec) |
Example 8-33 shows the information printed by the show vrrp brief command.
Example 8-33: Verifying VRRP Configuration Contd.
| VTP-Server-1#show vrrp brief Interface Grp Pri Time Own Pre State Master addr Group addr Vl192 1 105 3589 Y Master 192.168.1.1 192.168.1.254 |
| VTP-Server-2#show vrrp brief Interface Grp Pri Time Own Pre State Master addr Group addr Vl192 1 100 3609 Y Backup 192.168.1.1 192.168.1.254 |
Configuring VRRP Timers
The interval for advertisement updates sent by the VRRP virtual router master is configured using the vrrp [number] timers [[seconds] [msec][milliseconds]] interface configuration command. Example 8-34 illustrates how to configure an advertisement interval of 5 seconds.
| VTP-Server-1(config)#interface vlan 192 VTP-Server-1(config-if)#vrrp 1 timers advertise 5 |
Example 8-35 illustrates how to configure an advertisement interval of 100 milliseconds.
| VTP-Server-1(config)#interface vlan 192 VTP-Server-1(config-if)#vrrp 1 timers advertise msec 100 |
VRRP timer configuration can be validated using the show vrrp interface [name] command, the output of which is illustrated in Example 8-36.
Example 8-36: Verifying the VRRP Advertisement Timer Value
| VTP-Server-1#show vrrp interface vlan 192 Vlan192 – Group 1 ‘SWITCH-VRRP-Example’ State is Master Virtual IP address is 192.168.1.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 0.100 sec Preemption enabled Priority is 105 Master Router is 192.168.1.1 (local), priority is 105 Master Advertisement interval is 0.100 sec Master Down interval is 0.889 sec |
Configuring VRRP Timer Learning
As previously stated in this chapter, virtual router backups can be optionally configured to learn timer values from the virtual router master. This is configured using the vrrp 1 timers learn interface configuration command on the virtual router backup. Example 8-37 shows how to configure a virtual router backup to learn about timers from the virtual router master.
Example 8-37: Configuring VRRP Timer Learning
| VTP-Server-2(config)#interface vlan 192 VTP-Server-2(config-if)#vrrp 1 timers learn VTP-Server-2(config-if)#exit |
Again, the show vrrp interface [name] command can be used to validate this configuration. The output of this command is shown in Example 8-38.
| VTP-Server-2#show vrrp interface vlan 192 Vlan192 – Group 1 ‘SWITCH-VRRP-Example’ State is Backup Virtual IP address is 192.168.1.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1.000 sec Preemption enabled Priority is 100 Master Router is 192.168.1.1, priority is 105 Master Advertisement interval is 1.000 sec Master Down interval is 3.609 sec (expires in 3.572 sec) Learning |
Configuring VRRP Plain Text Authentication
VRRP plain-text authentication is configured using the vrrp [number authentication text [password] interface configuration command. As is the case with plain-text authentication when using HSRP, the password is sent unencrypted and can be viewed ‘on-the-wire’ as well as in the output of the show vrrp interface [name]command. Example 8-39 illustrates the configuration of plain-text authentication for VRRP using the password SWITCH.
Example 8-39: Configuring Plain Text Authentication for VRRP
| VTP-Server-1(config)#interface vlan 192 VTP-Server-1(config-if)#vrrp 1 authentication text SWITCH VTP-Server-1(config-if)#exit |
| VTP-Server-2(config)#interface vlan 192 VTP-Server-2(config-if)#vrrp 1 authentication text SWITCH VTP-Server-2(config-if)#exit |
The plain text password is present in the output of the show vrrp interface [name] command as shown in Example 8-40.
Example 8-40: Verifying Plain Text Authentication for VRRP
| VTP-Server-1#show vrrp interface vlan 192 Vlan192 – Group 1 ‘SWITCH-VRRP-Example’ State is Master Virtual IP address is 192.168.1.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 0.100 sec Preemption enabled Priority is 105 Authentication text, string “SWITCH” Master Router is 192.168.1.1 (local), priority is 105 Master Advertisement interval is 0.100 sec Master Down interval is 0.889 sec |
Configuring VRRP MD5 Authentication
Cisco IOS software supports two methods for configuring MD5 authentication for VRRP. The first method does not require key chains and is configured using the vrrp [number] authentication md5 key-string [password]interface configuration command. The second method, which requires key chain configuration, is applied using thevrrp [number] authentication md5 key-chain [name] interface configuration command.
Key chain configuration is illustrated in HSRP configuration and will not be illustrated in this section. Refer to that section if you are unable to remember how to configure key chains. Example 8-41 illustrates how to configure MD5 authentication for VRRP without a key chain.
Example 8-41: Configuring VRRP MD5 Authentication with no Key Chain
| VTP-Server-1(config)#interface vlan 192 VTP-Server-1(config-if)#vrrp 1 authentication md5 key-string SWITCH VTP-Server-1(config-if)#exit |
| VTP-Server-2(config)#interface vlan 192 VTP-Server-2(config-if)# vrrp 1 authentication md5 key-string SWITCH VTP-Server-2(config-if)#exit |
MD5 authentication for VRRP is verified using the show vrrp interface [name] command as shown in the output in Example 8-42.
Example 8-42: Verifying VRRP MD5 Authentication with no Key Chain
| VTP-Server-2#show vrrp interface vlan 192 Vlan192 – Group 1 ‘SWITCH-VRRP-Example’ State is Backup Virtual IP address is 192.168.1.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 1.000 sec Preemption enabled Priority is 100 Authentication MD5, key-string Master Router is 192.168.1.1, priority is 105 Master Advertisement interval is 1.000 sec Master Down interval is 3.609 sec (expires in 3.516 sec) Learning |
As is the case with MD5 authentication for HSRP, notice that the password is not displayed in the output of the show command. It can be validated by viewing the switch configuration.
Configuring VRRP Interface Tracking
In order to configure VRRP to track and interface, for example, a tracked object must be created in global configuration mode using the track [object number] interface][line-protocol|ip routing] global configuration command for interface tracking, or the track [object number] ip route [address/prefix] {reachability | metric threshold} command for IP prefix tracking. Up to 500 track objects may be tracked on the switch, depending on the software and platform. Tracked objects are then tracked by VRRP using the vrrp [number] track [object]interface configuration command.
NOTE: You are not expected to perform any advanced object tracking configurations.
Example 8-43 shows how to configure tracking for VRRP, referencing object 1, which tracks the line protocol of the Loopback0 interface.
Example 8-43: Tracking the Interface Line Protocol State
| VTP-Server-1(config)#track 1 interface loopback 0 line-protocol VTP-Server-1(config-track)#exit VTP-Server-1(config)#interface vlan 192 VTP-Server-1(config-if)#vrrp 1 track 1 VTP-Server-1(config-if)#exit |
Example 8-44 shows how to configure tracking for VRRP, referencing object 2, which tracks the reachability of the 1.1.1.1/32 prefix. A tracked IP route object is considered up and reachable when a routing table entry exists for the route and the route is not inaccessible, i.e. has a route metric of 255, in which case the route is removed from the RIB anyway.
Example 8-44: Tracking the Reachability of an IP Prefix
| VTP-Server-1(config)#track 2 ip route 1.1.1.1/32 reachability VTP-Server-1(config-track)#exit VTP-Server-1(config)#interface vlan 192 VTP-Server-1(config-if)#vrrp 1 track 2 |
VRRP tracking configuration is verified using the show vrrp interface [name] command. This is illustrated in Example 8-45.
Example 8-45: Verifying VRRP Tracking Configuration
| VTP-Server-1#show vrrp interface vlan 192 Vlan192 – Group 1 ‘SWITCH-VRRP-Example’ State is Master Virtual IP address is 192.168.1.254 Virtual MAC address is 0000.5e00.0101 Advertisement interval is 0.100 sec Preemption enabled Priority is 105 Track object 1 state Up decrement 10 Track object 2 state Up decrement 10 Authentication MD5, key-string Master Router is 192.168.1.1 (local), priority is 105 Master Advertisement interval is 0.100 sec Master Down interval is 0.889 sec |
To view the parameters of the tracked objects, use the show track [number][brief] [interface] [ip] [resolution][timers] command. The output of the show track command is illustrated in Example 8-46.
Example 8-46: Verifying Tracked Object Parameters
| VTP-Server-1#show track Track 1 Interface Loopback0 line-protocol Line protocol is Up 1 change, last change 00:11:36 Tracked by: VRRP Vlan192 1 Track 2 IP route 1.1.1.1 255.255.255.255 reachability Reachability is Up (connected) 1 change, last change 00:08:48 First-hop interface is Loopback0 Tracked by: VRRP Vlan192 1 |
NOTE: Tracked objects can also be used in conjunction with HSRP, and GLBP. GLBP is described in the following section.
Debugging the Virtual Router Redundancy Protocol
The debug vrrp command provides several options that the administrator can use to view real-time information on VRRP operation. These options are illustrated in Example 8-47.
Example 8-47: VRRP Debugging Options
| VTP-Server-1#debug vrrp ? all Debug all VRRP information auth VRRP authentication reporting errors VRRP error reporting events Protocol and Interface events packets VRRP packet details state VRRP state reporting track Monitor tracking <cr> |
