拓朴如下:
主要配置如下:
[S1]
vlan batch 10 20
#
interface Vlanif10ip address 10.1.1.1 255.255.255.0vrrp vrid 1 virtual-ip 10.1.1.254vrrp vrid 1 priority 200vrrp vrid 1 preempt-mode timer delay 20
#
interface Vlanif20ip address 13.1.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1port link-type accessport default vlan 10
#
interface GigabitEthernet0/0/2port link-type accessport default vlan 20
#
ospf 1area 0.0.0.0network 0.0.0.0 255.255.255.255
#[S2]
vlan batch 10 30
#
interface Vlanif10ip address 10.1.1.2 255.255.255.0vrrp vrid 1 virtual-ip 10.1.1.254
#
interface Vlanif30ip address 23.1.1.2 255.255.255.0
#
interface GigabitEthernet0/0/1port link-type accessport default vlan 30
#
interface GigabitEthernet0/0/2port link-type accessport default vlan 10
#
ospf 1area 0.0.0.0network 0.0.0.0 255.255.255.255
#[R1]
interface GigabitEthernet0/0/1ip address 13.1.1.3 255.255.255.0
#
interface GigabitEthernet0/0/2ip address 23.1.1.3 255.255.255.0
#
interface NULL0
#
interface LoopBack0ip 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: