Hardening is not a one-time “secure the router” checkbox. It is a repeatable set of gates you run after every design change. This chapter consolidates edge, control-plane, ACL, and ops hygiene into checklists you can attach to Containerlab labs (mid-2026 open stack: FRR, Linux, optional SR Linux notes).
Learning goals
By the end of this chapter you can:
Run role-based hardening checklists (edge, P, lab host)
Turn checklist items into automated verify-hard.sh probes
Balance security with operability (break-glass paths)
Record exceptions with expiry and owner
Apply the same gates to dual-home and fabric labs
How to use these lists
Pick the role of the device or lab.
Mark each item: Pass / Fail / N/A / Exception.
Failures become backlog; exceptions need owner + date.
#!/usr/bin/env bashset-euo pipefailLAB=${LAB:-clab-dualhome}fail(){echo"FAIL: $*">&2;exit 1;}pass(){echo"PASS: $*";}# 2.4 negative: hijack absent on pe1ifdocker exec ${LAB}-pe1 vtysh -c'show bgp ipv4 uni'2>/dev/null |grep-q'203.0.113.0';thenfail"hijack prefix present"elsepass"no hijack prefix"fi# 1.2 example: ssh port not open to all — soft check listening interfacesdocker exec ${LAB}-ce1 ss -lntp|grep-q ssh &&pass"sshd present"||pass"no sshd (ok if unused)"# 4.3 VIP answersdocker exec ${LAB}-h1 ping -c1-W1 192.168.50.254 >/dev/null &&pass"VIP"||fail"VIP"# 0.1 topology file existstest-f dualhome.clab.yml &&pass"topology file"||fail"missing topology"echo"HARDENING SMOKE OK"
Wire into Makefile:
smoke: ; ./verify.shhard: ; ./verify-hard.sh
Predict → observe → fix (meta-drill)
Break one control on purpose:
# remove FROM-CE filter on pe1 in lab
Predict | verify-hard.sh fails hijack test when you advertise junk |
Observe | script FAIL line |
Fix | restore route-map; re-run |
Never disable a gate silently—disable via exception register.
Mapping to prior chapters
Chapter theme
Checklist
ACL thinking
3.x
CoPP
2.7, 6.3
QoS
don’t police control into death; document classes
Dual-home edge
2.x + 4.x
Name/time/log
4.4–4.6, 0.5
Optional SR Linux
Export checklist to NOS-specific show commands in an appendix note. Same gates: peer authenticity, prefix limits, mgmt ACL, logging. Free community image is for dialect practice, not a second security model.