v2.2-beta IP Address interface assignment

116 views
Skip to first unread message

Paul Denning

unread,
Sep 14, 2017, 6:15:42 PM9/14/17
to NetBox
When adding a new IP Address or modifying an existing IP address without an interface assignment.

The ability to add assign the address to an device/interface as been removed.

Currently the only method i have found is to add the IP Address directly to the device.

Is this intended going forward or has the function been removed while working out the model for virtual machines or just a bug?

Brian Candler

unread,
Sep 15, 2017, 5:45:32 PM9/15/17
to NetBox
Just tested with v2.2-beta1, and I confirm this behaviour:

* Create IP 1.2.3.4/24
* Edit this IP
* No option to add it to a device/interface

You can't add the address from the other direction either: if I nagivate to the device, select Add Address to interface, enter 1.2.3.4/24, then I'm told this is a duplicate address (I have ENFORCE_GLOBAL_UNIQUE = True)

So the only option I can see is to first delete the IP address, then re-add IP address to device.

Similarly, I can't see how to move an IP address from one device to another. But I *can* move it from one interface to another on the same device (in Edit IP Address: there's a drop-down for the interface but not for the device)

Jeremy Stretch

unread,
Sep 18, 2017, 3:18:13 PM9/18/17
to Brian Candler, NetBox
This was done intentionally. As interfaces can now be assigned to both devices and virtual machines, it becomes very difficult to specify interfaces without additional context. For instance, when creating an IP, you can assign it to an interface by searching for a device, by selecting a device (from a series of dropdowns), by searching for a virtual machine, or by selecting a virtual machine. It becomes very tedious and confusing to include all of these widgets in a single form.

The are no doubt more elegant approaches, but I haven't had time yet to come up with anything. For now, you'll need to assign an IP to an interface by using the "add an IP button" on the interface within the device or virtual machine view.

Jeremy


--
You received this message because you are subscribed to the Google Groups "NetBox" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netbox-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to netbox-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netbox-discuss/8d903d17-990d-4c4d-879e-e684ab08bf5c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Brian Candler

unread,
Sep 18, 2017, 3:43:36 PM9/18/17
to NetBox
How about this as an idea.

* When you click "Add address to interface" (on either a Device or VM) you get the same page as now.

* When you click Add, then the system searches for any existing address(es) with the same Address and VRF.  If none are found, it just creates a new one as now, linked to this interface.

* However, if one or more matching addresses *are* found, then it gives a new page listing the matches in a table, and offering the option to:

- click on one of the existing addresses to link it to the this interface [^1]
- create a new address anyway (this is only offered if the VRF allows duplicate addresses)

Would that work?  It means you use the existing flows to search for a Device or VM.

It is also helpful for the use case where you have pre-imported your IPAM allocations from a legacy spreadsheet, and then are creating new Device and VM objects to attach them to.

Cheers,

Brian.

[^1] If the address is already linked to another interface this should be indicated in the results table, but you can still take it over.
Reply all
Reply to author
Forward
0 new messages