Automation for IPv6 networks
Generate device configurations from an IPAM source of truth. Validate address plans and configurations automatically. Test changes in CI against the lab before deployment.
Take the quiz · pass mark 70% · 9 questions
Explanation
IPv6's huge, hierarchical address space is a gift to automation and a trap for manual work: 128-bit addresses are error-prone to type, and a good plan is deeply structured. Treat the address plan as data and generate everything from it. There is no single standard here — this is tooling practice — so follow current tool documentation and verify versions.
A source of truth (IPAM)
Keep the address plan in an IPAM / source of truth (for example NetBox): prefixes, sub-allocations, per-site and per-VLAN assignments, and device roles. The source of truth, not a spreadsheet or a router's running config, is authoritative. Everything downstream is generated from it, so the plan and the network cannot drift.
Generate configurations
Render device configs from the source of truth with templates (Jinja2) driven by Ansible or Python. Because the addresses come from structured data, the generator can enforce the hierarchy (nibble-aligned prefixes, consistent /64s, matching reverse DNS) and never fat-fingers an address. A change is made in the source of truth and re-rendered, not hand-edited on the box.
Validate automatically
Automation also checks: validate that the address plan is internally consistent (no overlaps, correct aggregation, documentation prefixes only in the lab), that generated configs match policy (ICMPv6 rules present, first-hop security on access ports, no ULA leaking to eBGP), and that reverse DNS matches forward. These are the same rules this course's own validators enforce on content — applied to network data.
Test in CI against the lab
The highest-value step: run changes through CI against a lab (containerlab) before touching production. A pipeline spins up the topology, applies the generated configs, and runs automated reachability and policy tests (ping/trace per family, service checks, security assertions). Only configs that pass merge and deploy. This turns "we think it works" into "the pipeline proved it."
ictNetworks scenario
ictNetworks keeps its plan in NetBox, renders FRR (and vendor) configs with Ansible/Jinja2, and runs every change through a CI pipeline that builds the containerlab reference topology, applies the configs, and asserts per-family reachability and the Level 5 security policy. A merge is blocked unless the lab run is green, and the IPAM is the single source of truth so the documentation prefixes and ASNs stay consistent across the whole estate.
Drawing diagram…
Worked examples
Example 1: Allocations the IPAM manages
From a single /32, an IPAM can manage 2^(48-32) = 65536 site /48 allocations as structured records — far too many to track by hand, which is the point of a source of truth.
Example 2: Reachability test matrix
A CI reachability test that checks every ordered pair among 5 routers runs 5 * 4 = 20 directed checks (each router to each other router), a small enough matrix to run on every change.
Example 3: Configs for a fabric
Generating configs for a 2-spine, 4-leaf fabric produces 2 + 4 = 6 device configurations from one source of truth, each rendered consistently from the shared plan.
Lab
Goal: Generate FRR configurations from NetBox and run automated reachability tests.
You need: NetBox (or another IPAM) as the source of truth, Ansible or Python with Jinja2 templates, a containerlab topology (FRR), and a test runner. (All of NetBox, Ansible and containerlab vary by version — check the docs.)
- Model the address plan and devices in NetBox (prefixes, /64s, roles) using documentation prefixes and ASNs.
- Render FRR configurations from NetBox with Jinja2 templates; confirm addresses and ASNs match the source of truth.
- Validate the plan automatically (no overlaps, nibble-aligned, no ULA to eBGP) and fail on a deliberately bad record.
- Spin up the containerlab topology, apply the generated configs, and run per-family reachability and a security assertion.
- Wire it into CI so a change in NetBox triggers render -> lab -> test, and a failing test blocks the merge.
What to submit: the NetBox data, the templates, the generated configs, the validation output (including the caught bad record), and the CI reachability/policy test results.
Summary
- Treat the IPv6 address plan as data in an IPAM source of truth; generate configs from it so plan and network never drift.
- Render with templates (Ansible/Jinja2) so addresses are structured and never hand-typed.
- Validate the plan and configs automatically (overlaps, aggregation, policy, reverse DNS).
- Test every change in CI against a containerlab before production; block merges that fail.
- Next lesson (L8.07): the capstone — design, build and defend an IPv6 network.
Quiz imported · 9 questions · pass mark 70%. Lab questions are not auto-marked.