Decouple NAT from Devices #838

Closed
opened 2025-12-29 16:26:14 +01:00 by adam · 4 comments
Owner

Originally created by @ktims on GitHub (Apr 6, 2017).

Issue type: Feature request

NAT implementation in NetBox is coupled to the Device model for some reason, at least in the UI. I don't quite understand this, as this can be implied from where the 'inside' IP is assigned (if it is assigned), and NAT is not 'device dependent' in that the 'device' could be something completely out of the scope of the NetBox deployment on a separate network (across a VPN, say). I would like to be able to 1:1 NAT in NetBox without having to model the VMs and servers that those inside IPs are bound to (as this is out of scope for my deployment of NetBox - it is a different business division using VM-specific tools).

Originally created by @ktims on GitHub (Apr 6, 2017). ### Issue type: Feature request NAT implementation in NetBox is coupled to the Device model for some reason, at least in the UI. I don't quite understand this, as this can be implied from where the 'inside' IP is assigned (if it is assigned), and NAT is not 'device dependent' in that the 'device' could be something completely out of the scope of the NetBox deployment on a separate network (across a VPN, say). I would like to be able to 1:1 NAT in NetBox without having to model the VMs and servers that those inside IPs are bound to (as this is out of scope for my deployment of NetBox - it is a different business division using VM-specific tools).
adam closed this issue 2025-12-29 16:26:14 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 6, 2017):

NAT isn't coupled to the device model at all. There's a nat_inside field on the IPAddress model which points to itself. This can be populated separately from any interface assignment.

To assign one IP as a NAT for another, simply edit the outside IP and enter it in the "NAT IP (Inside)" dialog. Note that you need to enter the full IP for it to appear in the search listing.

@jeremystretch commented on GitHub (Apr 6, 2017): NAT isn't coupled to the device model at all. There's a `nat_inside` field on the IPAddress model which points to itself. This can be populated separately from any interface assignment. To assign one IP as a NAT for another, simply edit the outside IP and enter it in the "NAT IP (Inside)" dialog. Note that you need to enter the full IP for it to appear in the search listing.
Author
Owner

@ktims commented on GitHub (Apr 6, 2017):

Ah, it's just weird UI. I wasn't expecting to have to wait for the dropdown and then click on it when it matched what was in the search box (thought this was browser autocomplete, not the application). This search business seems a bit clumsy when 99% of the time I'm just going to want to enter the exact IP, but my bad, apologies.

Thanks.

@ktims commented on GitHub (Apr 6, 2017): Ah, it's just weird UI. I wasn't expecting to have to wait for the dropdown and then *click* on it when it matched what was in the search box (thought this was browser autocomplete, not the application). This search business seems a bit clumsy when 99% of the time I'm just going to want to enter the exact IP, but my bad, apologies. Thanks.
Author
Owner

@morten-starvik commented on GitHub (Dec 19, 2017):

I am not sure if I understand the NAT UI...
I want to enter a NAT address by IP. I enter the IP-address (which I know is registered in Netbox) in the search field (with or without mask), but how do I make the form actually search? Pressing enter just updates the address and closes the form, and Tab does nothing...no choices comes up in the "IP address" pull-down box. What am I doing wrong?

@morten-starvik commented on GitHub (Dec 19, 2017): I am not sure if I understand the NAT UI... I want to enter a NAT address by IP. I enter the IP-address (which I know is registered in Netbox) in the search field (with or without mask), but how do I make the form actually search? Pressing enter just updates the address and closes the form, and Tab does nothing...no choices comes up in the "IP address" pull-down box. What am I doing wrong?
Author
Owner

@CDawson1 commented on GitHub (Apr 16, 2018):

To bump this a bit, the interface is a little wonky.

In my case, I'm looking to have the primary IP be our public addresses. However, it seems that in order to display that correctly, I need to assign the private IP to a virtual interface, and the NAT inside is the public. The issue there is the display loses the device information, so I have the the following displayed...
nat1

If I do it the other way, I lose the ability to see the NAT associated with the IP in question...

nat2

@jeremystretch Your suggestion means that we lose the association to a device where the NAT occurs. Perhaps that works in some scenarios, eg DR where you move those kinds of things, but in many cases, that's not the case.

We also end up with a recursive entry...the private points to the public, and vice versa. I'm not interested in populating the private IPs as those are not ours to manage per se for this particular deployment. We simply want to populate the field manually without the need to have a proper entry.

@CDawson1 commented on GitHub (Apr 16, 2018): To bump this a bit, the interface is a little wonky. In my case, I'm looking to have the primary IP be our public addresses. However, it seems that in order to display that correctly, I need to assign the private IP to a virtual interface, and the NAT inside is the public. The issue there is the display loses the device information, so I have the the following displayed... ![nat1](https://user-images.githubusercontent.com/32870121/38805351-6b6d1416-416d-11e8-83c5-8685e4b5650b.png) If I do it the other way, I lose the ability to see the NAT associated with the IP in question... ![nat2](https://user-images.githubusercontent.com/32870121/38805453-bfc2847e-416d-11e8-8a91-e72ace8dabe9.png) @jeremystretch Your suggestion means that we lose the association to a device where the NAT occurs. Perhaps that works in some scenarios, eg DR where you move those kinds of things, but in many cases, that's not the case. We also end up with a recursive entry...the private points to the public, and vice versa. I'm not interested in populating the private IPs as those are not ours to manage per se for this particular deployment. We simply want to populate the field manually without the need to have a proper entry.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#838