"Create and Add Another" (IP address) forgets current device/interface #5158

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

Originally created by @candlerb on GitHub (Aug 8, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v2.11.10

Python version

3.6

Steps to Reproduce

  1. Open a device and navigate to the Interfaces page
  2. Click the "+" next to an interface (add IP address)
    • This takes you to e.g. /ipam/ip-addresses/add/?interface=3&return_url=/dcim/devices/1/interfaces/
  3. Enter an IP address, e.g. "1.2.3.4/24"
  4. Click "Create and Add Another"

[The same problem occurs with netbox v3.0-beta1 under python 3.8]

Expected Behavior

I expected it to return to the add IP address page, with the device and interface still selected, so that you can add a second IP address that interface.

(An common use case is when you want to add an IPv4 address and an IPv6 address to the same interface)

Observed Behavior

After adding the first address, Netbox goes to /ipam/ip-addresses/add/?status=active. It has forgotten the device and interface, so to assign the address to the correct device/interface, these have to be selected from scratch.

Hence it is currently quicker and more accurate to use "Create" instead of "Create and Add Another", since this returns you to the original device interface list, where you can click "+" again.

Another observation:

  • When adding the first IP address, the top two tabs show "New IP" (selected) and "Assign IP"
  • After the first IP address has been added with "Create and Add Another", the top two tabs show "New IP" (selected) and "Bulk Create"
Originally created by @candlerb on GitHub (Aug 8, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v2.11.10 ### Python version 3.6 ### Steps to Reproduce 1. Open a device and navigate to the Interfaces page 2. Click the "+" next to an interface (add IP address) * This takes you to e.g. `/ipam/ip-addresses/add/?interface=3&return_url=/dcim/devices/1/interfaces/` 3. Enter an IP address, e.g. "1.2.3.4/24" 4. Click "Create and Add Another" [The same problem occurs with netbox v3.0-beta1 under python 3.8] ### Expected Behavior I expected it to return to the add IP address page, with the device and interface still selected, so that you can add a second IP address that interface. (An common use case is when you want to add an IPv4 address and an IPv6 address to the same interface) ### Observed Behavior After adding the first address, Netbox goes to `/ipam/ip-addresses/add/?status=active`. It has forgotten the device and interface, so to assign the address to the correct device/interface, these have to be selected from scratch. Hence it is currently quicker and more accurate to use "Create" instead of "Create and Add Another", since this returns you to the original device interface list, where you can click "+" again. Another observation: * When adding the first IP address, the top two tabs show "New IP" (selected) and "Assign IP" * After the first IP address has been added with "Create and Add Another", the top two tabs show "New IP" (selected) and "Bulk Create"
adam added the type: bugstatus: accepted labels 2025-12-29 19:24:54 +01:00
adam closed this issue 2025-12-29 19:24:54 +01:00
Author
Owner

@candlerb commented on GitHub (Aug 14, 2021):

I have updated to v2.11.11, which includes commit 3105e954, but the problem remains.

The steps to reproduce are still exactly the same as listed above.

There is a slight change: after clicking "Create and Add Another", the page now goes to /ipam/ip-addresses/add/?return_url=/dcim/devices/1/interfaces/&status=active (i.e. return_url is now set).

However, the device/interface assignment is still forgotten:

image

EDIT: if I manually add &interface=3 to the URL, then it is rendered correctly.

@candlerb commented on GitHub (Aug 14, 2021): I have updated to v2.11.11, which includes commit 3105e954, but the problem remains. The steps to reproduce are still exactly the same as listed above. There is a slight change: after clicking "Create and Add Another", the page now goes to `/ipam/ip-addresses/add/?return_url=/dcim/devices/1/interfaces/&status=active` (i.e. `return_url` is now set). However, the device/interface assignment is still forgotten: ![image](https://user-images.githubusercontent.com/44789/129446891-1be5f696-fdee-4c6c-8814-5e7ec089b704.png) EDIT: if I manually add `&interface=3` to the URL, then it is rendered correctly.
Author
Owner

@candlerb commented on GitHub (Oct 20, 2021):

Could this be re-opened please? The behaviour is still the same in Netbox 3.0.8. The return URL is still missing interface=<id> and so the device and interface are not preserved when adding a second IP address.

@candlerb commented on GitHub (Oct 20, 2021): Could this be re-opened please? The behaviour is still the same in Netbox 3.0.8. The return URL is still missing `interface=<id>` and so the device and interface are not preserved when adding a second IP address.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5158