-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
NetBox version
v3.3.9
Feature type
Change to existing functionality
Proposed functionality
I would like to be able to fetch a device based on it's primary ipv4 (and probably also ipv6). I understand IP addresses aren't unique (you can them in multiple VRF's), but it should still be posible to get the device based on the ID of the IP Address.
Related to #10058
Mentioned here https://groups.google.com/g/netbox-discuss/c/Di5VMTtK5lg
Use case
I'm pushing devices to netbox trough a script with the API, and it happens that a device already exists with the same primary IP address. I want to handle these cases (probably by removing the old device).
When adding the device, I currently only get the error Device with this Primary IPv4 already exists, but there is no way to find this actual device.
I assign the IP address to an interface of the new device before I can configure the primary IP, but somehow while doing this, the IP address is still linked to an old device, causing that device to have a primary IP4 that isn't linked to any of its interfaces.
Once this happens, it's not possible anymore to find the actual device to remove it.
Database changes
No response
External dependencies
No response