交换机的VRRP主备配置例子
拓朴如下:
主要配置如下:
[S1]
vlan batch 10 20
#
interface Vlanif10
ip address 10.1.1.1 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.254
vrrp vrid 1 priority 200
vrrp vrid 1 preempt-mode timer delay 20
#
interface Vlanif20
ip address 13.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
ospf 1
area 0.0.0.0
network 0.0.0.0 255.255.255.255
#
[S2]
vlan batch 10 30
#
interface Vlanif10
ip address 10.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 10.1.1.254
#
interface Vlanif30
ip address 23.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 30
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
#
ospf 1
area 0.0.0.0
network 0.0.0.0 255.255.255.255
#
[R1]
interface GigabitEthernet0/0/1
ip address 13.1.1.3 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 23.1.1.3 255.255.255.0
#
interface NULL0
#
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
#
ospf 1
area 0.0.0.0
network 0.0.0.0 255.255.255.255
#
验证:
PC1和PC2分别ping R1上的环回口3.3.3.3,然后断开S3上的3口,经几个丢包后,仍然连通,查看VRRP状态,S2已经成为master: