Unable to Record SNAT Prefixes Against Destination IP Address #11471

Closed
opened 2025-12-29 21:45:41 +01:00 by adam · 2 comments
Owner

Originally created by @alasdairmuckart on GitHub (Aug 12, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.3.5

Python Version

3.10

Steps to Reproduce

  1. Create a pair of Prefixes
  2. Create an IP address in Prefix A
  3. Go to NAT IP (Inside)
  4. Only addresses are presented, not prefixes.

Expected Behavior

It should be possible to select a Prefix as the inside object that an IP Address is NAT'ing for, so prefix-based SNAT can be correctly represented.

Without this, a site that has multiple internal private prefixes that map to different external public IP addresse cannot be recorded correctly and subseqently config generation for the border device at the site is greatly complicated.

SNAT of a prefix to a single external IP address is a very common setup that NetBox should be able to record.

Observed Behavior

Only IP addresses are listed in the dropdown for NAT IP (Inside).

Originally created by @alasdairmuckart on GitHub (Aug 12, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.3.5 ### Python Version 3.10 ### Steps to Reproduce 1. Create a pair of Prefixes 2. Create an IP address in Prefix A 3. Go to **NAT IP (Inside)** 4. Only addresses are presented, not prefixes. ### Expected Behavior It should be possible to select a Prefix as the inside object that an IP Address is NAT'ing for, so prefix-based SNAT can be correctly represented. Without this, a site that has multiple internal private prefixes that map to different external public IP addresse cannot be recorded correctly and subseqently config generation for the border device at the site is greatly complicated. SNAT of a prefix to a single external IP address is a very common setup that NetBox should be able to record. ### Observed Behavior Only IP addresses are listed in the dropdown for **NAT IP (Inside)**.
adam added the netbox label 2025-12-29 21:45:41 +01:00
adam closed this issue 2025-12-29 21:45:41 +01:00
Author
Owner

@bctiemann commented on GitHub (Aug 15, 2025):

This would be a breaking change that would need to be a feature request, because IPAddress.nat_inside is a foreign key to IPAddress and would need to be changed to support both IPAddresses and Prefixes. In other words, it would need to become a GenericForeignKey or similar multiple relation, which is a fairly major database change.

Could you please rework this as a feature request? We'll review it accordingly.

@bctiemann commented on GitHub (Aug 15, 2025): This would be a breaking change that would need to be a feature request, because `IPAddress.nat_inside` is a foreign key to `IPAddress` and would need to be changed to support both IPAddresses and Prefixes. In other words, it would need to become a GenericForeignKey or similar multiple relation, which is a fairly major database change. Could you please rework this as a feature request? We'll review it accordingly.
Author
Owner

@alasdairmuckart commented on GitHub (Aug 15, 2025):

This would be a breaking change that would need to be a feature request, because IPAddress.nat_inside is a foreign key to IPAddress and would need to be changed to support both IPAddresses and Prefixes. In other words, it would need to become a GenericForeignKey or similar multiple relation, which is a fairly major database change.

This is really basic functionality for an IPAM. I'm surprised NetBox has gone this long without it already.

Could you please rework this as a feature request? We'll review it accordingly.

I can try, but I know nothing about NetBox's internals, so it'll take a while to put together.

@alasdairmuckart commented on GitHub (Aug 15, 2025): > This would be a breaking change that would need to be a feature request, because `IPAddress.nat_inside` is a foreign key to `IPAddress` and would need to be changed to support both IPAddresses and Prefixes. In other words, it would need to become a GenericForeignKey or similar multiple relation, which is a fairly major database change. This is really basic functionality for an IPAM. I'm surprised NetBox has gone this long without it already. > Could you please rework this as a feature request? We'll review it accordingly. I can try, but I know nothing about NetBox's internals, so it'll take a while to put together.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11471