05-26-2013 04:26 PM - edited 03-07-2019 01:34 PM
This is the output of "show ip route"
---sho 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 72.36.127.1 to network 0.0.0.0
68.0.0.0/23 is subnetted, 1 subnets
B 68.180.82.0 [20/0] via 192.17.10.65, 7w0d
85.0.0.0/32 is subnetted, 4 subnets
B 85.25.100.146 [20/0] via 192.0.2.1, 3d08h
B 85.14.138.66 [20/0] via 192.0.2.1, 3d08h
B 85.17.180.5 [20/0] via 192.0.2.1, 3d08h
B 85.25.86.198 [20/0] via 192.0.2.1, 05:25:22
In this case we see that for the entries learned from BGP the outgoing interface is not solved , is there any option which we can use with "show ip route" to Display the outgoing interface for the above mentioned entries.
I need to parse this output into a different representation so the last option is I need to solve them ?
meaning if we have a packet with destination "85.25.100.146 " then from routing table we see the next hop is 192.0.2.1 then I myself need to look how to reach "192.0.2.1" ? or some command can help me.
05-26-2013 07:06 PM
Hi Jiten,
This is normal for BGP, as the BGP nexy hop is not always directly resolvable to an interface. You can use "show ip cef" the get the information you want though.
r2#sh ip ro | incl 1.1.1.1
B 1.1.1.1 [20/0] via 192.168.12.1, 00:04:34
r2#sh ip cef | incl 1.1.1.1
1.1.1.1/32 192.168.12.1 Ethernet0/0
r2#
Regards
05-26-2013 07:24 PM
thanks for the explanation. So incase if I dont have access to the switch but I have the output for "Show ip route" then can I resolve the outgoing interface by resolving it recursively and looking for the longest prefix match ?
for e.g. in above case if I get a packet destined for 85.25.86.198 I will now look in the table for "192.0.2.1" and try to find a longes prefix match for it and find outgoing interface , if that is also not solved I use then look for the nexthop entry of "192.0.2.1" in the table until I finally find a outgoing interface.
05-26-2013 07:40 PM
Hi Jiten,
This should definitely work too. Of course looking at the CEF table is easier but I understand that you might have restrictions.
Regards
05-26-2013 08:18 PM
thanks for the confirmation . I think I can ask for "sh ip cef" output if it makes work easier. This table will have all the BGP entries resolved ?
I googled and found out that CEF is stored in h/w and so makes it quick to forward packets.
I have 2 questions:
1. Does it mean that "sh ip route" comes from the entires in routing table software and "sh ip cef" comes from entries in h/w.
2. Will CEF have all BGP entries resolved ?
05-26-2013 08:21 PM
Hi Jiten,
1- Yes the show ip route comes from the routing table software and cef from the hardware.
2- Will CEF have all BGP engries resolved:
Please find detailed explanation in the following link below:
http://blog.ioshints.info/2010/09/ribs-and-fibs.html
http://www.cisco.com/en/US/docs/ios/12_2/switch/configuration/guide/xcfcef.html
HTH
Regards
Inayath
05-26-2013 09:01 PM
thank you for sharing it. Clears all the questions.
So just to confirm for
2. Will CEF have all BGP engries resolved:
will only happen when the first packet for that destination has been process switched and cached in FIB right.
05-26-2013 09:08 PM
Yes you are understanding is right.
Forwarding Information Base (FIB) and Cisco Express Forwarding (CEF) switching were introduced to make layer-3 switching deterministic. When IP routes are copied from RIB to FIB, their next hops are resolved, outgoing interfaces are computed and multiple entries are created when the next-hop resolution results in multiple paths to the same destination.
regards
Inayath
05-27-2013 03:30 AM
Hi Jiten,
Unlike fast-switching, CEF will not wait after the first packet has been process switched to build its FIB. The FIB entry will be added as soon as the prefix has been learned via the routing protocol and added to the RIB. This entry will be kept as long as the prefix remains in the RIB, which also contrast with fast-switching, who used to time out entries in its cache after some time without seeing traffic for the particular prefix.
Regards
05-27-2013 09:42 AM
thanks Harold . Now I get the difference between process switching , fast switching and CEF.
05-29-2013 10:28 AM
Is there similar to CEF stuff available in Juniper Switches ?
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide