TTR Networks

Intermediate · Edge and core: building out a VyOS network · section 3 of 10

OSPF for the infrastructure

✓ Lab-tested 17 October 2026 on VyOS 2026.10.16-0024-rolling, FRR 10.2.1

OSPF's only job here is to make every loopback reachable from every router. It runs on the three internal links and on each loopback, and nowhere else:

  • Not on external interfaces. edge1's transit link and edge2's IX port never run OSPF. You don't want to form an adjacency with a provider, and you don't want their links in your IGP.
  • Not on the LAN. core1's LAN is a customer prefix, so it goes into BGP (next section). Keeping the IGP small keeps it fast and stable, however many customers you add.
  • Loopbacks are passive. They're advertised, but OSPF never sends hellos on them.
  • Point-to-point links. Each link has exactly two routers on it, so network point-to-point skips the Designated Router (DR) election and brings adjacencies up faster. (See the OSPF lesson for what a DR does on a shared segment.)

Apply the same pattern on every router, changing only the router ID and the interface names. Use the loopback address as the router ID, so OSPF and BGP identify each router the same way.

core1: OSPF (the edges are the same, with their own router ID and links)
set protocols ospf parameters router-id '198.51.100.241'
set protocols ospf interface lo area '0'
set protocols ospf interface lo passive
set protocols ospf interface eth0 area '0'
set protocols ospf interface eth0 network 'point-to-point'
set protocols ospf interface eth1 area '0'
set protocols ospf interface eth1 network 'point-to-point'
  • Line 1: Router ID = loopback address.
  • Lines 2–3: Advertise the loopback, but never send hellos on it.
  • Lines 4–7: Both internal links in area 0, as point-to-point: no DR election.
Adjacencies and routes on core1 (real output)
vyos@core1:~$ show ip ospf neighbor

Neighbor ID     Pri State           Up Time         Dead Time Address         Interface                        RXmtL RqstL DBsmL
198.51.100.242    1 Full/-          24.403s           33.389s 198.51.100.224  eth0:198.51.100.225                  0     0     0
198.51.100.243    1 Full/-          24.401s           38.544s 198.51.100.226  eth1:198.51.100.227                  0     0     0

vyos@core1:~$ show ip route ospf
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

IPv4 unicast VRF default:
O>* 198.51.100.228/31 [110/2] via 198.51.100.224, eth0, weight 1, 00:00:25
  *                           via 198.51.100.226, eth1, weight 1, 00:00:25
O>* 198.51.100.242/32 [110/1] via 198.51.100.224, eth0, weight 1, 00:00:25
O>* 198.51.100.243/32 [110/1] via 198.51.100.226, eth1, weight 1, 00:00:25
  • Lines 4–5: Full with both edges. Full/- means no DR or BDR role, as expected on point-to-point links.
  • Lines 16–17: The edge1–edge2 link is two hops away by either path, so OSPF installs both (equal-cost multipath).
  • Lines 18–19: Each edge's loopback, one hop away. These are what iBGP will connect to.