Removing an interface with an IP linked on a device=> remove the interface and the IP #4097

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

Originally created by @Tavoons on GitHub (Sep 11, 2020).

I found this bug because I failed to remove the link between interface and IP, so I removed the interface and I discover that removing interface also delete the IP linked

Environment

  • Python version: 3.7.9
  • NetBox version: 2.9.3
    Create an IP then create a device, create an interface on this device. Link the interface to the IP
    I'm unable to remove the assignement, so I tried to remove the interface and it removes the IP too

Steps to Reproduce

  1. Create an IP
  2. Create a device
  3. Create an interface and link it to the IP
  4. Remove the interface

Expected Behavior

I expect that removing an interface, remove the interface and unlink all IPs

Observed Behavior

Removing interfaces, also remove all IPs linked to this interface

It would be nice to be able to only remove the link between an interface and an IP

Originally created by @Tavoons on GitHub (Sep 11, 2020). I found this bug because I failed to remove the link between interface and IP, so I removed the interface and I discover that removing interface also delete the IP linked ### Environment * Python version: 3.7.9 * NetBox version: 2.9.3 Create an IP then create a device, create an interface on this device. Link the interface to the IP I'm unable to remove the assignement, so I tried to remove the interface and it removes the IP too ### Steps to Reproduce 1. Create an IP 2. Create a device 3. Create an interface and link it to the IP 4. Remove the interface ### Expected Behavior I expect that removing an interface, remove the interface and unlink all IPs ### Observed Behavior Removing interfaces, also remove all IPs linked to this interface It would be nice to be able to only remove the link between an interface and an IP
adam closed this issue 2025-12-29 18:33:07 +01:00
Author
Owner

@DanSheps commented on GitHub (Sep 13, 2020):

Typically, when a IP is assigned an interface, removing that interface generally means you want to remove that IP from the network as that IP is no longer in use on the network.

@DanSheps commented on GitHub (Sep 13, 2020): Typically, when a IP is assigned an interface, removing that interface generally means you want to remove that IP from the network as that IP is no longer in use on the network.
Author
Owner

@Tavoons commented on GitHub (Sep 13, 2020):

Yes exactly, but not in all cases ...
For example, I got a pool of IP and if an IP ( from this pool) is linked to
a device and we have to disconnect it. I just want to be able to unlink the
IP and put the device in "inventory"
In this way when I'm searching for a reusable IP in my pool I can use the
filter "assigned to an interface".
If I delete the IP, I lost all informations about IP (Tenant, dns_name,
description, and custom field). So, in my use case, it would be nice to
have a button to only unlink IP.

One more thing, correct me if I'm wrong but I believe that Netbox doesn't
warn me that all IPs linked to an interface will be deleted when I delete
the interface

Le dim. 13 sept. 2020 à 05:06, Daniel Sheppard notifications@github.com a
écrit :

Typically, when a IP is assigned an interface, removing that interface
generally means you want to remove that IP from the network as that IP is
no longer in use on the network.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/netbox-community/netbox/issues/5130#issuecomment-691600050,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AJOGC6NKKVISHCROVJCUK3LSFQZLJANCNFSM4RHRR64Q
.

@Tavoons commented on GitHub (Sep 13, 2020): Yes exactly, but not in all cases ... For example, I got a pool of IP and if an IP ( from this pool) is linked to a device and we have to disconnect it. I just want to be able to unlink the IP and put the device in "inventory" In this way when I'm searching for a reusable IP in my pool I can use the filter "assigned to an interface". If I delete the IP, I lost all informations about IP (Tenant, dns_name, description, and custom field). So, in my use case, it would be nice to have a button to only unlink IP. One more thing, correct me if I'm wrong but I believe that Netbox doesn't warn me that all IPs linked to an interface will be deleted when I delete the interface Le dim. 13 sept. 2020 à 05:06, Daniel Sheppard <notifications@github.com> a écrit : > Typically, when a IP is assigned an interface, removing that interface > generally means you want to remove that IP from the network as that IP is > no longer in use on the network. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/netbox-community/netbox/issues/5130#issuecomment-691600050>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AJOGC6NKKVISHCROVJCUK3LSFQZLJANCNFSM4RHRR64Q> > . >
Author
Owner

@jeremystretch commented on GitHub (Sep 14, 2020):

It would be nice to be able to only remove the link between an interface and an IP

It is equally valid to assert that it "would be nice" to retain the current behavior of automatically removing the IP address as well, which is the current behavior. I see no reason to change this.

@jeremystretch commented on GitHub (Sep 14, 2020): > It would be nice to be able to only remove the link between an interface and an IP It is equally valid to assert that it "would be nice" to retain the current behavior of automatically removing the IP address as well, which is the current behavior. I see no reason to change this.
Author
Owner

@Tavoons commented on GitHub (Sep 14, 2020):

I completely understand what you say, but in 2.8.9, i was able to edit the IP and unassign the interface (screenshot below). I can't do that in v2.9.3 when I edit the IP and I click on the cross to remove the association and I save, there are no changes...

My problem is more about how to unlink an IP and an interface and this is no longer possible in version 2.9

Screenshot v2.8.9

image

Selecting "--------------------------"

image

Now the IP is no more linked to the device

image

@Tavoons commented on GitHub (Sep 14, 2020): I completely understand what you say, but in 2.8.9, i was able to edit the IP and unassign the interface (screenshot below). I can't do that in v2.9.3 when I edit the IP and I click on the cross to remove the association and I save, there are no changes... My problem is more about how to unlink an IP and an interface and this is no longer possible in version 2.9 #### Screenshot v2.8.9 ![image](https://user-images.githubusercontent.com/39608697/93097960-8aafc300-f6a6-11ea-9446-0edc804d74c7.png) Selecting "--------------------------" ![image](https://user-images.githubusercontent.com/39608697/93098044-a9ae5500-f6a6-11ea-85a0-99c9365ae686.png) Now the IP is no more linked to the device ![image](https://user-images.githubusercontent.com/39608697/93098114-c0ed4280-f6a6-11ea-9d17-7a47d439cd39.png)
Author
Owner

@jeremystretch commented on GitHub (Sep 14, 2020):

My problem is more about how to unlink an IP and an interface and this is no longer possible in version 2.9

This would need a bug report, as it is a separate issue from what you've raised here.

@jeremystretch commented on GitHub (Sep 14, 2020): > My problem is more about how to unlink an IP and an interface and this is no longer possible in version 2.9 This would need a bug report, as it is a separate issue from what you've raised here.
Author
Owner

@jeremystretch commented on GitHub (Sep 16, 2020):

I'm going to close this as I don't see anything actionable here. #5133 has been opened to address the underlying bug.

@jeremystretch commented on GitHub (Sep 16, 2020): I'm going to close this as I don't see anything actionable here. #5133 has been opened to address the underlying bug.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4097