【华为】BFD与静态路由和RIP联用

【华为】BFD与静态路由和RIP联用

实验需求

如上图组网所示,在R1上配置到达R4的Loopback0。

4.4.4.4/32网段的浮动静态路由,正常情况下通过R3访问R4。

当R3故障时,自动选路通过R2访问R4的Loopback0;在R1与R3之间建立BFD会话,并与静态路由绑定,实现故障快速检测和路径快速收敛。

配置

AR1

c 复制代码
<AR1>system-view
Enter system view, return user view with Ctrl+Z.
[AR1]sysname AR1

[AR1]undo info-center enable 
Info: Information center is disabled.

[AR1]int g0/0/0
[AR1-GigabitEthernet0/0/0]ip address 13.13.13.1 24
[AR1-GigabitEthernet0/0/0]quit
	
[AR1]int g0/0/01
[AR1-GigabitEthernet0/0/1]ip address 12.12.12.1 24
[AR1-GigabitEthernet0/0/1]qu

## 开启BFD功能
[AR1]bfd
[AR1-bfd]qu

[AR1]bfd 13 bind peer-ip 13.13.13.3 interface GigabitEthernet 0/0/0
[AR1-bfd-session-13]discriminator local 10
[AR1-bfd-session-13]discriminator remote 20
[AR1-bfd-session-13]commit
[AR1-bfd-session-13]qu

[AR1]ip route-static 4.4.4.4 32 13.13.13.3 track bfd-session 13
[AR1]ip route-static 4.4.4.4 32 12.12.12.2 preference 100

AR2

c 复制代码
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysn AR2

[AR2]undo info-center enable 
Info: Information center is disabled.

[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip address 12.12.12.2 24
[AR2-GigabitEthernet0/0/0]quit

[AR2]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip address 24.24.24.2 24
[AR2-GigabitEthernet0/0/1]quit

## 开启BFD功能
[AR2]bfd
[AR2-bfd]qu

## RIPv2的宣告
[AR2]rip
[AR2-rip-1]version 2
[AR2-rip-1]undo summary
[AR2-rip-1]bfd all-interface enable                   ## RIP的全接口启用BFD
[AR2-rip-1]network 12.0.0.0
[AR2-rip-1]network 24.0.0.0
[AR2-rip-1]quit

AR3

c 复制代码
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR3

[AR3]undo info-center enable 
Info: Information center is disabled.

[AR3]int g0/0/0
[AR3-GigabitEthernet0/0/0]ip address 13.13.13.3 24
[AR3-GigabitEthernet0/0/0]qu

[AR3]int g0/0/01
[AR3-GigabitEthernet0/0/1]ip address 34.34.34.3 24
[AR3-GigabitEthernet0/0/1]qu

## 开启BFD功能
[AR3]bfd
[AR3-bfd]qu

[AR3]bfd 31 bind peer-ip 13.13.13.1 interface g0/0/0
[AR3-bfd-session-31]discriminator local 20
[AR3-bfd-session-31]discriminator remote 10
[AR3-bfd-session-31]commit
[AR3-bfd-session-31]qu

## RIPv2的宣告
[AR3]rip 
[AR3-rip-1]version 2
[AR3-rip-1]undo summary
[AR3-rip-1]bfd all-interface enable                   ## RIP的全接口启用BFD
[AR3-rip-1]network 13.0.0.0
[AR3-rip-1]network 34.0.0.0
[AR3-rip-1]qu

AR4

c 复制代码
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname AR4

[AR4]undo info-center enable 
Info: Information center is disabled.

[AR4]int g0/0/0
[AR4-GigabitEthernet0/0/0]ip address 34.34.34.4 24
[AR4-GigabitEthernet0/0/0]qu

[AR4]int g0/0/01
[AR4-GigabitEthernet0/0/1]ip address 24.24.24.4 24
[AR4-GigabitEthernet0/0/1]qu

[AR4]int loopback 0
[AR4-LoopBack0]ip address 4.4.4.4 32
[AR4-LoopBack0]qu

## 开启BFD功能
[AR4]bfd
[AR4-bfd]qu

## RIPv2的宣告
[AR4]rip
[AR4-rip-1]version 2
[AR4-rip-1]undo summary
[AR4-rip-1]bfd all-interface enable                   ## RIP的全接口启用BFD
[AR4-rip-1]network 34.0.0.0
[AR4-rip-1]network 24.0.0.0
[AR4-rip-1]network 4.0.0.0
[AR4-rip-1]qu

效果

在R1身上去 tracert R4的loopback 0 接口地址4.4.4.4/32

可以看到我是走R3的,说明符合我的预期

此时,我把R3的G0/0/0接口shutdown掉

这个时候,可以看到我R1是走R2去访问 4.4.4.4/32 的流量了

抓包查看

相关推荐
fantasy_arch29 分钟前
CPU性能优化-磁盘空间和解析时间
网络·性能优化
AORO_BEIDOU2 小时前
单北斗+鸿蒙系统+国产芯片,遨游防爆手机自主可控“三保险”
华为·智能手机·harmonyos
是Dream呀2 小时前
Python从0到100(七十八):神经网络--从0开始搭建全连接网络和CNN网络
网络·python·神经网络
博览鸿蒙3 小时前
鸿蒙操作系统(HarmonyOS)的应用开发入门
华为·harmonyos
kaixin_learn_qt_ing3 小时前
了解RPC
网络·网络协议·rpc
安全小王子4 小时前
Kali操作系统简单介绍
网络·web安全
Hacker_LaoYi5 小时前
【漏洞分析】DDOS攻防分析(四)——TCP篇
网络·tcp/ip·ddos
爱吃水果蝙蝠汤5 小时前
DATACOM-IP单播路由(BGP)-复习-实验
网络·网络协议·tcp/ip
Sun_12_26 小时前
SQL注入(SQL lnjection Base)21
网络·数据库