概述
VRRP与BFD的联动
- 实验拓扑
- 实验要求
全网使用 OSPF 路由协议联通,SW1 与 SW2 为 VRRP 备份组, SW2 为 Master;在 SW2 与 R1 上启用 BFD,当SW2 与 R1 的互联链路出现故障时,SW2 的 BFD 功能能够快速感知并切换为备用网关状态,令 SW1 成为主用网关。
- 实验步骤
R1:
#
sysname AR1
#
bfd
#
interface GigabitEthernet0/0/0
ip address 192.168.1.1 255.255.255.0
#
interface GigabitEthernet0/0/1
ip address 192.168.2.1 255.255.255.0
#
interface GigabitEthernet0/0/2
ip address 10.1.1.1 255.255.255.0
#
bfd 1 bind peer-ip 172.16.1.1 source-ip 192.168.2.1 auto
commit
#
ospf 1 router-id 1.1.1.1
area 0.0.0.0
network 10.1.1.0 0.0.0.255
network 192.168.1.0 0.0.0.255
network 192.168.2.0 0.0.0.255
#
SW1:
#
sysname SW1
#
vlan batch 30 50
#
interface Vlanif30
ip address 192.168.3.2 255.255.255.0
#
interface Vlanif50
ip address 172.16.1.2 255.255.255.0
vrrp vrid 47 virtual-ip 172.16.1.254
vrrp vrid 47 priority 150
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 50
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 30
#
ospf 1 router-id 5.5.5.5
area 0.0.0.0
network 192.168.3.0 0.0.0.255
network 172.16.1.0 0.0.0.255
#
SW2:
#
sysname SW2
#
vlan batch 40 50
#
bfd
#
interface Vlanif40
ip address 192.168.4.2 255.255.255.0
#
interface Vlanif50
ip address 172.16.1.1 255.255.255.0
vrrp vrid 47 virtual-ip 172.16.1.254
vrrp vrid 47 priority 200
vrrp vrid 47 track bfd-session session-name 1 reduced 51
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 50
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 40
#
bfd 1 bind peer-ip 192.168.2.1 source-ip 172.16.1.1 auto
commit
#
ospf 1 router-id 2.2.2.2
area 0.0.0.0
network 192.168.4.0 0.0.0.255
network 172.16.1.0 0.0.0.255
#
SW3:
#
sysname SW3
#
vlan batch 10 30
#
interface Vlanif10
ip address 192.168.1.2 255.255.255.0
#
interface Vlanif30
ip address 192.168.3.1 255.255.255.0
#
interface MEth0/0/1
#
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 router-id 3.3.3.3
area 0.0.0.0
network 192.168.1.0 0.0.0.255
network 192.168.3.0 0.0.0.255
#
SW4:
#
sysname SW4
#
vlan batch 20 40
#
#
interface Vlanif20
ip address 192.168.2.2 255.255.255.0
#
interface Vlanif40
ip address 192.168.4.1 255.255.255.0
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 40
#
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
#
#
ospf 1 router-id 4.4.4.4
area 0.0.0.0
network 192.168.2.0 0.0.0.255
network 192.168.4.0 0.0.0.255
#
- 实验验证
链路正常:
<SW2>dis bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
8192 8192 192.168.2.1 Up S_AUTO_PEER -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 1/0
<SW2>dis vrrp
Vlanif50 | Virtual Router 47
State : Master
Virtual IP : 172.16.1.254
Master IP : 172.16.1.1
PriorityRun : 200
PriorityConfig : 200
MasterPriority : 200
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-012f
Check TTL : YES
Config type : normal-vrrp
Track BFD : 1 Priority reduced : 51
BFD-session state : UP
Create time : 2022-08-26 13:57:56 UTC-08:00
Last change time : 2022-08-26 14:29:12 UTC-08:00
链路异常:
<SW2>dis vrrp
Vlanif50 | Virtual Router 47
State : Backup
Virtual IP : 172.16.1.254
Master IP : 172.16.1.2
PriorityRun : 149
PriorityConfig : 200
MasterPriority : 150
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-012f
Check TTL : YES
Config type : normal-vrrp
Track BFD : 1 Priority reduced : 51
BFD-session state : DOWN
Create time : 2022-08-26 13:57:56 UTC-08:00
Last change time : 2022-08-26 14:46:20 UTC-08:00
<SW2>dis bfd se
<SW2>dis bfd session al
<SW2>dis bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
8192 8192 192.168.2.1 Init S_AUTO_PEER -
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 0/1
<SW1>dis vrrp
Vlanif50 | Virtual Router 47
State : Master
Virtual IP : 172.16.1.254
Master IP : 172.16.1.2
PriorityRun : 150
PriorityConfig : 150
MasterPriority : 150
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-012f
Check TTL : YES
Config type : normal-vrrp
Create time : 2022-08-26 14:00:05 UTC-08:00
Last change time : 2022-08-26 14:46:20 UTC-08:00
最后
以上就是勤劳路灯为你收集整理的VRRP与BFD的联动的全部内容,希望文章能够帮你解决VRRP与BFD的联动所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复