Change 1:1 mapping of an IP address to a device to 1:n #5142

Closed
opened 2025-12-29 19:24:46 +01:00 by adam · 3 comments
Owner

Originally created by @c-po on GitHub (Aug 5, 2021).

NetBox version

v2.11.10

Feature type

Data model extension

Proposed functionality

As of now an IP address can be assigned to an interface of one specific device. In the case of EVPN anycast gateways or any other type of anycast service where the Anycast address is assigned to a loopback port of a device I can not "pin" one IP address to multiple devices.

image

Use case

  • Anycast DNS service wher multiple servers service the same IP address
  • EVPN/VXLAN fabrics with MLAG pairs where the VTEP loopback address is available on both MLAG units

Database changes

No response

External dependencies

No response

Originally created by @c-po on GitHub (Aug 5, 2021). ### NetBox version v2.11.10 ### Feature type Data model extension ### Proposed functionality As of now an IP address can be assigned to an interface of one specific device. In the case of EVPN anycast gateways or any other type of anycast service where the Anycast address is assigned to a loopback port of a device I can not "pin" one IP address to multiple devices. ![image](https://user-images.githubusercontent.com/25299219/128310094-9086486c-d0f2-4918-b15d-f648a3bd2a7c.png) ### Use case - Anycast DNS service wher multiple servers service the same IP address - EVPN/VXLAN fabrics with MLAG pairs where the VTEP loopback address is available on both MLAG units ### Database changes _No response_ ### External dependencies _No response_
adam added the type: feature label 2025-12-29 19:24:46 +01:00
adam closed this issue 2025-12-29 19:24:46 +01:00
Author
Owner

@sdktr commented on GitHub (Aug 5, 2021):

The Anycast role (as well as the FHRP roles) allows to create the same IP Address multiple times. So in the database there will be multiple IDs with the same IP.
Checkout this example on the demo instance (it will expire every day, so be quick)
image

These Roles allow duplicate assignments: ee8fd701ae/netbox/ipam/constants.py (L43)

Code involved for duplicate detection: ee8fd701ae/netbox/ipam/models/ip.py (L636)

@sdktr commented on GitHub (Aug 5, 2021): The Anycast role (as well as the FHRP roles) allows to create the same IP Address multiple times. So in the database there will be multiple IDs with the same IP. Checkout [this example](https://demo.netbox.dev/ipam/ip-addresses/?q=&parent=&family=&mask_length=&present_in_vrf_id=&role=anycast&assigned_to_interface=) on the demo instance (it will expire every day, so be quick) ![image](https://user-images.githubusercontent.com/19833687/128317469-ed4e71d3-7b0a-4ca0-84e9-07310397c429.png) These Roles allow duplicate assignments: https://github.com/netbox-community/netbox/blob/ee8fd701ae2d86ad74ab2d88ead341a9974226ff/netbox/ipam/constants.py#L43 Code involved for duplicate detection: https://github.com/netbox-community/netbox/blob/ee8fd701ae2d86ad74ab2d88ead341a9974226ff/netbox/ipam/models/ip.py#L636
Author
Owner

@jeremystretch commented on GitHub (Aug 5, 2021):

As @sdktr notes, the supported approach here is to create a discrete instance of the IP address for each assignment. This ensures a greater degree of flexibility, allowing the operator to manipulate the attributes of each individual IP address as needed.

@jeremystretch commented on GitHub (Aug 5, 2021): As @sdktr notes, the supported approach here is to create a discrete instance of the IP address for each assignment. This ensures a greater degree of flexibility, allowing the operator to manipulate the attributes of each individual IP address as needed.
Author
Owner

@c-po commented on GitHub (Aug 5, 2021):

Works for me. Thank you for pointing this out!

@c-po commented on GitHub (Aug 5, 2021): Works for me. Thank you for pointing this out!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5142