Figure 4-2. VRRP Example Network Configuration
Example 1: Configuring VRRP on the Switch as a Master Router
Enable routing for the switch. IP forwarding is then enabled by default.
console#config
console(config)#ip routing
Configure the IP addresses and subnet masks for the VLAN routing interfaces that will participate in the
protocol, for example:
console(config)#interface vlan 50
console(config-if-vlan50)#routing
console(config-if-vlan50)#ip address 192.150.2.1 255.255.255.0
console(config-if-vlan50)#exit
Enable VRRP for the switch:
console#config
console(config)#ip vrrp
Assign virtual router IDs to the port that will participate in the protocol:
console(config)#interface vlan 50
console(config-if-vlan50)#ip vrrp 20
Specify the IP address that the virtual router function will recognize. The priority default is 255.
console(config-if-vlan50)#ip vrrp 20 ip 192.150.2.1
Enable VRRP on the port:
console(config-if-vlan50)#ip vrrp 20 mode
console(config-if-vlan50)#exit
Example 2: Configuring VRRP on the Switch as a Backup Router
Enable routing for the switch. IP forwarding is then enabled by default.
console#config
console(config)#ip routing
Configure the IP addresses and subnet masks for the port that will participate in the protocol:
console(config)#interface vlan 60
console(config-if-vlan60)#routing
console(config-if-vlan60)#ip address 192.150.4.1 255.255.255.0
console(config-if-vlan60)#exit
Enable VRRP for the switch.
console#config
console(config)#ip vrrp
Assign virtual router IDs to the port that will participate in the protocol:
console(config)#interface vlan 60
console(config-if-vlan60)#ip vrrp 20
65
Routing Configuration