Use this when using NetBox as the source of truth for network and data centre automation.
NetBox
NetBox is an open-source source of truth for networks and data centres, modelling sites, racks, devices, interfaces, cables, IP addresses, VLANs and circuits, with a REST and GraphQL API for automation.
1. NetBox: network source of truth (DCIM + IPAM + more).
2. REST/GraphQL APIs, webhooks, custom fields.
3. Drives inventory and config generation.
4. Data quality matters.
5. Back up PostgreSQL and media.
NetBox data → API/webhooks → automation
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as duplicate labels, stale inventory, conflicting authority, broad filters, race between read and write, orphaned relationships and automation acting on data not yet reconciled, choosing the cases most relevant to NetBox as a source-of-truth application with stable object IDs, API/schema/version awareness, change logging and downstream reconciliation.
Step 2 Example Narrow the fault
curl -H "Authorization: Token $NB_TOKEN" https://netbox.example.com/api/status/
Step 3 Common mistakes Narrow the fault
- Using NetBox as documentation only and never as automation input.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Subtopics
Go one level deeper into this subject.
NetBox fundamentals: it models what the network should look like — sites, racks, devices, cables, IPs, VLANs and circuits — as the source of truth for documentation and automation.
Subtopic SitesSites in NetBox are physical locations such as offices or data centres, grouped into regions and site groups, containing locations, racks and devices.
Subtopic DevicesDevices in NetBox represent physical or virtual network hardware with site, rack position, role, platform, device type and status, and are the anchor for interfaces and IP addresses.
Subtopic InterfacesInterfaces in NetBox are device ports with type, speed, mode (access or tagged), VLANs, cable connections and IP addresses, used to generate switch and router configurations.
Subtopic IPAMNetBox IPAM manages aggregates, prefixes, IP ranges, addresses, VLANs and VRFs, with utilization and next-available allocation through the API.
Subtopic PrefixesPrefixes in NetBox are subnets with VRF, site, VLAN, role and status, nested hierarchically, showing utilization and offering available child prefixes and IPs via the API.
Subtopic IP AddressesIP addresses in NetBox are individual addresses with mask, status, role, DNS name and assignment to an interface, which automation can allocate and use to build configs.
Subtopic VLANsVLANs in NetBox have VID, name, status and scope by site or VLAN group, and are assigned to interfaces and prefixes so switch configuration can be generated from them.
Subtopic VRFsVRFs in NetBox model separate routing tables with route distinguishers and route targets, allowing overlapping prefixes and IP addresses to be tracked correctly.
Subtopic CircuitsCircuits in NetBox model WAN and internet links from providers, with circuit ID, type, commit rate and terminations at sites or devices, useful for tracking carriers and contracts.
Subtopic VirtualizationNetBox virtualization models clusters, virtual machines and their interfaces and IP addresses, so VMs are documented alongside physical devices.
Subtopic Custom FieldsCustom fields add your own attributes to NetBox objects, such as a support contract or backup policy, which automation can read and write through the API.
Subtopic REST APIThe NetBox REST API at /api/ exposes every object for create, read, update and delete with token authentication, filtering and pagination; pynetbox wraps it for Python.
Subtopic WebhooksNetBox webhooks send an HTTP request when objects are created, updated or deleted, triggering automation such as pushing a config or updating DNS when data changes.
Subtopic NetBox AutomationNetBox automation reads intended network state from NetBox via pynetbox, the REST API or Ansible's netbox inventory plugin, and pushes changes back, keeping NetBox the source of truth.
- Model intent in NetBox before configuring devices.
- Use the API or pynetbox for automation.
- Webhooks can trigger automation on changes.
curl -s -H 'Authorization: Token <t>' https://<netbox>/api/status/— version and plugins- Data model coverage (sites, devices, IPAM, circuits) — usage
- Backups of NetBox DB and media — recovery
ReferenceWhy it matters1 section · depth on demand
What it is
NetBox is an open-source source of truth for DCIM and IPAM: sites, racks, devices, cables, prefixes, IPs, VLANs and VRFs, with a REST and GraphQL API.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
NetBox is the most widely used open-source source of truth for networks. It models the physical and logical infrastructure — sites, racks, devices, interfaces, cables, IP space, VLANs, VRFs, circuits — and provides REST and GraphQL APIs, webhooks, custom fields, config contexts and plugins.
How it fits into automation:
| Role | Example |
|---|---|
| Inventory | Ansible dynamic inventory from NetBox |
| Intent | Templates rendered from device/interface/VLAN data |
| Allocation | Next free IP/prefix via API |
| Trigger | Webhooks on changes start automation |
| Validation | Compare live state with NetBox |
Key tools: pynetbox (Python), netbox.netbox Ansible collection, Terraform provider, and plugins such as NetBox Branching for staged changes. Plan data ownership and quality processes before importing everything.
Mechanics
The linked authority for bounded mechanics is NetBox Documentation; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in NetBox. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://netbox.readthedocs.io/en/stable/ · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For NetBox as a source-of-truth application with stable object IDs, API/schema/version awareness, change logging and downstream reconciliation, prefer typed fields and stable IDs over human presentation text.