Network source of truth
Separate intent from observation
Network as code is a workflow in which structured intent, versioned changes and repeatable checks guide network configuration. A source of truth records the approved answer to a particular question, such as which team owns a subnet. It is not necessarily a single database for everything. For example, an IP address management system (IPAM) owns allocations, Git stores reviewed policy, and monitoring records observed link health. A switch reporting a different address does not automatically make that address approved. Record the owner, revision and observation time; resolve discrepancies before planning a change. All examples in this chapter are fictional and operate on local data only.
Build an address inventory with scope
An IPAM inventory should identify the routing domain, prefix, allocation role and owner. NetBox 4.4 is one example of a tool that models prefixes, addresses and VRFs, including overlapping spaces across distinct VRFs. In our classroom policy, allocated leaf subnets must not overlap inside the same VRF; a parent reservation may contain them. The global table is a distinct named scope. Use canonical CIDR, so 10.20.1.7/24 is not a valid network identifier in this toy inventory. Do not prohibit all parent-child relationships: hierarchy is useful for tracking available address space. The policy is an exercise, not a claim that NetBox enforces every rule automatically.
Reconcile a fictional inventory
In the example, Blue and Green each own 10.20.1.0/24 in separate routing domains. Blue also has a reservation for 10.20.0.0/16. An additional Blue allocation of 10.20.1.128/25 conflicts with its existing /24, but 10.20.2.0/24 is a non-overlapping candidate. The same /24 in Green is not a conflict under this address policy; separate routing tables do not guarantee security if route leaking or firewalls are misconfigured. A discovered interface on Blue using an address from 10.20.2.0/24 is an observation to investigate, not proof that the prefix has been allocated.
VRF | role | prefix | ownerBlue | reservation | 10.20.0.0/16 | team-blueBlue | leaf | 10.20.1.0/24 | team-blueGreen | leaf | 10.20.1.0/24 | team-greenBlue | proposed leaf | 10.20.1.128/25 | team-blueBlue | proposed leaf | 10.20.2.0/24 | team-blueMake topology and ownership explicit
A useful inventory also records stable device and interface IDs, site, role, link endpoints, administrative state, platform revision and change owner. A link record must point to two existing interfaces; a missing peer is incomplete evidence rather than a new connection. Keep secrets in a separately authorized secret store, not in Git or an IPAM export. Decide whether each field is mastered in IPAM, Git or another system. When two systems disagree, compare timestamps and revisions, investigate with the owner, and review any correction rather than overwriting either side automatically.
Practice before generating configuration
Classify the candidates in the example, then test a new Green 10.20.1.64/26 and Blue 10.20.3.0/24. The former overlaps an existing leaf in Green; the latter does not overlap a Blue leaf and fits the parent. Passing these checks is necessary but does not reserve the prefix: approval and an atomic allocation mechanism are still required to prevent concurrent assignment. Next, turn these rules into continuous integration checks.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Network source of truth Quiz
Reason about inventory authority, change verification and reliability gates.
What does a source of truth record?
Blue and Green have the same /24. Under the toy address policy?
Blue already owns 10.20.1.0/24. What about 10.20.1.128/25 as a separate leaf?
What about a parent reservation containing a leaf?
A device reports an unallocated address. What next?