3.8自动侦测的配置
3.8.1静态路由中的配置
【需求】
路由器使用FR作为主用线路,当主用线路出现故障时能够通过静态路由切换到备用线路
【组网图】
【配置脚本】
配置脚本 |
# sysname Router # radius scheme system # domain system # detect-group 1
/配置detect-group 1/ detect-list 1 ip
address 192.168.1.1 /检测192.168.1.1的可达性/ # interface Serial2/0/0 link-protocol fr fr map ip 192.168.1.1 200
broadcast ip address 192.168.1.2 255.255.255.252 # interface Serial2/0/1 link-protocol ppp ip address 172.16.1.2 255.255.255.252 # interface NULL0 # ip route-static 0.0.0.0 0.0.0.0
192.168.1.1 preference 60 detect-group 1
/当主用出口可达是默认路由生效/ ip route-static 0.0.0.0 0.0.0.0
172.16.1.1 preference 80
/备用出口路由/ # user-interface con 0 user-interface vty 0 4 # return |
【验证】
当主用出口不可达时的状态:
<Router>disp 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
192.168.1.1
not specified
<Router>disp ip routing-table
Routing Table:
public net
Destination/Mask Protocol Pre Cost Nexthop
Interface
0.0.0.0/0
STATIC 80 0
172.16.1.1
Serial2/0/1 /默认路由发生切换/
2.2.2.2/32
DIRECT 0 0
127.0.0.1
InLoopBack0
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
172.16.1.0/30 DIRECT 0 0
172.16.1.2
Serial2/0/1
172.16.1.1/32 DIRECT 0 0
172.16.1.1
Serial2/0/1
172.16.1.2/32 DIRECT 0 0
127.0.0.1
InLoopBack0
192.168.1.0/30 DIRECT 0 0
192.168.1.2
Serial2/0/0
192.168.1.2/32 DIRECT 0 0
127.0.0.1
InLoopBack0
【提示】
1、当主用线路为FR、Ethernet等线路时,链路层up不一定表示整条链路是可达的,可以使用自动检测功能对主线路进行监测。