Change interface name via API patch removes IP address #4854

Closed
opened 2025-12-29 19:21:17 +01:00 by adam · 2 comments
Owner

Originally created by @scetron on GitHub (Apr 30, 2021).

NetBox version

v2.9.9

Python version

3.7

Steps to Reproduce

  1. Have an existing device with a named interface.
  2. Make sure the interface has an IP address.
  3. Use an API call to change the Name of the interface

Original interface name: "oldInterfaceName0"

Submit a patch request via the URL:
[netbox-api] /dcim/interfaces/[interface-id]/
Body:

{
  "name": "new_interface_name_0"
}
  1. The config is accepted but the interface loses it's IP address association. This is unexpected.

No other interface config is present, but it appears no other interface or device config changes.

Expected Behavior

Changing the interface name using the GUI does not cause any other configuration to change. I expect the same outcome using the api to patch update the interface name.

Observed Behavior

The IP address is removed from the interface when changing the interface name on a device.

Originally created by @scetron on GitHub (Apr 30, 2021). ### NetBox version v2.9.9 ### Python version 3.7 ### Steps to Reproduce 1. Have an existing device with a named interface. 2. Make sure the interface has an IP address. 3. Use an API call to change the Name of the interface Original interface name: "oldInterfaceName0" Submit a patch request via the URL: `[netbox-api] /dcim/interfaces/[interface-id]/` Body: ``` { "name": "new_interface_name_0" } ``` 4. The config is accepted but the interface loses it's IP address association. This is unexpected. No other interface config is present, but it appears no other interface or device config changes. ### Expected Behavior Changing the interface name using the GUI does not cause any other configuration to change. I expect the same outcome using the api to patch update the interface name. ### Observed Behavior The IP address is removed from the interface when changing the interface name on a device.
adam added the type: bugstatus: revisions needed labels 2025-12-29 19:21:17 +01:00
adam closed this issue 2025-12-29 19:21:17 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 30, 2021):

A couple issues:

  1. NetBox v2.9.9 is a bit outdated. Can you try replicating this on the current stable release? (You can try using our demo instance.)
  2. Please share the complete API request you're sending using a tool such as curl.
@jeremystretch commented on GitHub (Apr 30, 2021): A couple issues: 1. NetBox v2.9.9 is a bit outdated. Can you try replicating this on the current stable release? (You can try using our [demo instance](https://demo.netbox.dev/).) 2. Please share the complete API request you're sending using a tool such as `curl`.
Author
Owner

@scetron commented on GitHub (May 6, 2021):

Yup! Tried on the demo instance and doesn't appear to be there. I close this for now.

@scetron commented on GitHub (May 6, 2021): Yup! Tried on the demo instance and doesn't appear to be there. I close this for now.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#4854