Examples for IP Address Management (IPAM) operations.
Get-NBIPAMAddressGet-NBIPAMAddress -Address '10.0.0.1'Get-NBIPAMAddress -Parent '10.0.0.0/24'Get-NBIPAMAddress -Status 'active'New-NBIPAMAddress -Address '10.0.0.1/24' -Description 'Web Server' -Status 'active'New-NBIPAMAddress -Address '10.0.0.2/24' -Tenant 1 -Description 'Database Server'Set-NBIPAMAddress -Id 1 -Description 'Updated description' -Status 'reserved'Set-NBIPAMAddress -Id 1 `
-Assigned_Object_Type 'dcim.interface' `
-Assigned_Object_Id 5Remove-NBIPAMAddress -Id 1 -ConfirmGet-NBIPAMPrefixGet-NBIPAMPrefix -Prefix '10.0.0.0/24'Get-NBIPAMPrefix -Vrf 1New-NBIPAMPrefix -Prefix '192.168.1.0/24' -Site 1 -Status 'active' -Description 'Office LAN'# First get the prefix
$prefix = Get-NBIPAMPrefix -Prefix '10.0.0.0/24'
# Then query available IPs (via raw API)
$uri = "$($prefix.url)available-ips/"
# Note: Use Netbox UI or API directly for this operationGet-NBIPAMVlanGet-NBIPAMVlan -Vid 100Get-NBIPAMVlan -Site 1New-NBIPAMVlan -Vid 100 -Name 'Management' -Site 1 -Status 'active'Set-NBIPAMVlan -Id 1 -Description 'Management VLAN'Get-NBIPAMVrfNew-NBIPAMVrf -Name 'Customer-A' -Rd '65000:100' -Description 'Customer A routing domain'$vrf = Get-NBIPAMVrf -Name 'Customer-A'
Get-NBIPAMPrefix -Vrf $vrf.idGet-NBIPAMRIRNew-NBIPAMAggregate -Prefix '10.0.0.0/8' -Rir 1 -Description 'Private range'Get-NBIPAMRangeNew-NBIPAMRange -Start_Address '10.0.0.100' -End_Address '10.0.0.200' -Description 'DHCP Pool'Get-NBIPAMRoleNew-NBIPAMRole -Name 'Production' -Slug 'production'Get-NBIPAMServiceNew-NBIPAMService -Name 'HTTP' -Device 1 -Ports @(80, 443) -Protocol 'tcp'Get-NBIPAMAddress |
Select-Object address, status, description, @{N='tenant';E={$_.tenant.name}} |
Export-Csv -Path 'ip-addresses.csv' -NoTypeInformation# ips.csv: Address,Description,Status
Import-Csv ips.csv | ForEach-Object {
New-NBIPAMAddress -Address $_.Address -Description $_.Description -Status $_.Status
}Get-NBIPAMAddress |
Group-Object address |
Where-Object { $_.Count -gt 1 } |
Select-Object Name, CountGet-NBIPAMAddress | Where-Object { -not $_.assigned_object }Get-NBIPAMAddress |
Group-Object status |
Select-Object @{N='Status';E={$_.Name}}, Count |
Sort-Object Count -DescendingGet-NBIPAMVlan |
Select-Object vid, name, @{N='site';E={$_.site.name}}, status |
Sort-Object vid |
Format-Table -AutoSize