Lab: multi-area OSPF in FRR
Four FRR routers: R1, R2 and R3 form a triangle in area 0, and R3 is the ABR to R4 in stub area 1. Every link costs 10.
Notice the modern FRR style: OSPF is enabled per interface with ip ospf area, rather than with network statements under router ospf. What you see on the interface is what OSPF does on it. (network 10.0.0.0/8 area 0 still works and you will meet it on older configs and Cisco IOS.)
All four configs are below. The verification output was captured from these exact files running on FRR 10.2.1.
To build it yourself: four FRR containers (or a containerlab topology), ospfd=yes in /etc/frr/daemons, then these configs.
frr version 10.2
frr defaults traditional
hostname R1
!
interface lo
ip address 10.255.0.1/32
ip ospf area 0
!
interface eth1
description to R2
ip address 10.0.12.0/31
ip ospf area 0
ip ospf network point-to-point
ip ospf cost 10
!
interface eth2
description to R3
ip address 10.0.13.0/31
ip ospf area 0
ip ospf network point-to-point
ip ospf cost 10
!
interface eth3
description Users LAN
ip address 10.1.1.1/24
ip ospf area 0
ip ospf passive
ip ospf cost 10
!
router ospf
ospf router-id 10.255.0.1
auto-cost reference-bandwidth 100000
log-adjacency-changes detail
!- Lines 5–7: The loopback is advertised as a /32 host route. It's the stable address that iBGP sessions and management will use.
- Lines 11–12:
ip ospf area 0enables OSPF on this interface: it sends Hellos here and advertises the subnet. - Line 13: Point-to-point: no DR election, faster adjacency, no Type 2 LSA. Both ends must match.
- Line 14: Explicit cost, so the design is visible in the config instead of derived from bandwidth.
- Lines 23–28: The user LAN is advertised into OSPF, but
passivemeans no Hellos are sent here: no neighbours are expected, and a rogue device can't form an adjacency. - Lines 30–31: Pin the router ID to the loopback address. If you change it later, the OSPF process must be restarted.
- Line 32: Reference bandwidth of 100 Gbps (in Mbps). Set the same value on every router.
- Line 33: Log every neighbour state change. Essential when troubleshooting flaps.
frr version 10.2
frr defaults traditional
hostname R3
!
interface lo
ip address 10.255.0.3/32
ip ospf area 0
!
interface eth1
description to R1
ip address 10.0.13.1/31
ip ospf area 0
ip ospf network point-to-point
ip ospf cost 10
!
interface eth2
description to R2
ip address 10.0.23.1/31
ip ospf area 0
ip ospf network point-to-point
ip ospf cost 10
!
interface eth3
description to R4 (area 1)
ip address 10.0.34.0/31
ip ospf area 1
ip ospf network point-to-point
ip ospf cost 10
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 CHANGE-ME
!
router ospf
ospf router-id 10.255.0.3
auto-cost reference-bandwidth 100000
area 1 stub
area 1 range 10.4.0.0/16
!- Lines 9–21: Area 0 links, same pattern as R1.
- Lines 23–26: One interface in area 1 is all it takes to make R3 an ABR.
- Lines 29–30: MD5 authentication on the area 1 link. R4 needs the same key ID and key.
CHANGE-MEis a placeholder. - Line 35: Area 1 is a stub. R4 must also say
area 1 stub, because the stub flag is carried in Hellos. - Line 36: Advertise one Type 3 summary for area 1's 10.4.0.0/16 space instead of every subnet. Area 1 instability no longer ripples into area 0.
frr version 10.2
frr defaults traditional
hostname R2
!
interface lo
ip address 10.255.0.2/32
ip ospf area 0
!
interface eth1
description to R1
ip address 10.0.12.1/31
ip ospf area 0
ip ospf network point-to-point
ip ospf cost 10
!
interface eth2
description to R3
ip address 10.0.23.0/31
ip ospf area 0
ip ospf network point-to-point
ip ospf cost 10
!
router ospf
ospf router-id 10.255.0.2
auto-cost reference-bandwidth 100000
!- Lines 9–21: The same pattern as R1: two point-to-point links in area 0, each with an explicit cost. R2 has no user LAN.
frr version 10.2
frr defaults traditional
hostname R4
!
interface lo
ip address 10.255.0.4/32
ip ospf area 1
!
interface eth1
description to R3 (ABR)
ip address 10.0.34.1/31
ip ospf area 1
ip ospf network point-to-point
ip ospf cost 10
ip ospf authentication message-digest
ip ospf message-digest-key 1 md5 CHANGE-ME
!
interface eth2
description R4 LAN
ip address 10.4.4.1/24
ip ospf area 1
ip ospf passive
ip ospf cost 10
!
router ospf
ospf router-id 10.255.0.4
auto-cost reference-bandwidth 100000
area 1 stub
!- Lines 5–7: R4 is entirely in area 1, loopback included, so it's an internal router of the stub area.
- Lines 15–16: Must match R3's key ID and key exactly, or the Hellos are discarded and the neighbour never appears.
- Lines 18–23: The LAN that R3's
area 1 range 10.4.0.0/16summarises into area 0. - Line 28: Both ends must agree the area is a stub; the flag is carried in every Hello.
R1# show ip ospf neighbor
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.255.0.2 1 Full/- 41.555s 33.574s 10.0.12.1 eth1:10.0.12.0 0 0 0
10.255.0.3 1 Full/- 46.558s 33.448s 10.0.13.1 eth2:10.0.13.0 0 0 0
R1# show ip ospf route
============ OSPF network routing table ============
N 10.0.12.0/31 [10] area: 0.0.0.0
directly attached to eth1
N 10.0.13.0/31 [10] area: 0.0.0.0
directly attached to eth2
N 10.0.23.0/31 [20] area: 0.0.0.0
via 10.0.12.1, eth1
via 10.0.13.1, eth2
N IA 10.0.34.0/31 [20] area: 0.0.0.0
via 10.0.13.1, eth2
N 10.1.1.0/24 [10] area: 0.0.0.0
directly attached to eth3
N IA 10.4.0.0/16 [30] area: 0.0.0.0
via 10.0.13.1, eth2
N 10.255.0.1/32 [0] area: 0.0.0.0
directly attached to lo
N 10.255.0.2/32 [10] area: 0.0.0.0
via 10.0.12.1, eth1
N 10.255.0.3/32 [10] area: 0.0.0.0
via 10.0.13.1, eth2
N IA 10.255.0.4/32 [20] area: 0.0.0.0
via 10.0.13.1, eth2
============ OSPF router routing table =============
R 10.255.0.3 [10] area: 0.0.0.0, ABR
via 10.0.13.1, eth2
============ OSPF external routing table ===========- Lines 3–5:
Full/-: fully adjacent, and-means no DR/BDR role because the links are point-to-point. Dead Time counts down from 40s and resets on each Hello. - Lines 13–15: ECMP: the R2–R3 link costs 20 via R2 and 20 via R3, so both next hops are installed.
- Lines 16–17:
N IA: an inter-area route, learnt from R3's Type 3 summary. - Lines 20–21: The
area 1 rangesummary. Cost 30 = 10 to reach R3 + 20 (R3's cost to the most distant component). - Lines 22–23: R1's own loopback, at cost 0.
- Lines 32–33: The router routing table lists ABRs and ASBRs. R3 is flagged as ABR.
- Line 35: No externals: there's no ASBR in this lab yet.