MSR静态路由+BFD的配置和结果
一、 组网
RTA分别连接RTB和RTC,RTA分别可以通过RTB和RTC到达目的2.2.2.2,设置两条静态默认路
由,0.0.0.0 0 1.1.1.2 preference 60和0.0.0.0 0 3.3.3.2 preference 80,使RTA到达2
.2.2.2优先选择RTB,当RTB这条线路故障,再选择RTC,如图1所示:
图1:组网图
二、 问题描述:
RTA长ping 2.2.2.2,当RTB和RTC之间的链路出现问题,比如网线脱落等因素将造成RTA无法
2.2.2.2/32通信。
三、 过程分析:
RTA上有两条路由,一条为0.0.0.0 0 60.192.255.1 preference 60,路由表中显示的也是此
条路由,一条为0.0.0.0 0 60.192.255.2 preference 80,此条路由作为浮动路由,RTB和RTD
之间的链路出现问题,RTA无法跨链路得知故障,因为RTA和RTB之间的链路是良好的,所以静
态路由0.0.0.0 0 1.1.1.2 preference 60这条路由无法消失,导致0.0.0.0 0 3.3.3.2
preference 80无法浮动起来,RTA上去往2.2.2.2的报文依然扔到RTB,但此时RTB和RTD以无法
通信,造成RTA无法和2.2.2.2通信。
四、 解决方法:
使用BFD功能检测上层链路故障:
RTA配置:
#
Bfd session init-mode active //设置BFD会话的模式,默认为active模式
#
interface Ethernet0/0
port link-mode route
ip address 1.1.1.1 255.255.255.0
bfd min-transmit-interval 500 //配置bfd控制报文的最小时间间隔取值范围200~1000,
且为100的倍数
bfd min-receive-interval 500 //配置接收bfd控制报文的最小时间间隔,取值范围
200~1000,且为100的倍数
bfd detect-multiplier 9 //配置检测时间倍数,默认为5
#
//使能BFD功能,并通过BFD控制报文方式实现BFD功能
ip route-static 0.0.0.0 0.0.0.0 Ethernet0/0 1.1.1.2 bfd control-packet
//通过修改路由优先级方式配置浮动路由
ip route-static 0.0.0.0 0.0.0.0 Ethernet0/0 3.3.3.2 preference 80
#
load xml-configuration
#
load tr069-configuration
#
user-interface tty 12
user-interface aux 0
user-interface vty 0 4
authentication-mode scheme
#
Return
RTD的配置:
#
sysname H3C
#
Bfd session init-mode active
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface GigabitEthernet0/0
port link-mode route
ip address 10.10.10.2 255.255.255.0
bfd min-transmit-interval 500 //配置bfd控制报文的最小时间间隔取值范围200~1000,
且为100的倍数
bfd min-receive-interval 500 //配置接收bfd控制报文的最小时间间隔,取值范围
200~1000,且为100的倍数
bfd detect-multiplier 9 //配置检测时间倍数,默认为5
#
//使能BFD功能,并通过BFD控制报文方式实现BFD功能
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0 10.10.10.1 bfd control-packet
#
Return
RTE的配置:
#
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
#
interface GigabitEthernet0/0
port link-mode route
ip address 20.1.1.2 255.255.255.0
#
ip route-static 0.0.0.0 0.0.0.0 GigabitEthernet0/0 20.1.1.1
结果:
MSR1正常的时候路由表:
[H3C]dis ip rou
Routing Tables: Public
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost NextHop Interface
//可以看到正常情况下系统路由表中显示的默认路由下一条为1.1.1.2
0.0.0.0/0 Static 60 0 1.1.1.2 Eth0/0 //下一跳为RTB
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
在RTA上进行ping操作
[H3C]ping -c 1000 2.2.2.2//在路由器上进行长ping的操作,在长ping过程中模拟RTB到RTD
线路故障,观察BFD的报文
PING 2.2.2.2: 56 data bytes, press CTRL_C to break
Reply from 2.2.2.2: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=4 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=5 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=6 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=7 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=8 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=9 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=10 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=11 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=12 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=13 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=14 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=15 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=16 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=17 ttl=255 time=1 ms
//此时模拟MSR1到MSR2线路不通的情况,可以看到BFD报文
Request time out
%Jan 1 03:17:03:812 2007 H3C BFD/5/BFD_CHANGE_FSM: Sess[64.192.255.15/64.192.255.1,13/51,Eth0/0,Ctrl], Sta: UP->DOWN, Diag: 1
Request time out
Reply from 2.2.2.2: bytes=56 Sequence=20 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=21 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=22 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=23 ttl=255 time=1 ms
Reply from 2.2.2.2: bytes=56 Sequence=24 ttl=255 time=1 ms
Ping通后拔掉MSR2的网线,出现BFD检测,之后又通了说明和MSR3建立了连接。
拔掉MSR2网线后MSR1的路由表:
[H3C]dis ip rou
Routing Tables: Public
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost NextHop Interface
//可以看到下一跳变成了MSR3的IP地址
0.0.0.0/0 Static 80 0 3.3.3.2 Eth0/0 //下一跳变为RTC
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoop0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoop0
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作