简介
本文档介绍与Cisco IOS-XE不同的Cisco IOS-XE软件在路由表中安装默认路由时的预期行为。
问题:路由表中不存在默认路由
默认路由不显示在路由表和转发表中,尽管它已正确配置,并且在show running-config和show sdwan running-config中均可看到
Router#sh run | i ip route 0\.0\.0\.0
ip route 0.0.0.0 0.0.0.0 192.168.10.10
Router#sh sdwan run | i ip route 0\.0\.0\.0
ip route 0.0.0.0 0.0.0.0 192.168.10.10
同时,您在路由表和转发表中看不到该路由:
Router#sh ip ro | b Gateway
Gateway of last resort is not set
192.168.9.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.9.0/24 is directly connected, GigabitEthernet0/0/0
L 192.168.9.254/32 is directly connected, GigabitEthernet0/0/0
192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.10.0/24 is directly connected, GigabitEthernet0/0/1
L 192.168.10.254/32 is directly connected, GigabitEthernet0/0/1
Router#sh ip cef 0.0.0.0/0
0.0.0.0/0
no route
故障排除
您可以尝试调试ip routing和debug ip cef events,以便了解此路由未安装的原因:
*Dec 22 10:34:43.706: RT: updating static 0.0.0.0/0 (0x0) [local lbl/ctx:1048577/0x0] omp-tag:0 :
via 192.168.10.10 0 1048578 0x100001
*Dec 22 10:34:43.707: RT: add 0.0.0.0/0 via 192.168.10.10, static metric [1/0]
*Dec 22 10:34:43.707: RT: default path is now 0.0.0.0 via 192.168.10.10
*Dec 22 10:34:43.997: RT: del 0.0.0.0 via 192.168.10.10, static metric [1/0]
*Dec 22 10:34:43.997: RT: delete network route to 0.0.0.0/0
*Dec 22 10:34:43.997: RT: default path has been cleared
*Dec 22 10:34:43.713: %DMI-5-CONFIG_I: R0/0: nesd: Configured from NETCONF/RESTCONF by admin, transaction-id 2086
但是,输出并未解释默认路由未安装到路由表的原因。
如果检查了下一跳可达性,您可以看到下一跳不可达:
Router#ping 192.168.10.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.10, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
ARP解析也不起作用:
Router#sh arp 192.168.10.10
Protocol Address Age (min) Hardware Addr Type Interface
Internet 192.168.10.10 0 Incomplete ARPA
因此,得出的结论是默认网关不可达。
此外,在某些情况下,可以注意到接口上没有输入数据包,这可能是问题的额外证据:
GigabitEthernet0/0/1 is up, line protocol is up
Hardware is BUILT-IN-2T+6X1GE, address is a8b4.5639.4e84 (bia a8b4.5639.4e84)
Internet address is 192.168.10.254/24
MTU 1500 bytes, BW 100000 Kbit/sec, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive not supported
Full Duplex, 100Mbps, link type is auto, media type is T
output flow-control is on, input flow-control is on
ARP type: ARPA, ARP Timeout 04:00:00
Last input never, output 00:00:07, output hang never
Last clearing of "show interface" counters never
Input queue: 0/375/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
0 packets input, 0 bytes, 0 no buffer
Received 0 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 watchdog, 0 multicast, 0 pause input
解决方案
Cisco IOS-XE SDWAN软件使用在Viptela vEdge路由器上实现的相同功能,称为跟踪默认网关
此功能类似于Cisco IOS上用于配置可靠静态路由备份的ip sla和对象跟踪功能。
默认情况下,此功能已启用,在相应的show sdwan running-config系统输出中无法看到该功能:
Router#show sdwan running-config system | i track-default-gateway
Router#
有关此功能的详细信息,请访问:https://sdwan-docs.cisco.com/Product_Documentation/Command_Reference/Configuration_Commands/track-default-gateway
启用网关跟踪后,软件每10秒向静态路由的下一跳发送一次ARP消息。如果软件收到ARP响应,它会将静态路由放入本地路由表中。在丢失10个连续的ARP响应后,该静态路由将从路由表中删除。软件继续定期发送ARP消息,一旦再次收到ARP响应,静态路由就会添加回路由表。