Day 10: FRR, vtysh, and OSPF in the First Area
Goal: Three routers built from namespaces, each with its own FRR instance. They learn each other’s networks via OSPF, without a single static route. You read adjacencies, routes, and the link-state database, steer the path with costs, and find an adjacency that never finishes · Duration: approx. 90 min · Prerequisite: Day 0 (FRR installed) and Day 4
Briefing
- On Day 4 you set every route by hand. With three routers that still works, with thirty it does not, and when a link fails, someone has to change the routes in the middle of the night. A routing protocol takes over: the routers tell each other which networks they have and compute the paths themselves.
- OSPF (Open Shortest Path First) is the standard protocol inside a company or data center. Every router knows the whole map (the link-state database, LSDB) and uses Dijkstra to compute the shortest path to every destination. An area is part of the map; today there is only area 0, the backbone.
- FRR is the routing software. Each router runs a set
of daemons (
zebrafor the kernel routes,ospfdfor OSPF,mgmtdandstaticd), and everything is operated throughvtysh, a command line in the style of Cisco IOS.
10.255.0.2 (lo)
┌────┐
10.0.12.0 │ r2 │ 10.0.23.0
┌───────┤ ├───────┐
│ eth21└────┘eth23 │
eth12│ │eth32
h1 ──── ┌──┴─┐ 10.0.13.0 ┌──┴─┐ ──── h3
.10 eth0│ r1 ├──────────────┤ r3 │eth0 .10
10.1.1.0 └────┘eth13 eth31└────┘ 10.3.3.0
10.255.0.1 (lo) 10.255.0.3 (lo)
| Term | Meaning |
|---|---|
| Router ID | Name of the router in OSPF, an IPv4 address, here the loopback address |
| Neighbor | a router on the same network that speaks OSPF. The goal is the state
Full |
| LSA | Link State Advertisement: one entry of the map, “I am r3, I have these connections” |
| Cost | Length of a connection, the smaller sum wins |
| DR/BDR | Designated Router: spokesperson of a shared network, so not everyone has to exchange with everyone |
| passive | The network is advertised, but no neighbors are searched for there |
Drill 1: Three Routers, Two LANs, No Routes
Every link gets a descriptive name: eth12 in
r1 leads to r2, where the other end is called
eth21.
# on netz
sudo ip netns add r1
sudo ip netns add r2
sudo ip netns add r3
sudo ip netns add h1
sudo ip netns add h3
for n in r1 r2 r3 h1 h3; do sudo ip -n $n link set lo up; done
sudo ip -n r1 link add eth12 type veth peer name eth21 netns r2
sudo ip -n r1 link add eth13 type veth peer name eth31 netns r3
sudo ip -n r2 link add eth23 type veth peer name eth32 netns r3
sudo ip -n r1 link add eth0 type veth peer name eth0 netns h1
sudo ip -n r3 link add eth0 type veth peer name eth0 netns h3
sudo ip -n r1 addr add 10.0.12.1/24 dev eth12
sudo ip -n r2 addr add 10.0.12.2/24 dev eth21
sudo ip -n r1 addr add 10.0.13.1/24 dev eth13
sudo ip -n r3 addr add 10.0.13.3/24 dev eth31
sudo ip -n r2 addr add 10.0.23.2/24 dev eth23
sudo ip -n r3 addr add 10.0.23.3/24 dev eth32
sudo ip -n r1 addr add 10.1.1.1/24 dev eth0
sudo ip -n h1 addr add 10.1.1.10/24 dev eth0
sudo ip -n r3 addr add 10.3.3.1/24 dev eth0
sudo ip -n h3 addr add 10.3.3.10/24 dev eth0
sudo ip -n r1 addr add 10.255.0.1/32 dev lo
sudo ip -n r2 addr add 10.255.0.2/32 dev lo
sudo ip -n r3 addr add 10.255.0.3/32 dev lo
sudo ip -n r1 link set eth12 up
sudo ip -n r1 link set eth13 up
sudo ip -n r1 link set eth0 up
sudo ip -n r2 link set eth21 up
sudo ip -n r2 link set eth23 up
sudo ip -n r3 link set eth31 up
sudo ip -n r3 link set eth32 up
sudo ip -n r3 link set eth0 up
sudo ip -n h1 link set eth0 up
sudo ip -n h3 link set eth0 up
sudo ip -n h1 route add default via 10.1.1.1
sudo ip -n h3 route add default via 10.3.3.1
for r in r1 r2 r3; do sudo ip netns exec $r sysctl -qw net.ipv4.ip_forward=1; done
sudo ip netns exec r1 ping -c1 -W1 10.0.12.2 | grep -o '1 received'
sudo ip netns exec h1 ping -c1 -W1 10.3.3.10 | grep FromExpected:
1 received
From 10.1.1.1 icmp_seq=1 Destination Net Unreachable
Neighbors reach each other, but r1 does not know the way
to 10.3.3.0/24 and says so:
Destination Net Unreachable comes from r1
itself.
Save your progress? Sign up for free
Drill 2: One FRR Instance per Router
The package ships a systemd template [email protected]:
frr@r1 reads its configuration from
/etc/frr/r1/ instead of /etc/frr/. But the
template does not know which network namespace the daemons run in.
Without help, zebra of r1 would see the VM’s
interfaces. A small drop-in sends each instance into the namespace of
the same name:
# on netz
sudo mkdir -p /etc/systemd/system/[email protected]
printf '[Service]\nNetworkNamespacePath=/run/netns/%%i\n' | sudo tee /etc/systemd/system/[email protected]/netns.conf
sudo systemctl daemon-reloadExpected:
[Service]
NetworkNamespacePath=/run/netns/%i
systemd replaces %i with the name after the
@; the doubled %% is only needed for
printf. Now, per router, a configuration folder with
ospfd enabled, an empty configuration, and the start:
# on netz
sudo mkdir -p /etc/frr/r1
sudo sed 's/^ospfd=no/ospfd=yes/' /etc/frr/daemons | sudo tee /etc/frr/r1/daemons >/dev/null
sudo touch /etc/frr/r1/frr.conf /etc/frr/r1/vtysh.conf
sudo chown -R frr:frr /etc/frr/r1
sudo systemctl start frr@r1The same for r2 and r3:
# on netz
for r in r2 r3; do
sudo mkdir -p /etc/frr/$r
sudo sed 's/^ospfd=no/ospfd=yes/' /etc/frr/daemons | sudo tee /etc/frr/$r/daemons >/dev/null
sudo touch /etc/frr/$r/frr.conf /etc/frr/$r/vtysh.conf
sudo chown -R frr:frr /etc/frr/$r
sudo systemctl start frr@$r
done
systemctl is-active frr@r1 frr@r2 frr@r3
for p in $(pgrep -x zebra); do echo "zebra $p in $(sudo ip netns identify $p)"; done
sudo vtysh -N r1 -c 'show interface brief'Expected:
active
active
active
zebra 17489 in r1
zebra 17557 in r2
zebra 17625 in r3
Interface Status VRF Addresses
--------- ------ --- ---------
eth0 up default 10.1.1.1/24
fe80::9063:76ff:fe91:7dcb/64
eth12 up default 10.0.12.1/24
fe80::543b:fbff:fe5e:adc/64
eth13 up default 10.0.13.1/24
fe80::bcf2:cdff:fea3:bd2b/64
lo up default 10.255.0.1/32
Three zebras, each in its own namespace.
vtysh -N r1 talks to the instance r1. Without
-N you end up at the VM’s (disabled) instance.
Tried it: All three instances call themselves
hostname netzin their configuration, even if you enterhostname r1: FRR takes the system’s hostname, and a network namespace does not have one of its own. Tell the routers apart by-Nand by the router ID.
Save your progress? Sign up for free
Drill 3: Turning On OSPF
In FRR you enable OSPF per interface: ip ospf area 0
means “this network belongs to area 0, look for neighbors here and
advertise it.” Interactively that would be
sudo vtysh -N r1, then configure terminal and
line by line. With -c you can pass the lines one after
another, exactly as you would type them:
# on netz
sudo vtysh -N r1 -c 'configure terminal' -c 'router ospf' -c 'ospf router-id 10.255.0.1' -c 'exit' -c 'interface lo' -c 'ip ospf area 0' -c 'exit' -c 'interface eth12' -c 'ip ospf area 0' -c 'exit' -c 'interface eth13' -c 'ip ospf area 0' -c 'exit' -c 'interface eth0' -c 'ip ospf area 0' -c 'ip ospf passive' -c 'end' -c 'write memory'Expected:
Note: this version of vtysh never writes vtysh.conf
Building Configuration...
Integrated configuration saved to /etc/frr/r1/frr.conf
[OK]
eth0 leads to h1; there is no router there.
ip ospf passive advertises the network
10.1.1.0/24 but sends no OSPF packets into it. That saves
nothing in performance, but it prevents a host on the LAN from posing as
a router. write memory writes the running configuration to
/etc/frr/r1/frr.conf; without it, a restart loses it. The
same for r2 (without a LAN) and r3:
# on netz
sudo vtysh -N r2 -c 'configure terminal' -c 'router ospf' -c 'ospf router-id 10.255.0.2' -c 'exit' -c 'interface lo' -c 'ip ospf area 0' -c 'exit' -c 'interface eth21' -c 'ip ospf area 0' -c 'exit' -c 'interface eth23' -c 'ip ospf area 0' -c 'end' -c 'write memory' >/dev/null
sudo vtysh -N r3 -c 'configure terminal' -c 'router ospf' -c 'ospf router-id 10.255.0.3' -c 'exit' -c 'interface lo' -c 'ip ospf area 0' -c 'exit' -c 'interface eth31' -c 'ip ospf area 0' -c 'exit' -c 'interface eth32' -c 'ip ospf area 0' -c 'exit' -c 'interface eth0' -c 'ip ospf area 0' -c 'ip ospf passive' -c 'end' -c 'write memory' >/dev/null
sudo vtysh -N r1 -c 'show ip ospf neighbor'Expected:
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.255.0.2 1 Init/DROther 0.319s 39.680s 10.0.12.2 eth12:10.0.12.1 0 0 0
10.255.0.3 1 Init/DROther 0.154s 39.844s 10.0.13.3 eth13:10.0.13.1 0 0 0
The neighbors have been found, but are only in the Init
state: r1 has heard their hello packets, but they have not
heard its yet. On an Ethernet network, OSPF also waits 40 seconds before
electing a DR. So wait:
# on netz
sleep 45
sudo vtysh -N r1 -c 'show ip ospf neighbor'Expected:
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.255.0.2 1 Full/DR 5.489s 34.510s 10.0.12.2 eth12:10.0.12.1 1 0 0
10.255.0.3 1 Full/DR 5.325s 34.674s 10.0.13.3 eth13:10.0.13.1 3 0 0
Full is the goal: both sides have synchronized their
databases. /DR means the neighbor is the designated router
on this network. Dead Time counts down from 40 seconds and
jumps back with every hello (every 10 seconds). If it reaches 0, the
neighbor is considered dead (Day 11).
| State | Meaning |
|---|---|
Down, Init |
Hello heard, but not yet in both directions |
2-Way |
Both hear each other. Between two non-DRs on an Ethernet it stays this way, which is normal |
ExStart, Exchange |
Databases are compared: who starts, who has what |
Loading |
missing entries are requested |
Full |
done, the maps are identical |
Save your progress? Sign up for free
Drill 4: The Learned Routes
# on netz
sudo vtysh -N r1 -c 'show ip route ospf' | sed -n '/IPv4 unicast/,$p'
sudo ip -n r1 route show proto ospfExpected:
IPv4 unicast VRF default:
O>* 10.0.23.0/24 [110/20] via 10.0.12.2, eth12, weight 1, 00:00:01
* via 10.0.13.3, eth13, weight 1, 00:00:01
O>* 10.3.3.0/24 [110/20] via 10.0.13.3, eth13, weight 1, 00:00:01
O>* 10.255.0.2/32 [110/10] via 10.0.12.2, eth12, weight 1, 00:00:01
O>* 10.255.0.3/32 [110/10] via 10.0.13.3, eth13, weight 1, 00:00:01
10.0.23.0/24 nhid 22 metric 20
nexthop via 10.0.13.3 dev eth13 weight 1
nexthop via 10.0.12.2 dev eth12 weight 1
10.3.3.0/24 nhid 17 via 10.0.13.3 dev eth13 metric 20
10.255.0.2 nhid 18 via 10.0.12.2 dev eth12 metric 20
10.255.0.3 nhid 17 via 10.0.13.3 dev eth13 metric 20
How to read the FRR line
O>* 10.3.3.0/24 [110/20] via 10.0.13.3:
| Part | Meaning |
|---|---|
O |
learned via OSPF |
> |
best route to this destination |
* |
installed in the kernel |
[110/20] |
administrative distance 110 (OSPF) and cost 20 |
via 10.0.13.3, eth13 |
next router and interface |
Cost 20 is two links of 10 each. To the network between
r2 and r3 there are two equally expensive
paths, via r2 and via r3. FRR installs both,
and the kernel distributes the traffic (ECMP, more on Day 13). In the
kernel the routes carry proto ospf; zebra put
them there. The proof:
# on netz
sudo ip netns exec h1 ping -c2 -q 10.3.3.10 | grep received
sudo ip netns exec h1 mtr -n -r -c 3 10.3.3.10Expected:
2 packets transmitted, 2 received, 0% packet loss, time 1014ms
Start: 2026-11-24T00:40:12+0000
HOST: netz Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.1.1.1 0.0% 3 0.1 0.2 0.1 0.3 0.1
2.|-- 10.0.13.3 0.0% 3 0.2 0.2 0.2 0.2 0.0
3.|-- 10.3.3.10 0.0% 3 0.2 0.2 0.1 0.3 0.1
h1 reaches h3 on the direct path via
r3. Not a single static route except the default gateways
of the two hosts.
Save your progress? Sign up for free
Drill 5: The Map
First the view of one interface, then the whole database:
# on netz
sudo vtysh -N r1 -c 'show ip ospf interface eth12' | grep -E 'Network Type|State|Hello 10s|Neighbor Count|Designated Router \(ID\)|Backup Designated'
sudo vtysh -N r1 -c 'show ip ospf database'Expected:
Router ID 10.255.0.1, Network Type BROADCAST, Cost: 10
Transmit Delay is 1 sec, State Backup, Priority 1
Designated Router (ID) 10.255.0.2 Interface Address 10.0.12.2/24
Backup Designated Router (ID) 10.255.0.1, Interface Address 10.0.12.1
Timer intervals configured, Hello 10s, Dead 40s, Wait 40s, Retransmit 5
Neighbor Count is 1, Adjacent neighbor count is 1
OSPF Router with ID (10.255.0.1)
Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum Link count
10.255.0.1 10.255.0.1 21 0x8000000b 0x5717 4
10.255.0.2 10.255.0.2 17 0x80000008 0x7707 3
10.255.0.3 10.255.0.3 16 0x80000009 0x85c5 4
Net Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum
10.0.12.2 10.255.0.2 22 0x80000001 0xda44
10.0.13.3 10.255.0.3 22 0x80000001 0xcd4d
10.0.23.3 10.255.0.3 17 0x80000001 0x69a6
Every router writes a router LSA about itself, every
DR a net LSA about its network. All three routers have
the same database; that is the point of Full. A look inside
the router LSA of r3:
# on netz
sudo vtysh -N r1 -c 'show ip ospf database router 10.255.0.3' | grep -E 'Number of Links|Link connected|Link ID|Link Data|TOS 0 Metric'Expected:
Number of Links: 4
Link connected to: Stub Network
(Link ID) Net: 10.255.0.3
(Link Data) Network Mask: 255.255.255.255
TOS 0 Metric: 0
Link connected to: a Transit Network
(Link ID) Designated Router address: 10.0.13.3
(Link Data) Router Interface address: 10.0.13.3
TOS 0 Metric: 10
Link connected to: a Transit Network
(Link ID) Designated Router address: 10.0.23.3
(Link Data) Router Interface address: 10.0.23.3
TOS 0 Metric: 10
Link connected to: Stub Network
(Link ID) Net: 10.3.3.0
(Link Data) Network Mask: 255.255.255.0
TOS 0 Metric: 10
Exactly the connections from the sketch: the loopback address (cost
0), two transit networks to the other routers, and the LAN
10.3.3.0/24 as a stub (a network without further routers).
Every router computes its routes from these entries.
The cost of 10 per link is the same here for all veth interfaces,
which is enough for the lab. In real networks OSPF derives the cost from
the bandwidth: a reference of 100 Mbit/s divided by the speed, at least
1. Then 1, 10, and 100 Gbit/s all cost 1, and OSPF cannot tell them
apart. That is why you set the reference to 100 Gbit/s with
auto-cost reference-bandwidth 100000, the same on all
routers.
Save your progress? Sign up for free
Drill 6: Point-to-Point
Between two routers there is nothing to elect: a DR on a link with exactly two participants costs 40 seconds of waiting and an extra net LSA. As a point-to-point link, both go away:
# on netz
sudo vtysh -N r1 -c 'configure terminal' -c 'interface eth12' -c 'ip ospf network point-to-point' -c 'exit' -c 'interface eth13' -c 'ip ospf network point-to-point' -c 'end' -c 'write memory' >/dev/null
sudo vtysh -N r2 -c 'configure terminal' -c 'interface eth21' -c 'ip ospf network point-to-point' -c 'exit' -c 'interface eth23' -c 'ip ospf network point-to-point' -c 'end' -c 'write memory' >/dev/null
sudo vtysh -N r3 -c 'configure terminal' -c 'interface eth31' -c 'ip ospf network point-to-point' -c 'exit' -c 'interface eth32' -c 'ip ospf network point-to-point' -c 'end' -c 'write memory' >/dev/null
sleep 25
sudo vtysh -N r1 -c 'show ip ospf neighbor'
sudo vtysh -N r1 -c 'show ip ospf database'Expected:
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.255.0.2 1 Full/- 21.911s 38.247s 10.0.12.2 eth12:10.0.12.1 0 0 0
10.255.0.3 1 Full/- 16.910s 38.421s 10.0.13.3 eth13:10.0.13.1 0 0 0
OSPF Router with ID (10.255.0.1)
Router Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum Link count
10.255.0.1 10.255.0.1 16 0x80000015 0x72ab 6
10.255.0.2 10.255.0.2 16 0x80000011 0x9996 5
10.255.0.3 10.255.0.3 17 0x80000011 0x38c7 6
Net Link States (Area 0.0.0.0)
Link ID ADV Router Age Seq# CkSum
10.0.12.1 10.255.0.1 3600 0x80000001 0x58d8
10.0.12.2 10.255.0.2 3600 0x80000001 0xda44
10.0.13.1 10.255.0.1 3600 0x80000001 0x4de2
10.0.13.3 10.255.0.3 3600 0x80000001 0xcd4d
10.0.23.2 10.255.0.2 3600 0x80000001 0xd84a
10.0.23.3 10.255.0.3 3600 0x80000001 0x69a6
Full/-: no more DR. The net LSAs have an age of 3600,
which is MaxAge: OSPF deletes an entry by flooding it
once more with the maximum age so that everyone discards it. Half a
minute later they are gone. The router LSAs now have more links: per
point-to-point link they contain one entry for the neighbor and one for
the network. During the change, the adjacencies briefly fall back to
Init and rebuild. In production you plan this like a short
maintenance window.
Save your progress? Sign up for free
Drill 7: Steering the Path with Costs
The direct link r1–r3 should only be a
backup from now on, for example because it is billed expensively. Cost
100 on both ends:
# on netz
sudo vtysh -N r1 -c 'configure terminal' -c 'interface eth13' -c 'ip ospf cost 100' -c 'end' -c 'write memory' >/dev/null
sudo vtysh -N r3 -c 'configure terminal' -c 'interface eth31' -c 'ip ospf cost 100' -c 'end' -c 'write memory' >/dev/null
sleep 3
sudo vtysh -N r1 -c 'show ip route 10.3.3.0/24'
sudo ip netns exec h1 mtr -n -r -c 3 10.3.3.10
sudo ip netns exec h3 mtr -n -r -c 3 10.1.1.10Expected:
Routing entry for 10.3.3.0/24
Known via "ospf", distance 110, metric 30, best
Last update 00:00:04 ago
Flags: Selected
Status: Installed
* 10.0.12.2, via eth12, weight 1
Start: 2026-11-24T00:41:18+0000
HOST: netz Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.1.1.1 0.0% 3 0.2 0.2 0.1 0.3 0.1
2.|-- 10.0.12.2 0.0% 3 0.2 0.2 0.1 0.2 0.0
3.|-- 10.0.23.3 0.0% 3 0.2 0.3 0.2 0.3 0.0
4.|-- 10.3.3.10 0.0% 3 0.2 0.2 0.1 0.3 0.1
Start: 2026-11-24T00:41:26+0000
HOST: netz Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.3.3.1 0.0% 3 0.2 0.2 0.1 0.3 0.1
2.|-- 10.0.23.2 0.0% 3 0.2 0.2 0.2 0.2 0.0
3.|-- 10.0.12.1 0.0% 3 0.3 0.2 0.2 0.3 0.1
4.|-- 10.1.1.10 0.0% 3 0.2 0.2 0.2 0.3 0.0
Via r2 it costs 10 + 10 + 10 = 30, directly it is now
100 + 10 = 110. Both directions go via r2 because the cost
was changed on both ends. OSPF costs apply per
direction: had you set them only in r1, the outbound path
would go via r2 and the reply directly, an asymmetric path
that confuses any troubleshooting with captures and, with
rp_filter (Day 4), even costs packets.
Save your progress? Sign up for free
Exercise: Speed drills
- How many neighbors does
r2have in theFullstate? Just the number. Target time: 20 s - Via which next router does
r3reach the network10.1.1.0/24? Target time: 20 s - How many links does
r2report in its router LSA? Ask the database ofr1. Target time: 30 s
Solution
# on netz
sudo vtysh -N r2 -c 'show ip ospf neighbor' | grep -c Full
sudo vtysh -N r3 -c 'show ip route 10.1.1.0/24' | grep '\*'
sudo vtysh -N r1 -c 'show ip ospf database router 10.255.0.2' | grep -E 'Advertising Router|Number of Links'Expected:
2
* 10.0.23.2, via eth32, weight 1
Advertising Router: 10.255.0.2
Number of Links: 5
Save your progress? Sign up for free
Challenge
The examiner changes something on r3
and restarts the link to r2:
# on netz
sudo ip -n r3 link set eth32 mtu 1400
sudo ip -n r3 link set eth32 down; sleep 1; sudo ip -n r3 link set eth32 up
clearA minute later, the adjacency between r2 and
r3 is still not complete. Find out which state it is stuck
in and why, and fix it.
Hint: Day 8. During the database comparison, OSPF also exchanges a number that belongs to the interface.
Solution
# on netz
sudo vtysh -N r2 -c 'show ip ospf neighbor'
sudo vtysh -N r3 -c 'show ip ospf neighbor'Expected:
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.255.0.1 1 Full/- 2m25s 34.160s 10.0.12.1 eth21:10.0.12.2 0 0 0
10.255.0.3 1 Exchange/- 40.123s 39.878s 10.0.23.3 eth23:10.0.23.2 0 0 0
Neighbor ID Pri State Up Time Dead Time Address Interface RXmtL RqstL DBsmL
10.255.0.1 1 Full/- 2m25s 34.069s 10.0.13.1 eth31:10.0.13.3 0 0 0
10.255.0.2 1 ExStart/- 40.214s 39.787s 10.0.23.2 eth32:10.0.23.3 0 0 0
ExStart on one side, Exchange on the other,
and it stays that way. Hellos get through (otherwise it would say
Init or nothing at all), the database comparison does not.
The classic sign of mismatched MTU:
# on netz
sudo vtysh -N r3 -c 'show ip ospf interface eth32' | grep -iE 'mtu'
sudo vtysh -N r2 -c 'show ip ospf interface eth23' | grep -iE 'mtu'Expected:
ifindex 3, MTU 1400 bytes, BW 10000 Mbit <UP,LOWER_UP,BROADCAST,RUNNING,MULTICAST>
MTU mismatch detection: enabled
ifindex 3, MTU 1500 bytes, BW 10000 Mbit <UP,LOWER_UP,BROADCAST,RUNNING,MULTICAST>
MTU mismatch detection: enabled
Every Database Description packet carries the MTU of the sending
interface. r3 sees “1500” from r2, more than
its own 1400, and discards the packet: there could later be database
updates that do not fit through its interface. The fix is a matching MTU
on both ends:
# on netz
sudo ip -n r3 link set eth32 mtu 1500
sleep 15
sudo vtysh -N r2 -c 'show ip ospf neighbor' | grep 10.255.0.3Expected:
10.255.0.3 1 Full/- 5.346s 34.925s 10.0.23.3 eth23:10.0.23.2 0 0 0
There is also ip ospf mtu-ignore, which disables the
check. That is a band-aid: the adjacency comes up, but large updates get
lost later, and the fault shows up in a place where nobody thinks of the
MTU anymore.
Save your progress? Sign up for free
Checkpoint
# on netz
for r in r1 r2 r3; do echo "$r $(sudo vtysh -N $r -c 'show ip ospf neighbor' | grep -c Full)"; doneExpected:
r1 2
r2 2
r3 2
# on netz
sudo grep -c 'ip ospf network point-to-point' /etc/frr/r1/frr.conf
sudo ip netns exec h1 ping -c1 -W1 10.3.3.10 | grep -o '1 received'Expected:
2
1 received
Clean-up
The lab stays up for Day 11. Only the costs from Drill 7 go back to the default so that traffic takes the direct path again:
# on netz
sudo vtysh -N r1 -c 'configure terminal' -c 'interface eth13' -c 'no ip ospf cost' -c 'end' -c 'write memory' >/dev/null
sudo vtysh -N r3 -c 'configure terminal' -c 'interface eth31' -c 'no ip ospf cost' -c 'end' -c 'write memory' >/dev/null
sleep 2
sudo vtysh -N r1 -c 'show ip route 10.3.3.0/24' | grep -E 'metric|\*'Expected:
Known via "ospf", distance 110, metric 20, best
* 10.0.13.3, via eth13, weight 1
The FRR configurations live in /etc/frr/r1/ through
/etc/frr/r3/ and survive a VM restart; the namespaces do
not. After a restart, run Drill 1 again and start
sudo systemctl restart frr@r1 frr@r2 frr@r3.
Practice note
show ip ospf neighborfirst. If an adjacency is stuck inInit, hellos only arrive in one direction (firewall, wrong network). If it is stuck inExStart/Exchange, it is almost always the MTU. If none forms at all, area, netmask, hello/dead time, or authentication do not match.- Set the router ID explicitly. Without
ospf router-id, FRR takes the highest address, and a new loopback address changes the router’s name in the whole map after the next restart. - LANs passive, point-to-point between routers. Saves 40 seconds on every setup and one LSA per link, and prevents adjacencies with devices that have no business there.
- Always change costs on both ends and adjust the reference bandwidth to modern speeds. Asymmetric paths are legal, but expensive when troubleshooting.