RFC 3768定义的VRRPv2是一种容错协议,在提高可靠性的同时,简化了主机的配置。VRRP协议报文
使用固定的组播地址224.0.0.18进行发送。虚拟路由器由LAN上唯一的Virtual Router ID标识。并具
有虚拟MAC地址:00-00-5E-00-01-{vrid}VRRP的工作原理和HSRP非常类似,不过VRRP是国际上的标
准,允许在不同厂商的设备之间运行。VRRP中虚拟网关的地址可以和接口上的地址相同,VRRP中接口
只有3个状态:初始状态(Initial)、主状态(Master)和备份状态(Backup)。VRRP只有一种报
文。
试验:
R1 R2
inter s1/0 inter s1/0
ip add 202.192.1.1 255.255.255.0 ip add 202.192.2.1 255.255.255.0
no shutdown no shutdown
ip nat outside ip nat outside
inter f0/0 inter f0/0
no shutdown no shutdown
inter f0/0.10 inter f0/0.10
encapulation dot1q 10 encapulation dot1q 10
ip add 192.168.10.1 255.255.255.0 ip add 192.168.10.2 255.255.255.0
no shutdown no shutdown
ip nat inside ip nat inside
inter f0/0.20 inter f0/0.20
encapulation dot1q 20 encapulation dot1q 20
ip add 192.168.20.1 255.255.255.0 ip add 192.168.20.2 255.255.255.0
no shutdown no shutdown
ip nat inside ip nat inside
ip route 0.0.0.0 0.0.0.0 s1/0 ip route 0.0.0.0 0.0.0.0 s1/0
access 1 permit 192.168.10.0 0.0.0.255 access 1 permit 192.168.10.0 0.0.0.255
access 1 permit 192.168.20.0 0.0.0.255 access 1 permit 192.168.20.0 0.0.0.255
ip nat insi sour list 1 inter s1/0 overload ip nat insi sour list 1 inter s1/0 over
vrrp 100 interfa s1/0 line-protocol vrrp 100 interfa s1/0 line-protocol
interface f0/0.10 interface f0/0.20
vrrp 10 ip 192.168.10.254 vrrp 20 ip 192.168.20.254
vrrp 10 priority 120 vrrp 20 priority 120
vrrp 10 preempt vrrp 20 preempt
vrrp 10 authentication md5 key-string cisco vrrp 20 authentic md5 key-string cisco
vrrp 10 track 100 decement 30 vrrp 20 track 100 decement 30
interface f0/0.20 interface f0/0.10
vrrp 20 ip 192.168.20.254 vrrp 10 ip 192.168.10.254
vrrp 20 preempt vrrp 10 preempt
vrrp authentication md5 key-string cisco vrrp authentic md5 key-string cisco
SW1 SW2
vlan database vlan database
vtp server vtp client
vtp domain VTP-TEST password cisco vtp domain VTP-TEST password cisco
vlan 10 inter f0/0
vlan 20
inter f0/0
swithport mode trunk swithport mode trunk
interface port-channel 1 interface port-channel 1
swithport mode trunk swithport mode trunk
interface rang f0/1 - 2 interface rang f0/1 - 2
channel-group mode on channel-group mode on
inter f0/3 inter f0/3
switchport mode access switchport mode access
switchport access vlan 10 switchport access vlan 10
inter f0/4 inter f0/4
switchport mode access switchport mode access
switchport access vlan 20 switchport access vlan 20