TTR Networks

OSPF cheat sheet

OSPF commands for FRR (vtysh) and VyOS, from the OSPF Fundamentals and OSPF on VyOS lessons, where each was run in a lab with its output shown. VyOS runs FRR underneath, so the show output looks the same on both.

Show commands

TaskCommand (FRR and VyOS)
Neighbours and their stateshow ip ospf neighbor
One interface: area, network type, cost, timersshow ip ospf interface eth1
The link-state databaseshow ip ospf database
One router's LSAshow ip ospf database router 10.255.0.3
Routes OSPF computedshow ip ospf route
What's installed for a prefixshow ip route 198.51.100.24
OSPFv3 (IPv6) neighboursshow ipv6 ospfv3 neighbor
OSPFv3 database / routesshow ipv6 ospfv3 database / show ipv6 route ospfv3

In show ip ospf route, N is intra-area, N IA inter-area (from a Type 3 summary) and N E1/N E2 external. E2, the default, keeps the external metric fixed; E1 adds the internal cost to the ASBR.

Configuration

TaskVyOSFRR
Router IDset protocols ospf parameters router-id 10.255.0.1router ospf → ospf router-id 10.255.0.1
Interface into area 0set protocols ospf interface eth0 area 0interface eth0 → ip ospf area 0
Point-to-point link (no DR election)set protocols ospf interface eth0 network point-to-pointip ospf network point-to-point
Advertise but don't send hellosset protocols ospf interface lo passiveip ospf passive
Change a link's costset protocols ospf interface eth0 cost 100ip ospf cost 100
OSPFv3 on an interfaceset protocols ospfv3 interface eth0 area 0interface eth0 → ipv6 ospf6 area 0
Summarise an area at the ABR—area 1 range 10.4.0.0/16
Stub area—area 1 stub

Cost only applies outwards. Raising the cost on one router's interface changes that router's path, not the return path, so a one-sided change makes traffic asymmetric. Change both ends to move both directions.

Troubleshooting

SymptomUsual causeCheck
No neighbour at allInterface not in OSPF or passive, different areas, network types or hello/dead timers (10/40 s by default), OSPF (IP protocol 89) dropped by a firewallshow ip ospf interface, the input firewall
Stuck in ExStart / ExchangeMTU mismatch between the two endsInterface MTUs on both sides
Adjacency won't form after a changeDuplicate router IDshow ip ospf on both routers
Route missingWrong area, a filter or summary at the ABR, or a passive interface not in OSPFshow ip ospf database, show ip ospf route
Unexpected pathCosts: OSPF picks the lowest total, per directionshow ip ospf interface (cost), show ip route on each end