Routes Behind an Interface

I'm often looking for a way to see all of the routes beyond one particular interface.  Unfortunately, it's not as easy as something like this:  'show ip route | inc FastEthernet0/0' because FastEthernet0/0 may not be listed on the same line as the network, like this:

Router#sh ip route
Codes: 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

Gateway of last resort is not set is subnetted, 1 subnets
D EX [170/409600] via, 00:05:33, FastEthernet0/1
                 [170/409600] via, 00:05:33, FastEthernet0/0
C is directly connected, FastEthernet0/0
C is directly connected, FastEthernet0/1
S [1/0] via

Router#show ip route | inc FastEthernet0/0
                 [170/409600] via, 00:11:28, FastEthernet0/0
C is directly connected, FastEthernet0/0

Luckily, the information is usually present in other places, like the CEF table:

Router#sh ip cef FastEthernet0/0
Prefix              Next Hop             Interface          FastEthernet0/1
                    FastEthernet0/0          FastEthernet0/0      attached             FastEthernet0/0          FastEthernet0/0

No comments:

Post a Comment