Add nat_inside and nat_outside to brief fields in IPAddress Serializer #146

Closed
opened 2026-04-05 16:22:15 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @robduffy2010 on 3/16/2026

NetBox version

v4.5.4

Feature type

Change to existing functionality

Proposed functionality

When fetching devices from the API, in many cases, it can be important to get the devices NAT IP in the same query. For example, when using Netbox with Oxidized. Of course, each device could have their outside NAT IP set as the primary IP, but this could break functionality with other systems which require the device's real IP. Many systems use Netbox's API URL as an inventory source and do not have logic to perform multiple lookups.

In order to cator for using Netbox with different systems, which require either the real IP or NAT IP of a device, I propose updating the IPAddress Serializer brief fields to include the inside_nat and outside_nat fields.

https://github.com/netbox-community/netbox/blob/main/netbox/ipam/api/serializers_/ip.py#L212

If accepted, I can submit a PR for this feature.

Use case

When using Netbox with Oxidized. Of course, each device could have their outside NAT IP set as the primary IP, but this could break functionality with other systems which require the device's real IP. Many systems use Netbox's API URL as an inventory source and do not have logic to perform multiple lookups.

Database changes

NA

External dependencies

NA

*Originally created by @robduffy2010 on 3/16/2026* ### NetBox version v4.5.4 ### Feature type Change to existing functionality ### Proposed functionality When fetching devices from the API, in many cases, it can be important to get the devices NAT IP in the same query. For example, when using Netbox with Oxidized. Of course, each device could have their outside NAT IP set as the primary IP, but this could break functionality with other systems which require the device's real IP. Many systems use Netbox's API URL as an inventory source and do not have logic to perform multiple lookups. In order to cator for using Netbox with different systems, which require either the real IP or NAT IP of a device, I propose updating the IPAddress Serializer brief fields to include the inside_nat and outside_nat fields. https://github.com/netbox-community/netbox/blob/main/netbox/ipam/api/serializers_/ip.py#L212 If accepted, I can submit a PR for this feature. ### Use case When using Netbox with Oxidized. Of course, each device could have their outside NAT IP set as the primary IP, but this could break functionality with other systems which require the device's real IP. Many systems use Netbox's API URL as an inventory source and do not have logic to perform multiple lookups. ### Database changes NA ### External dependencies NA
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#146