Use this when managing prefixes in IPAM.
Prefixes · IPAM Automation
Prefixes in IPAM are subnets such as 10.20.0.0/24, organized hierarchically with status, role, site and VLAN, from which automation allocates child prefixes and addresses.
1. Prefixes are subnets in IPAM.
2. Assign VRF, site, VLAN, role.
3. No unintended overlaps.
4. Parent/child structure.
5. Mark pools.
prefix → VRF/site/VLAN → IPs
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 prefix identity, VRF/tenant context, containment/overlap, status/role and allocation of child prefixes/addresses without authority conflicts.
Step 2 Common mistakes Narrow the fault
- Overlapping prefixes without VRFs.
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.
- Prefixes are organized hierarchically.
- Status and role describe use.
- Child prefixes and IPs are allocated from parents.
curl -s -H 'Authorization: Token <t>' https://<netbox>/api/ipam/prefixes/?site=<site> | jq '.results[].prefix'— list prefixes- Prefix roles/VRF assignment — context
- Overlaps allowed only in separate VRFs — uniqueness
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Prefix management in IPAM automation means allocating subnets from larger blocks according to a plan: a /16 per site, /24s per VLAN, /31s for point-to-point links. Automating it keeps address plans consistent and avoids overlaps.
site_block = nb.ipam.prefixes.get(prefix="10.20.0.0/16")
p2p_pool = nb.ipam.prefixes.get(prefix="10.255.10.0/24")
user_net = site_block.available_prefixes.create({"prefix_length": 24, "vlan": vlan.id})
link = p2p_pool.available_prefixes.create({"prefix_length": 31, "description": "core1-dist3"})
Encode the address plan in IPAM structure (container prefixes with roles) rather than in script logic, so the plan is visible to people and the same for every tool.
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 IPAM Automation > Prefixes. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://netbox.readthedocs.io/en/stable/models/ipam/ · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For prefix identity, VRF/tenant context, containment/overlap, status/role and allocation of child prefixes/addresses without authority conflicts, prefer typed fields and stable IDs over human presentation text.