Pcornel
Networking · Routing

RIB / FIB / CEF

Cheat sheet · https://pcornel.dk/topic.php?topic=2601

Back to the Topic

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 cef and show adjacency answer different questions.

First checks

  • show ip route <prefix> — RIB best route
  • show ip cef <prefix> — FIB entry
  • show 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 route
show ip cef
show ip cef <dest> detail
show ip route <dest>
show ip cef <dest>
show ip cef inconsistency
show ip cef <next-hop>
show ip cef exact-route <src> <dst>
show adjacency <if> detail
show 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

Confirmation

Confirm action

Continue?