
静态路由绑定探测组功能的配置
一、组网需求:
原来v3平台Auto-detect功能在v5上被NQA(网络质量分析)和Track替代,v5上已经没有Auto-detect相关命令。本实验需要实现RouterA上配置一条静态路由,下一跳是RouterB,RouterA和RouterB通过2层交换机相连,RouterA上配置Track组探测RouterB的地址是否可达,如果探测失败,将RouterA上的静态路由失效。
设备清单:MSR系列路由器2台
二、组网图:
三、配置步骤:
适用设备和版本:MSR系列、Version 5.20, Beta 1506后所有版本。
| RouterA配置 |
| # interface GigabitEthernet0/0 port link-mode route ip address 1.2.0.1 255.255.255.0 # //配置探测组admin oper nqa entry admin oper //类型为ICMP-Echo,即ping操作 type icmp-echo //ping的目的地址1.2.0.2 destination ip 1.2.0.2 //频率为1000毫秒,即1秒 frequency 1000 //配置反应组1,即如果连续测试3次失败则触发相关动作 reaction 1 checked-element probe-fail threshold-type consecutive 3 action-type trigger-only # //将静态路由和跟踪组1绑定 ip route-static 0.0.0.0 0.0.0.0 1.2.0.2 track 1 # //跟踪组1和admin oper的reaction 1绑定,即反应组1触发跟踪组1 track 1 nqa entry admin oper reaction 1 # //使能nqa nqa agent enable //nqa调度配置,即从配置开始起一直进行调度测试 nqa schedule admin oper start-time now lifetime forever # |
1) 配置NQA探测组,其中关键配置是Reaction的配置;
2) 配置Track跟踪组,并和Reaction绑定;
3) 将静态路由和Track组绑定;
4) 使能nqa agent和nqa调度。
AR系列路由器Atuo-detect功能在静态路由应用中的典型配置
【组网需求】
在RouterA和RouterC之间创建静态路由;在RouterA上创建侦测组,当侦测组可达时使静态路
由生效。
【组网图】
【配置脚本】
| RouterA配置脚本 |
| # sysname RouterA # detect-group 1 /创建侦测组/ detect-list 1 ip address 10.1.1.1 nexthop 192.168.1.2 # interface Serial1/1 clock DTECLK1 link-protocol ppp ip address 192.168.1.1 255.255.255.0 # ip route-static 10.1.1.0 255.255.255.0 192.168.1.2 preference 60 detect-group 1 /将侦测组与静态路由绑定/ # |
| RouterB、RouterC配置脚本 |
| # 略 |
当RouterA和RouterC之间可达时,RouterA上的路由表和侦测组的情况为:
[RouterA]dis ip rout
Routing Table: public net
Destination/Mask Protocol Pre Cost Nexthop Interface
10.1.1.0/24 STATIC 60 0 192.168.1.2 Serial1/1
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
192.168.1.0/24 DIRECT 0 0 192.168.1.1 Serial1/1
192.168.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
192.168.1.2/32 DIRECT 0 0 192.168.1.2 Serial1/1
[RouterA]dis detect-group
detect-group 1 :
detect loop time(s) : 15
ping wait time(s) : 2
detect retry times : 2
detect ip option : and
group state : reachable
register module num : 1
detect ip count : 1
detect-list ip address next hop
1 10.1.1.1 192.168.1.2
现人为断开RouterB和RouterC之间的链路,然后再次显示RouterA上的路由表及侦测组的情况:
[RouterA]dis ip rout
Routing Table: public net
Destination/Mask Protocol Pre Cost Nexthop Interface
127.0.0.0/8 DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
192.168.1.0/24 DIRECT 0 0 192.168.1.1 Serial1/1
192.168.1.1/32 DIRECT 0 0 127.0.0.1 InLoopBack0
192.168.1.2/32 DIRECT 0 0 192.168.1.2 Serial1/1
[RouterA]dis detect-group
detect-group 1 :
detect loop time(s) : 15
ping wait time(s) : 2
detect retry times : 2
detect ip option : and
group state : unreachable
register module num : 1
detect ip count : 1
detect-list ip address next hop
1 10.1.1.1 192.168.1.2
可以看到,当侦测组不可达时,RouterA上到RouterC的静态路由已经消失。
