Netbox 〡 Tutorials

NetBox IPAM Tutorial: Automate your IP Management

Milan Zapletal
February 3, 2026

Table Of Contents

Advanced NetBox IPAM Setup for Network Engineering Teams – 2026 Edition

In this NetBox IPAM tutorial, we cover how to turn NetBox into a reliable, automatically updated source of truth for IP address management — including prefixes, VRFs, interface assignments, and VLANs — without manual data entry.

We use Simple-Facts, an open-source discovery and sync tool, to automate the entire workflow from network scanning to NetBox population.

NetBox IP addresses list showing 82 active IPs assigned to various interfaces including Ethernet, VLAN, Loopback, and Port-Channel

Why Most NetBox IPAM Implementations Stay Outdated

The primary challenge with NetBox isn’t the software itself, but the human element required to maintain it. In many organizations, NetBox begins as a pristine database but quickly devolves into a read-only archive. Because network engineers are often stretched thin, the manual overhead of documenting every new prefix or VRF assignment becomes a secondary priority. When documentation relies on manual entry, a single week of rapid changes can lead to spreadsheet drift, where the reality of the wire no longer matches the records in the database.

This lack of real-time accuracy creates a dangerous ripple effect. Without a trustworthy source of truth, automated workflows become risky to execute, as they may be operating on stale data. Furthermore, incident response slows down significantly when engineers have to double-check IP-to-device mappings manually during a crisis. By identifying these friction points, it becomes clear that automation isn’t just a luxury; it is a necessity for maintaining NetBox as a living, reliable resource.

Even after deploying NetBox, teams struggle with:

  • Manual IP/prefix/VRF entry → weeks of work for mid-size networks
  • Spreadsheet drift within days
  • No visibility into overlapping IP spaces across VRFs
  • Slow incident response when you can’t trust IP-to-device mappings
  • Blocked automation (Ansible, Terraform, CI/CD) due to incomplete IPAM data

Result: NetBox becomes another stale database instead of the single source of truth.

Goal of This NetBox IPAM Tutorial

The primary aim of this guide is to demonstrate a streamlined, low-friction workflow using Simple-Facts to bridge the gap between your live network and your documentation. Rather than suggesting a complete organizational overhaul, this tutorial provides a practical proof-of-concept for automating the discovery of IPv4 addresses, prefixes, and VRF contexts. By highlighting how a single tool can parse device configurations and populate NetBox in minutes, we illustrate a clear, repeatable path to maintaining a “living” source of truth without the burden of manual data entry.

After following these steps, you will have:

  • All active IPv4 addresses discovered and assigned to interfaces
  • Prefixes automatically created and organized by site/VRF
  • VRF contexts correctly applied (critical for multi-tenant or segmented networks)
  • VLAN assignments synced from device configs
  • Daily automated sync keeping NetBox current

Time estimate: Initial setup + pilot = 1–2 days. Full population of 100–300 devices = under 15 minutes.

Prerequisites

  • Running NetBox instance (v3.7+ recommended) with API token (read/write)
  • Python 3.10+ environment
  • Network reachability to target devices (SSH/ Telnet)
  • Credentials for device access (preferably via jump host or credential vault)

Step 1: Install Simple-Facts

# Recommended: use uv for fast, isolated installs
uv venv
source .venv/bin/activate
uv pip install git+https://gitlab.com/netodata/simple-facts.git

# Alternative: classic pip
pip install git+https://gitlab.com/netodata/simple-facts.git

Verify:

sfacts --version

Step 2: Configure NetBox Connection

Create ~/.sfacts/config.yaml (or use environment variables):

netbox:
  url: https://netbox.yourcompany.com
  token: YOUR_NETBOX_API_TOKEN
  verify_ssl: true               # set false only for self-signed certs in lab

Test connection:

sfacts netbox test

Step 3: Discover Devices (Layer 2/3 Scan)

Start with a known subnet (management, server, loopback, etc.):

sfacts discover --subnet 10.10.10.0/24 --output discovery-mgmt.json
# or scan multiple subnets
sfacts discover --subnet 10.10.10.0/24 --subnet 172.16.0.0/16 --output discovery.json

This performs ARP + basic SNMP/SSH probes to find live devices.

Step 4: Collect Detailed Device Facts

sfacts facts --input discovery.json --output facts.json

This step connects via Netmiko (SSH) and parses output using TextFSM/ntc-templates.

Collected data includes:

  • Hostname, model, serial, OS version
  • All interfaces (physical + logical/SVI)
  • Operational status, speed, MTU, description
  • Primary/secondary MACs
  • IPv4/IPv6 addresses + prefix lengths
  • VLAN assignments (access/trunk)
  • VRF membership per interface

Step 5: Dry-Run Sync to NetBox IPAM

Before committing changes to your production database, the dry-run serves as a critical safety net for network state synchronization. This phase allows you to simulate the entire population process, generating a detailed preview of exactly how Simple-Facts intends to modify your NetBox records. It is the moment where you can catch potential logic errors, such as incorrect VRF mappings or misidentified device types, without the risk of corrupting your existing data or creating duplicate entries.

By carefully reviewing this output, you can verify that the tool is correctly interpreting your network’s hierarchy, from parent prefixes down to individual interface assignments. This “look before you leap” approach builds confidence in the automation, ensuring that when you finally execute the real sync, the resulting NetBox state is a precise, clean reflection of your actual infrastructure. It effectively transforms a high-risk data migration into a predictable, verifiable administrative task.

sfacts netbox sync \
  --input facts.json \
  --site-name "Production DC1" \
  --dry-run \
  --verbose

Review output:

  • Which devices will be created/updated
  • New prefixes and their VRF context
  • IP addresses and their interface assignments
  • Any mapping issues (missing device types, etc.)

Step 6: Perform the Real Sync

Once the dry-run confirms everything is in order, executing the real sync pushes the discovered data into NetBox, instantly transforming it from an empty shell into a populated source of truth. This step automatically creates and links devices, interfaces, IPs, and VRFs, effectively digitizing your network’s current state. Within minutes, your IPAM tables move from stale or nonexistent to a high-fidelity map of your infrastructure, ready to support audits and automation.

sfacts netbox sync \
  --input facts.json \
  --site-name "Production DC1" \
  --role router          # optional: set default role if not auto-detected

After sync:

  • Devices appear in DCIM → Devices
  • Interfaces populated with IPs, VLANs, descriptions
  • IPAM → IP Addresses shows all discovered IPs with parent prefix
  • IPAM → Prefixes lists auto-created aggregates and child prefixes
  • VRFs created and linked correctly (VRF → Prefix → IP → Interface)

Step 7: Automate Daily Sync (Production)

Create a simple cron job:

# /etc/cron.d/sfacts-daily
0 5 * * * root cd /opt/sfacts && \
  sfacts discover --subnet 10.0.0.0/8 --output /var/run/sfacts/discovery.json && \
  sfacts facts --input /var/run/sfacts/discovery.json --output /var/run/sfacts/facts.json && \
  sfacts netbox sync --input /var/run/sfacts/facts.json --site-name "Production" >> /var/log/sfacts.log 2>&1

Add error alerting (e.g., via healthchecks.io or simple email script).

Advanced NetBox IPAM Features Enabled by This Setup

By automating the data pipeline, you unlock NetBox’s most powerful capabilities that are often too complex to maintain manually. This setup natively supports VRF-aware overlapping IPs, allowing you to manage identical subnets across different customer or tenant contexts without database conflicts. Furthermore, it builds a dynamic prefix hierarchy, providing instant visibility into IP utilization and “free” space, which enables your team to use the NetBox API for self-service IP requests and safer, data-driven automation.

  • VRF-aware overlapping IPs — 10.0.0.0/8 used in multiple customer VRFs? No conflicts.
  • Prefix hierarchy — Automatic /16 → /24 → /32 breakdown
  • IP utilization reporting — NetBox built-in charts become accurate
  • API-driven self-service — Dev teams query free subnets via NetBox API
  • Ansible/Terraform safety — Dynamic inventory and state always current

Troubleshooting Tips

  • Device not discovered? → Check SNMP/SSH reachability, credential order
  • VRF not detected? → Ensure device sends VRF context in show run / show ip vrf
  • Duplicate IPs? → Usually real misconfiguration — Simple-Facts flags them
  • Slow sync? → Limit subnets or use --workers 10

Repository & Next Steps

Start small: pilot one subnet → measure time savings → scale. This NetBox IPAM tutorial workflow eliminates manual toil and makes NetBox the living source of truth your automation deserves.

NETWORK AUTOMATION INSIGHTS
Stay informed about the latest in network automation:
Technical deep dives - Implementation guides -
Industry best practices
Netodata official logo featuring a stylized green geometric icon and the brand name "NETODATA" in white and green typography on a transparent background.
From initial consulting to seamless implementation, we manage your network automation journey every step of the way. Our comprehensive suite of professional services caters to diverse enterprises, ranging from startups to established players.
Contact
1-234-1234
info@netodata.io
Address
Nové sady 988/2
602 00, Brno
Czech Republic
ICO: 23213035
GET IN TOUCH
Address
Netodata Labs, s.r.o. © 2026 All Rights Reserved
Nautobot icon

Nautobot

The central Source of Truth for network infrastructure data. Nautobot serves as:
Authoritative inventory database
IP address components tracking
Configuration template repository
Automation platform

Nornir

A Python automation framework specifically designed for network automation. Nornir provides:
High-performance concurrent task execution
Deep Python integration
Flexible inventory management
Fine-grained control over network operations
CI/CD

Orchestration & CD/CI

We integrate industry-standard orchestration tools to ensure reliable automation delivery:
Git-based version control
Automated pipelines
Controlled deployment workflows
Continuous integration practices

Ansible

An industry-standard automation platform that excels at network configuration management. We utilize Ansible for:
Network device configuration deployment
State validation and compliance checking
Integration with custom Python modules
Standardized workflow automation

Netbox

The central Source of Truth for network infrastructure data. NetBox serves as:
Authoritative inventory database
IP address components tracking
Configuration template repository
REST API provider for automation workflows

Python

The foundation of our automation framework, Python enables us to create modular, maintainable, and efficient network automation solutions. We leverage Python's extensive standard library and carefully selected packages to build:
Reusable automation components
Custom network management tools
API integrations
Data processing pipelines