前言
vrrp 漂移网关地址,根据优先级来
vrrp 可以用在思科,还可用在华为
思科的PVST+就是双组双备————HSRP
The device is running!
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname lsw1
[lsw1]vlan bat 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw1]int g 0/0/2
[lsw1-GigabitEthernet0/0/2]p l t
[lsw1-GigabitEthernet0/0/2]p t a v 10 20
[lsw1-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[lsw1-GigabitEthernet0/0/2]int vlanif 100
[lsw1-Vlanif100]q
[lsw1]int g 0/0/1
[lsw1-GigabitEthernet0/0/1]p l a
[lsw1-GigabitEthernet0/0/1]p d v 100
[lsw1-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[lsw1-GigabitEthernet0/0/1]int vlanif 100
[lsw1-Vlanif100]ip add 11.0.0.2 30
[lsw1-Vlanif100]un sh
Info: Interface Vlanif100 is not shutdown.
[lsw1-Vlanif100]int vlanif 10
[lsw1-Vlanif10]ip add 192.168.10.10 24
[lsw1-Vlanif10]vrrp ?
advertise VRRP advertise message
un-check Uncheck VRRP packet TTL value
vrid Specify virtual router identifier
[lsw1-Vlanif10]vrrp vrid ?
INTEGER<1-255> Virtual router identifier
[lsw1-Vlanif10]vrrp vrid 1 ?
authentication-mode Specify password and authentication mode
preempt-mode Specify preempt mode
priority Specify priority
timer Specify timer
track Specify the track configuration
version-3 Specify the device to support V3 for VRRP
virtual-ip Specify virtual IP address
[lsw1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1 //需要先设置虚拟ip地址,才可启用
[lsw1-Vlanif10]vrrp vrid 1 priority 120
[lsw1-Vlanif10]vrrp vrid 1 track interface g 0/0/1
[lsw1-Vlanif10]vrrp vrid 1 track interface g 0/0/2
[lsw1-Vlanif10]int vlanif 20
[lsw1-Vlanif20]ip add 192.168.20.10 24
[lsw1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[lsw1-Vlanif20]vrrp vrid 2 priority 115
[lsw1-Vlanif20]q
[lsw1]ip route-static 0.0.0.0 0 11.0.0.1
The device is running!
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname LSW2
[LSW2]vlan bat 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[LSW2]int g 0/0/2
[LSW2-GigabitEthernet0/0/2]p l t
[LSW2-GigabitEthernet0/0/2] p t a v 10 20
[LSW2-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[LSW2-GigabitEthernet0/0/2]int g 0/0/1
[LSW2-GigabitEthernet0/0/1]p l a
[LSW2-GigabitEthernet0/0/1]p d v 100
[LSW2-GigabitEthernet0/0/1]int vlanif 100
[LSW2-Vlanif100]ip add 12.0.0.2 30
[LSW2-Vlanif100]int vlanif 10
[LSW2-Vlanif10]ip add 192.168.10.20 24
[LSW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[LSW2-Vlanif10]vrrp vrid 1 priority 115
[LSW2-Vlanif10]int vlanif 20
[LSW2-Vlanif20]ip add 192.168.20.20 24
[LSW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[LSW2-Vlanif20]vrrp vrid 2 priority 120
[LSW2-Vlanif20]vrrp vrid 2 ?
authentication-mode Specify password and authentication mode
preempt-mode Specify preempt mode
priority Specify priority
timer Specify timer
track Specify the track configuration
version-3 Specify the device to support V3 for VRRP
virtual-ip Specify virtual IP address
[LSW2-Vlanif20]vrrp vrid 2 track interface g 0/0/1
[LSW2-Vlanif20]vrrp vrid 2 track interface g 0/0/2
[LSW2-Vlanif20]q
[LSW2]ip route-static 0.0.0.0 0 12.0.0.1
The device is running!
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname lsw3
[lsw3]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[lsw3]int e 0/0/1
[lsw3-Ethernet0/0/1]p l a
[lsw3-Ethernet0/0/1]p d v 10
[lsw3-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
[lsw3-Ethernet0/0/1]int e 0/0/2
[lsw3-Ethernet0/0/2]p l a
[lsw3-Ethernet0/0/2]p d v 20
[lsw3-Ethernet0/0/2]un sh
Info: Interface Ethernet0/0/2 is not shutdown.
[lsw3-Ethernet0/0/2]int g 0/0/1
[lsw3-GigabitEthernet0/0/1]p l t
[lsw3-GigabitEthernet0/0/1]p t a v 10 20
[lsw3-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[lsw3-GigabitEthernet0/0/1]int g 0/0/2
[lsw3-GigabitEthernet0/0/2]p l t
[lsw3-GigabitEthernet0/0/2]p t a v 10 20
[lsw3-GigabitEthernet0/0/2]un sh
Info: Interface GigabitEthernet0/0/2 is not shutdown.
[lsw3-GigabitEthernet0/0/2]dis vlan
The total number of vlans is : 3
VID Type Ports
--------------------------------------------------------------------------------
1 common UT:Eth0/0/3(D) Eth0/0/4(D) Eth0/0/5(D) Eth0/0/6(D)
Eth0/0/7(D) Eth0/0/8(D) Eth0/0/9(D) Eth0/0/10(D)
Eth0/0/11(D) Eth0/0/12(D) Eth0/0/13(D) Eth0/0/14(D)
Eth0/0/15(D) Eth0/0/16(D) Eth0/0/17(D) Eth0/0/18(D)
Eth0/0/19(D) Eth0/0/20(D) Eth0/0/21(D) Eth0/0/22(D)
GE0/0/1(U) GE0/0/2(U)
10 common UT:Eth0/0/1(U)
TG:GE0/0/1(U) GE0/0/2(U)
20 common UT:Eth0/0/2(U)
TG:GE0/0/1(U) GE0/0/2(U)
VID Status Property MAC-LRN Statistics Description
--------------------------------------------------------------------------------
1 enable default enable disable VLAN 0001
10 enable default enable disable VLAN 0010
20 enable default enable disable VLAN 0020
The device is running!
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sysname AR1
[AR1]int g 0/0/0
[AR1-GigabitEthernet0/0/0]ip add 11.0.0.1 30
[AR1-GigabitEthernet0/0/0]un sh
Info: Interface GigabitEthernet0/0/0 is not shutdown.
[AR1-GigabitEthernet0/0/0]int g 0/0/1
[AR1-GigabitEthernet0/0/1]ip add 12.0.0.1 30
[AR1-GigabitEthernet0/0/1]un sh
Info: Interface GigabitEthernet0/0/1 is not shutdown.
[AR1-GigabitEthernet0/0/1]q
[AR1]int LoopBack 0
[AR1-LoopBack0]ip add 1.1.1.1 32
[AR1-LoopBack0]q
[AR1]ip route-static 192.168.10.0 24 11.0.0.2
[AR1]ip route-static 192.168.10.0 24 12.0.0.2 ?
description Add or delete description of unicast static route
inherit-cost Inherit the cost of the iterated route
permanent Specifies route permanent
preference Specifies route preference
tag Specifies route tag
track Specify track object
Please press ENTER to execute command
[AR1]ip route-static 192.168.10.0 24 12.0.0.2 preference 70
[AR1]ip route-static 192.168.20.0 24 12.0.0.2
[AR1]ip route-static 192.168.20.0 24 11.0.0.2 preference 70
[lsw1]dis ip routing
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10 Routes : 10
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 11.0.0.1 Vlanif100
11.0.0.0/30 Direct 0 0 D 11.0.0.2 Vlanif100
11.0.0.2/32 Direct 0 0 D 127.0.0.1 Vlanif100
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.10.0/24 Direct 0 0 D 192.168.10.10 Vlanif10
192.168.10.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
192.168.10.10/32 Direct 0 0 D 127.0.0.1 Vlanif10
192.168.20.0/24 Direct 0 0 D 192.168.20.10 Vlanif20
192.168.20.10/32 Direct 0 0 D 127.0.0.1 Vlanif20
[LSW2]dis ip routing
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10 Routes : 10
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 12.0.0.1 Vlanif100
12.0.0.0/30 Direct 0 0 D 12.0.0.2 Vlanif100
12.0.0.2/32 Direct 0 0 D 127.0.0.1 Vlanif100
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.10.0/24 Direct 0 0 D 192.168.10.20 Vlanif10
192.168.10.20/32 Direct 0 0 D 127.0.0.1 Vlanif10
192.168.20.0/24 Direct 0 0 D 192.168.20.20 Vlanif20
192.168.20.1/32 Direct 0 0 D 127.0.0.1 Vlanif20
192.168.20.20/32 Direct 0 0 D 127.0.0.1 Vlanif20
可以发现针对192.168.20.0 和192.168.10.0 网段的信息如下
192.168.10.0/24 Static 60 0 RD 11.0.0.2 GigabitEthernet0/0/0
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet0/0/1
[AR1]dis ip routing
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.0.0.0/30 Direct 0 0 D 11.0.0.1 GigabitEthernet
0/0/0
11.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
11.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
12.0.0.0/30 Direct 0 0 D 12.0.0.1 GigabitEthernet
0/0/1
12.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
12.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.10.0/24 Static 60 0 RD 11.0.0.2 GigabitEthernet
0/0/0
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
此时
[lsw1]dis vrrp
Vlanif10 | Virtual Router 1
State : Master
Virtual IP : 192.168.10.1
Master IP : 192.168.10.10
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Track IF : GigabitEthernet0/0/1 Priority reduced : 10
IF state : UP
Track IF : GigabitEthernet0/0/2 Priority reduced : 10
IF state : UP
Create time : 2019-12-18 10:33:17 UTC-08:00
Last change time : 2019-12-18 10:33:21 UTC-08:00
Vlanif20 | Virtual Router 2
State : Backup
Virtual IP : 192.168.20.1
Master IP : 192.168.20.20
PriorityRun : 115
PriorityConfig : 115
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-12-18 10:39:35 UTC-08:00
Last change time : 2019-12-18 10:41:23 UTC-08:00
[LSW2]dis vrrp
Vlanif10 | Virtual Router 1
State : Backup
Virtual IP : 192.168.10.1
Master IP : 192.168.10.10
PriorityRun : 115
PriorityConfig : 115
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-12-18 10:40:11 UTC-08:00
Last change time : 2019-12-18 10:40:11 UTC-08:00
Vlanif20 | Virtual Router 2
State : Master
Virtual IP : 192.168.20.1
Master IP : 192.168.20.20
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Track IF : GigabitEthernet0/0/1 Priority reduced : 10
IF state : UP
Track IF : GigabitEthernet0/0/2 Priority reduced : 10
IF state : UP
Create time : 2019-12-18 10:41:15 UTC-08:00
Last change time : 2019-12-18 10:41:23 UTC-08:00
[lsw1] int g 0/0/1
[lsw1-GigabitEthernet0/0/1]shut
[lsw1-GigabitEthernet0/0/1]shutdown
发现数据包路径转移到LSW2中
不变
down掉的ip网段不看,别的没啥不同
[lsw1]dis ip routing
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 6 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.10.0/24 Direct 0 0 D 192.168.10.10 Vlanif10
192.168.10.10/32 Direct 0 0 D 127.0.0.1 Vlanif10
192.168.20.0/24 Direct 0 0 D 192.168.20.10 Vlanif20
192.168.20.10/32 Direct 0 0 D 127.0.0.1 Vlanif20
不变
[LSW2]dis ip routing
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 11 Routes : 11
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 RD 12.0.0.1 Vlanif100
12.0.0.0/30 Direct 0 0 D 12.0.0.2 Vlanif100
12.0.0.2/32 Direct 0 0 D 127.0.0.1 Vlanif100
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.10.0/24 Direct 0 0 D 192.168.10.20 Vlanif10
192.168.10.1/32 Direct 0 0 D 127.0.0.1 Vlanif10
192.168.10.20/32 Direct 0 0 D 127.0.0.1 Vlanif10
192.168.20.0/24 Direct 0 0 D 192.168.20.20 Vlanif20
192.168.20.1/32 Direct 0 0 D 127.0.0.1 Vlanif20
192.168.20.20/32 Direct 0 0 D 127.0.0.1 Vlanif20
之前的路由信息
192.168.10.0/24 Static 60 0 RD 11.0.0.2 GigabitEthernet0/0/0
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet0/0/1
现在的路由信息
192.168.10.0/24 Static 70 0 RD 12.0.0.2 GigabitEthernet0/0/1
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet0/0/1
[AR1]dis ip routing
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 10 Routes : 10
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
12.0.0.0/30 Direct 0 0 D 12.0.0.1 GigabitEthernet
0/0/1
12.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
12.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.10.0/24 Static 70 0 RD 12.0.0.2 GigabitEthernet
0/0/1
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
之前的vrrp
现在的vrrp
[lsw1]dis vrrp
Vlanif10 | Virtual Router 1
State : Backup
Virtual IP : 192.168.10.1
Master IP : 192.168.10.20
PriorityRun : 110
PriorityConfig : 120
MasterPriority : 115
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Track IF : GigabitEthernet0/0/1 Priority reduced : 10
IF state : DOWN
Track IF : GigabitEthernet0/0/2 Priority reduced : 10
IF state : UP
Create time : 2019-12-18 10:33:17 UTC-08:00
Last change time : 2019-12-18 11:20:18 UTC-08:00
Vlanif20 | Virtual Router 2
State : Backup
Virtual IP : 192.168.20.1
Master IP : 192.168.20.20
PriorityRun : 115
PriorityConfig : 115
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-12-18 10:39:35 UTC-08:00
Last change time : 2019-12-18 10:41:23 UTC-08:00
[LSW2]dis vrrp
Vlanif10 | Virtual Router 1
State : Master
Virtual IP : 192.168.10.1
Master IP : 192.168.10.20
PriorityRun : 115
PriorityConfig : 115
MasterPriority : 115
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-12-18 10:40:11 UTC-08:00
Last change time : 2019-12-18 11:20:18 UTC-08:00
Vlanif20 | Virtual Router 2
State : Master
Virtual IP : 192.168.20.1
Master IP : 192.168.20.20
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Track IF : GigabitEthernet0/0/1 Priority reduced : 10
IF state : UP
Track IF : GigabitEthernet0/0/2 Priority reduced : 10
IF state : UP
Create time : 2019-12-18 10:41:15 UTC-08:00
Last change time : 2019-12-18 10:41:23 UTC-08:00
之前的vrrp
现在的vrrp
自动恢复正常
[lsw1]dis vrrp
Vlanif10 | Virtual Router 1
State : Master
Virtual IP : 192.168.10.1
Master IP : 192.168.10.10
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Track IF : GigabitEthernet0/0/1 Priority reduced : 10
IF state : UP
Track IF : GigabitEthernet0/0/2 Priority reduced : 10
IF state : UP
Create time : 2019-12-18 10:33:17 UTC-08:00
Last change time : 2019-12-18 11:23:54 UTC-08:00
Vlanif20 | Virtual Router 2
State : Backup
Virtual IP : 192.168.20.1
Master IP : 192.168.20.20
PriorityRun : 115
PriorityConfig : 115
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-12-18 10:39:35 UTC-08:00
Last change time : 2019-12-18 10:41:23 UTC-08:00
[LSW2]dis vrrp
Vlanif10 | Virtual Router 1
State : Backup
Virtual IP : 192.168.10.1
Master IP : 192.168.10.10
PriorityRun : 115
PriorityConfig : 115
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-12-18 10:40:11 UTC-08:00
Last change time : 2019-12-18 11:23:54 UTC-08:00
Vlanif20 | Virtual Router 2
State : Master
Virtual IP : 192.168.20.1
Master IP : 192.168.20.20
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Track IF : GigabitEthernet0/0/1 Priority reduced : 10
IF state : UP
Track IF : GigabitEthernet0/0/2 Priority reduced : 10
IF state : UP
Create time : 2019-12-18 10:41:15 UTC-08:00
Last change time : 2019-12-18 10:41:23 UTC-08:00
刚才的路由信息
192.168.10.0/24 Static 70 0 RD 12.0.0.2 GigabitEthernet0/0/1
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet0/0/1
现在的路由信息
192.168.10.0/24 Static 60 0 RD 11.0.0.2 GigabitEthernet0/0/0
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet0/0/1
也恢复原状
[AR1]dis ip routing
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.0.0.0/30 Direct 0 0 D 11.0.0.1 GigabitEthernet
0/0/0
11.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
11.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
12.0.0.0/30 Direct 0 0 D 12.0.0.1 GigabitEthernet
0/0/1
12.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
12.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.10.0/24 Static 60 0 RD 11.0.0.2 GigabitEthernet
0/0/0
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[lsw1]int g 0/0/2
[lsw1-GigabitEthernet0/0/2]shut
刚才的vrrp
现在的vrrp
[lsw1]dis vrrp
Vlanif10 | Virtual Router 1
State : Initialize
Virtual IP : 192.168.10.1
Master IP : 0.0.0.0
PriorityRun : 110
PriorityConfig : 120
MasterPriority : 0
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Track IF : GigabitEthernet0/0/1 Priority reduced : 10
IF state : UP
Track IF : GigabitEthernet0/0/2 Priority reduced : 10
IF state : DOWN
Create time : 2019-12-18 10:33:17 UTC-08:00
Last change time : 2019-12-18 11:29:01 UTC-08:00
Vlanif20 | Virtual Router 2
State : Initialize
Virtual IP : 192.168.20.1
Master IP : 0.0.0.0
PriorityRun : 115
PriorityConfig : 115
MasterPriority : 0
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-12-18 10:39:35 UTC-08:00
Last change time : 2019-12-18 11:29:01 UTC-08:00
[LSW2]dis vrrp
Vlanif10 | Virtual Router 1
State : Master
Virtual IP : 192.168.10.1
Master IP : 192.168.10.20
PriorityRun : 115
PriorityConfig : 115
MasterPriority : 115
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0101
Check TTL : YES
Config type : normal-vrrp
Create time : 2019-12-18 10:40:11 UTC-08:00
Last change time : 2019-12-18 11:29:03 UTC-08:00
Vlanif20 | Virtual Router 2
State : Master
Virtual IP : 192.168.20.1
Master IP : 192.168.20.20
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-0102
Check TTL : YES
Config type : normal-vrrp
Track IF : GigabitEthernet0/0/1 Priority reduced : 10
IF state : UP
Track IF : GigabitEthernet0/0/2 Priority reduced : 10
IF state : UP
Create time : 2019-12-18 10:41:15 UTC-08:00
Last change time : 2019-12-18 10:41:23 UTC-08:00
之前的路由信息
192.168.10.0/24 Static 60 0 RD 11.0.0.2 GigabitEthernet0/0/0
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet0/0/1
现在的路由信息
192.168.10.0/24 Static 60 0 RD 11.0.0.2 GigabitEthernet0/0/0
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet0/0/1
路由条目没有发生改变
[AR1]dis ip routing
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 13 Routes : 13
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.1/32 Direct 0 0 D 127.0.0.1 LoopBack0
11.0.0.0/30 Direct 0 0 D 11.0.0.1 GigabitEthernet
0/0/0
11.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
11.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
12.0.0.0/30 Direct 0 0 D 12.0.0.1 GigabitEthernet
0/0/1
12.0.0.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
12.0.0.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.10.0/24 Static 60 0 RD 11.0.0.2 GigabitEthernet
0/0/0
192.168.20.0/24 Static 60 0 RD 12.0.0.2 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
可以发现链接超时,数据包从右边LSW2(此时vrrp为master)进路由器,然后从左边LSW1出
因为AR1浮动路由并未启用,导致超时,通向192.168.10.0的路由条目的下一跳为11.0.0.2(LSW1的g0/0/1口)
不变