Pages

8/9/10

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

     10.0.0.0/24 is subnetted, 1 subnets
D EX    10.0.0.0 [170/409600] via 192.168.2.1, 00:05:33, FastEthernet0/1
                 [170/409600] via 192.168.1.1, 00:05:33, FastEthernet0/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
C    192.168.2.0/24 is directly connected, FastEthernet0/1
S    172.16.0.0/12 [1/0] via 192.168.1.1


Router#show ip route | inc FastEthernet0/0
                 [170/409600] via 192.168.1.1, 00:11:28, FastEthernet0/0
C    192.168.1.0/24 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
10.0.0.0/24         192.168.2.1          FastEthernet0/1
                    192.168.1.1          FastEthernet0/0
172.16.0.0/12       192.168.1.1          FastEthernet0/0
192.168.1.0/24      attached             FastEthernet0/0
192.168.1.1/32      192.168.1.1          FastEthernet0/0

No comments:

Post a Comment