一、实验拓扑
和上个实验《使用BFD备份静态路由》的拓扑一样,编址一样。
二、基础配置
R1的基础配置
#
sysname AR1
#
interface Vlanif1
ip address 192.168.10.1 255.255.255.0
#
interface GigabitEthernet0/0/0
ip address 12.1.1.1 255.255.255.0
ospf cost 5
#
interface GigabitEthernet0/0/1
ip address 102.1.1.1 255.255.255.0
#
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
#
bgp 100
network 12.1.1.2 0.0.0.0
network 102.1.1.2 0.0.0.0
#
三、观查现况(未使能BFD)
在PC上发50个ping包,并同时中断HUB2 和HUB3之间的链路,观察OSPF和BGP的收敛,及PC的丢包
PC>ping 192.168.20.20 -c 50
Ping 192.168.20.20: 32 data bytes, Press Ctrl_C to break
From 192.168.20.20: bytes=32 seq=1 ttl=126 time=16 ms
From 192.168.20.20: bytes=32 seq=2 ttl=126 time=16 ms
From 192.168.20.20: bytes=32 seq=3 ttl=126 time=16 ms
From 192.168.20.20: bytes=32 seq=4 ttl=126 time=31 ms
From 192.168.20.20: bytes=32 seq=5 ttl=126 time=16 ms
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
Request timeout!
From 192.168.20.20: bytes=32 seq=25 ttl=126 time=15 ms
From 192.168.20.20: bytes=32 seq=26 ttl=126 time=15 ms
From 192.168.20.20: bytes=32 seq=27 ttl=126 time=31 ms
From 192.168.20.20: bytes=32 seq=28 ttl=126 time=16 ms
--- 192.168.20.20 ping statistics ---
28 packet(s) transmitted
9 packet(s) received
67.86% packet loss
round-trip min/avg/max = 15/19/31 ms
发现PC上发生40秒的丢包,大约20个包,很严重的问题,想想为什么?
四、配置BFD进行故障收敛的加速
R1的路由器配置(BGP的BFD可选,这里是展示命令)
bfd
quit
ospf 1
bfd all-interfaces enable
bfd all-interfaces min-tx-interval 500 min-rx-interval 500
bgp 100
peer 2.2.2.2 bfd enable
R2的路由器配置(BGP的BFD可选,这里是展示命令)
bfd
quit
ospf 1
bfd all-interfaces enable
bfd all-interfaces min-tx-interval 500 min-rx-interval 500
bgp 100
peer 1.1.1.1 bfd enable
配置完成后检查BFD会话
[AR1]dis bfd session all
--------------------------------------------------------------------------------
Local Remote PeerIpAddr State Type InterfaceName
--------------------------------------------------------------------------------
8192 8192 2.2.2.2 Up D_IP_PEER -
8193 8193 12.1.1.2 Up D_IP_IF GigabitEthernet0/0/0
8194 8194 102.1.1.2 Up D_IP_IF GigabitEthernet0/0/1
--------------------------------------------------------------------------------
Total UP/DOWN Session Number : 3/0
五、重新测试路由收敛速度
重新在PC上发起ping包,再次中断Hub2 和Hub3的连线(先要连好等路由计算正确),测试丢包及收敛速度
PC>ping 192.168.20.20 -c 50
Ping 192.168.20.20: 32 data bytes, Press Ctrl_C to break
From 192.168.20.20: bytes=32 seq=1 ttl=126 time=16 ms
From 192.168.20.20: bytes=32 seq=2 ttl=126 time=16 ms
From 192.168.20.20: bytes=32 seq=3 ttl=126 time=16 ms