取消
显示结果 
搜索替代 
您的意思是: 
cancel
547
查看次数
1
有帮助
1
评论
hasun
Cisco Employee
Cisco Employee

前言

      本篇文章主要用于排查为何交换机没有配置静态路由,但是在show ip route中会发现未知的静态路由条目。  

 

故障描述

       目前未知的路由可能出现在全局路由表,以及管理VRF路由表中。

       未知路由出现在全局路由表

Show ip route
Extended Host Mode is enabled
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, m - OMP
n - NAT, Ni - NAT inside, No - NAT outside, Nd - NAT DIA
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
H - NHRP, G - NHRP registered, g - NHRP registration summary
o - ODR, P - periodic downloaded static route, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is aaa.bbb.ccc.ddd to network 0.0.0.0

S* 0.0.0.0/0 [0/0] via aaa.bbb.ccc.ddd
aaa.bbb.ccc.ddd/8 is variably subnetted, 3 subnets, 2 masks

      未知路由出现在VRF路由表

#sh ip route vrf management
Routing Table: management
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
a - application route
+ - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is aaa.bbb.ccc.ddd to network 0.0.0.0

S* 0.0.0.0/0 [254/0] via aaa.bbb.ccc.ddd
aaa.bbb.ccc.ddd/8 is variably subnetted, 3 subnets, 2 masks

 

故障排查方法

       在上述任意一种类型故障中都非常建议根据如下命令进行基本配置进行排查,从而验证该问题是否由于配置导致。

show running-config
show cdp neighbor
show ip cef
show ip route or show ip route vrf xxx

    

    在针对于全局路由表出现未知静态路由时,其中大概率造成的原因为收到了重定向流量从而导致了路由条目的更新,可以根据如下命令进行检查是否存在重定向流量,如果存在重定向流量,可以通过如下debug命令进行验证未知路由生成原因,参考输出如下。

#show ip redirects 
Default gateway is x.x.x.x

Host Gateway Last Use Total Uses Interface
x.x.x.x x.x.x.x 0:14 0 Vlan xxx

Try debug find more detail about route entry learn status

Debug ip routing
Debug ip icmp

example
Dec 7 16:40:32.093: ICMP: redirect rcvd from aaa.bbb.ccc.ddd-- for aaa.bbb.ccc.ddd use gw aaa.bbb.ccc.ddd <-- icmp redirect
Dec 7 16:40:32.093: RT: updating static aaa.bbb.ccc.ddd/32 (0x0) [local lbl/ctx:1048577/0x0] omp-tag:0 : via aaa.bbb.ccc.ddd Vl17 0 1048578 0x100001 <-- routing
Dec 7 16:40:32.094: RT: add aaa.bbb.ccc.ddd/32 via aaa.bbb.ccc.ddd, static metric [0/0] <--- static route

    
    针对于管理VRF出现未知路由,上述的基本信息检查依然适用,但是通常在重定向的命令并不会存在类似的输出,通过如下实验环境进行测试后如有下发现。

    C6807(management port)---C2960x(DHCP rely)---C9500(DHCP server)

    当Catalyst交换机管理口通过DHCP中继的方式获取DHCP地址时,设备会自动生成一条静态路由条目,其目的为了帮忙寻找DHCP server。

     该现象可以通过如下方式进行验证,具体案例如下。

Debug ip routing static detail 
Debug ip routing static event
Debug dhcp detail

example
*Aug 18 02:59:58.346: Adding route to DHCP server aaa.bbb.ccc.ddd via mgmt0 aaa.bbb.ccc.ddd
*Aug 18 12:02:58.687: IP-ST(management, unicast, aaa.bbb.ccc.ddd/32 [254], mgmt0 Path = 1, add succeed, active state

结论

      一般来说设备突然出现未知静态路由通常是由于配置,或者相关功能开启导致问题发生,可以通过以上方法进行排查。

评论
Yanli Sun
Community Manager
Community Manager

感谢专家分享

入门指南

使用上面的搜索栏输入关键字、短语或问题,搜索问题的答案。

我们希望您在这里的旅程尽可能顺利,因此这里有一些链接可以帮助您快速熟悉思科社区:









快捷链接