Networking · Routing
RIB / FIB / CEF
Cheat sheet · https://pcornel.dk/topic.php?topic=2601
Answer
RIB, FIB and CEF describe different stages between control-plane route selection and actual packet forwarding. The RIB selects routing intent; CEF derives forwarding state in the FIB and adjacency structures.
Remember
- Route selection and packet forwarding are separate evidence boundaries
- Destination lookup uses longest-prefix match; administrative distance is relevant between competing sources for the same prefix
- A protocol database can contain a candidate that never wins the RIB
- A RIB route can exist while recursive next-hop or adjacency resolution prevents usable forwarding
- CEF is the Cisco IOS / IOS XE forwarding architecture built around FIB and adjacency information
show ip route,show ip cefandshow adjacencyanswer different questions.
First checks
show ip route <prefix>— RIB best routeshow ip cef <prefix>— FIB entryshow adjacency detail— rewrite info
Commands
show ip route <prefix>- RIB
show ip cef <prefix> detail- FIB / CEF
show adjacency detail- Adjacency
show ip route <destination>- RIB
show ip cef <destination>- FIB / CEF
show adjacency- Adjacency
show ip routeshow ip cefshow ip cef <dest> detailshow ip route <dest>show ip cef <dest>show ip cef inconsistencyshow ip cef <next-hop>show ip cef exact-route <src> <dst>show adjacency <if> detailshow ip arp <next-hop>
Verify in this order
routing protocols → RIB → FIB → adjacency → forwarding
Where it usually breaks
underlay/interface reachability → protocol adjacency/session → received/originated state → policy → best path/RIB → FIB/adjacency → traffic path
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2601