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
| Task | Command (FRR and VyOS) |
|---|---|
| Neighbours and their state | show ip ospf neighbor |
| One interface: area, network type, cost, timers | show ip ospf interface eth1 |
| The link-state database | show ip ospf database |
| One router's LSA | show ip ospf database router 10.255.0.3 |
| Routes OSPF computed | show ip ospf route |
| What's installed for a prefix | show ip route 198.51.100.24 |
| OSPFv3 (IPv6) neighbours | show ipv6 ospfv3 neighbor |
| OSPFv3 database / routes | show 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
| Task | VyOS | FRR |
|---|---|---|
| Router ID | set protocols ospf parameters router-id 10.255.0.1 | router ospf → ospf router-id 10.255.0.1 |
| Interface into area 0 | set protocols ospf interface eth0 area 0 | interface eth0 → ip ospf area 0 |
| Point-to-point link (no DR election) | set protocols ospf interface eth0 network point-to-point | ip ospf network point-to-point |
| Advertise but don't send hellos | set protocols ospf interface lo passive | ip ospf passive |
| Change a link's cost | set protocols ospf interface eth0 cost 100 | ip ospf cost 100 |
| OSPFv3 on an interface | set protocols ospfv3 interface eth0 area 0 | interface 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
| Symptom | Usual cause | Check |
|---|---|---|
| No neighbour at all | Interface 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 firewall | show ip ospf interface, the input firewall |
| Stuck in ExStart / Exchange | MTU mismatch between the two ends | Interface MTUs on both sides |
| Adjacency won't form after a change | Duplicate router ID | show ip ospf on both routers |
| Route missing | Wrong area, a filter or summary at the ABR, or a passive interface not in OSPF | show ip ospf database, show ip ospf route |
| Unexpected path | Costs: OSPF picks the lowest total, per direction | show ip ospf interface (cost), show ip route on each end |