Add Secondary IP To Device #4171

Closed
opened 2025-12-29 18:33:37 +01:00 by adam · 7 comments
Owner

Originally created by @DCAuto on GitHub (Oct 8, 2020).

Environment

  • Python version: Python 3.6.8
  • NetBox version: 2.9.4

Proposed Functionality

Allow Secondary IP Address association for Devices.

Use Case

We are using Netbox as an inventory source for Ansible. Some of our network gear are using two separate management cards. These are configured with two separate IP Addresses. In the event of a port failure, we would need to connect to the secondary port. My request is that an association is created with another IP as a "Secondary" address.

Database Changes

Unsure. I believe this would just be a new Device Field with a similar setup as the Primary Address.

External Dependencies

Unsure.

Originally created by @DCAuto on GitHub (Oct 8, 2020). <!-- NOTE: IF YOUR ISSUE DOES NOT FOLLOW THIS TEMPLATE, IT WILL BE CLOSED. This form is only for proposing specific new features or enhancements. If you have a general idea or question, please post to our mailing list instead of opening an issue: https://groups.google.com/g/netbox-discuss NOTE: Due to an excessive backlog of feature requests, we are not currently accepting any proposals which significantly extend NetBox's feature scope. Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: Python 3.6.8 * NetBox version: 2.9.4 <!-- Describe in detail the new functionality you are proposing. Include any specific changes to work flows, data models, or the user interface. --> ### Proposed Functionality Allow Secondary IP Address association for Devices. <!-- Convey an example use case for your proposed feature. Write from the perspective of a NetBox user who would benefit from the proposed functionality and describe how. ---> ### Use Case We are using Netbox as an inventory source for Ansible. Some of our network gear are using two separate management cards. These are configured with two separate IP Addresses. In the event of a port failure, we would need to connect to the secondary port. My request is that an association is created with another IP as a "Secondary" address. <!-- Note any changes to the database schema necessary to support the new feature. For example, does the proposal require adding a new model or field? (Not all new features require database changes.) ---> ### Database Changes Unsure. I believe this would just be a new Device Field with a similar setup as the Primary Address. <!-- List any new dependencies on external libraries or services that this new feature would introduce. For example, does the proposal require the installation of a new Python package? (Not all new features introduce new dependencies.) --> ### External Dependencies Unsure.
adam closed this issue 2025-12-29 18:33:37 +01:00
Author
Owner

@olant commented on GitHub (Oct 8, 2020):

You can add several interfaces to your device and assign separate IP addresses to each of the interfaces. Is this what you are looking for? You can even assig role "secondary" to that IP address.

@olant commented on GitHub (Oct 8, 2020): You can add several interfaces to your device and assign separate IP addresses to each of the interfaces. Is this what you are looking for? You can even assig role "secondary" to that IP address.
Author
Owner

@DCAuto commented on GitHub (Oct 8, 2020):

The "primary_ip" field of the device is the one used connect to it. Having a second(ary) IP Address on the Interface doesn't allow for the secondary to become associated with device management in the event that it's unreachable.

I suppose that constantly monitoring the IP Connectivity and updating the device's primary IP in the event of failure would work too. The goal of the feature would be to have a preconfigured "backup" mgmt IP/Port included in the device fields to try if unsuccessful on the Primary.

@DCAuto commented on GitHub (Oct 8, 2020): The "primary_ip" field of the device is the one used connect to it. Having a second(ary) IP Address on the Interface doesn't allow for the secondary to become associated with device management in the event that it's unreachable. I suppose that constantly monitoring the IP Connectivity and updating the device's primary IP in the event of failure would work too. The goal of the feature would be to have a preconfigured "backup" mgmt IP/Port included in the device fields to try if unsuccessful on the Primary.
Author
Owner

@jeremystretch commented on GitHub (Oct 8, 2020):

NetBox allows for a primary IPv4 and primary IPv6 address to be assigned to each device and virtual machine. This allows a user to specify the IP by which a device or VM should be primarily accessed (assuming it is not reachable by name). Practically, speaking, it does not make sense to further identify successive IP addresses, because there are myriad failure conditions which may dictate reachability by one non-primary IP versus another. It would also duplicate a large amount of model and validation logic.

@jeremystretch commented on GitHub (Oct 8, 2020): NetBox allows for a primary IPv4 and primary IPv6 address to be assigned to each device and virtual machine. This allows a user to specify the IP by which a device or VM should be primarily accessed (assuming it is not reachable by name). Practically, speaking, it does not make sense to further identify successive IP addresses, because there are myriad failure conditions which may dictate reachability by one non-primary IP versus another. It would also duplicate a large amount of model and validation logic.
Author
Owner

@DCAuto commented on GitHub (Oct 8, 2020):

I wasn't suggesting that Netbox do the validation (although I suspect that I'm not fully utilizing this feature, and don't understand it). Only that a new field identifies a backup interface/ip

I will pursue the route of updating the Device IP when we detect a failure.

@DCAuto commented on GitHub (Oct 8, 2020): I wasn't suggesting that Netbox do the validation (although I suspect that I'm not fully utilizing this feature, and don't understand it). Only that a new field identifies a backup interface/ip I will pursue the route of updating the Device IP when we detect a failure.
Author
Owner

@jeremystretch commented on GitHub (Oct 8, 2020):

I wasn't suggesting that Netbox do the validation

By validation, I mean such tasks as ensuring that the assigned IP belongs to the device/VM, checking that the primary and secondary IPs are different, etc.

@jeremystretch commented on GitHub (Oct 8, 2020): > I wasn't suggesting that Netbox do the validation By validation, I mean such tasks as ensuring that the assigned IP belongs to the device/VM, checking that the primary and secondary IPs are different, etc.
Author
Owner

@DanSheps commented on GitHub (Oct 8, 2020):

You can filter device interfaces by "Is this a management interface". The flag is mgmt_only=true:

https://master.netbox.dev/dcim/interfaces/?mgmt_only=true

vs

https://master.netbox.dev/dcim/interfaces/

@DanSheps commented on GitHub (Oct 8, 2020): You can filter device interfaces by "Is this a management interface". The flag is `mgmt_only=true`: `https://master.netbox.dev/dcim/interfaces/?mgmt_only=true` vs `https://master.netbox.dev/dcim/interfaces/`
Author
Owner

@DCAuto commented on GitHub (Oct 8, 2020):

Thanks for the suggestion. I'll work on devising a way to utilize that.

This request can be closed.

@DCAuto commented on GitHub (Oct 8, 2020): Thanks for the suggestion. I'll work on devising a way to utilize that. This request can be closed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4171