BFD双向转发检测协议
Tips:
- 一种全网统一、检测迅速、监控网络中链路或者IP路由的双向转发连通状况,并为上层应用提供服务的技术。
- 联动功能由检测模块、Track和应用模块三部分组成。
- 查看bfd会话命令:dis bfd session all
本次实验模拟配置BFD+VRRP
AR2配置如下:
<Huawei>
<Huawei>sy
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 10.1.1.2 24
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.2 24
[Huawei-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.1
[Huawei-GigabitEthernet0/0/0]vrrp vrid 1 priority 120
[Huawei-GigabitEthernet0/0/0]vrrp vrid 1 preempt-mode timer delay 5
[Huawei-GigabitEthernet0/0/0]vrrp vrid 1 track interface g0/0/1 reduced 20
AR3配置如下:
<Huawei>sy
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.3 24
[Huawei-GigabitEthernet0/0/0]vrrp vrid 1 virtual-ip 192.168.1.1
[Huawei-GigabitEthernet0/0/0]vrrp vrid 1 priority 110
AR1配置如下:
<Huawei>sy
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 10.1.1.1 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 20.1.1.1 24
模拟端口断开
<Huawei>sy
[Huawei]int eth0/0/2
[Huawei-Ethernet0/0/2]shutdown
查看AR2端口vrrp状态:因为track只能检测直连端口状态,所以ar2端口还是master
接下来配置BFD,测试效果
AR2配置如下:
[Huawei]bfd //使能bfd
[Huawei-bfd]q
[Huawei]bfd 2 bind peer-ip 10.1.1.1 source-ip 10.1.1.2 //给bfd会话命名2,绑定对端ip及源ip
[Huawei-bfd-session-2]discriminator local 12 //配置鉴别本地号码
[Huawei-bfd-session-2]discriminator remote 21 //配置鉴别远端号码
[Huawei-bfd-session-2]commit //提交激活[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]un vrrp vrid 1 track interface //取消配置跟踪端口设置
[Huawei-GigabitEthernet0/0/0]vrrp vrid 1 track bfd-session 12 reduced 20 //track 模块联动 bfd协议鉴别号为12,降低优先级20个(切换成为备份vrrp网关)
AR1配置如下:
[Huawei]bfd //使能bfd
[Huawei-bfd]q
[Huawei]bfd 2 bind peer-ip 10.1.1.2 source-ip 10.1.1.1 //bfd命名2,绑定远端ip及源ip
[Huawei-bfd-session-2]discriminator local 21 //配置鉴别器本地号码
[Huawei-bfd-session-2]discriminator remote 12 //配置鉴别器远端号码
[Huawei-bfd-session-2]commit //提交