netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.22k stars 2.59k forks source link

Detailed overview of prefixes #2126

Closed cyberbootje closed 6 years ago

cyberbootje commented 6 years ago

Issue type

[X ] Feature request [ ] Bug report [ ] Documentation

Environment

Basically, i think Netbox should hand out available ip resources within a blink of an eye without having to think what is free or not.

candlerb commented 6 years ago

It would be nice to be able to display all ip addresses within a (sub)prefix for ipv4 and ipv6.

In Netbox today, when you navigate to a prefix, there is already a tab labelled "IP Addresses". How does your proposal differ from this?

When you assign an ip address you want to make sure the ip is free, Netbox covers that but what it doesn't do is hand out a detailed list of all ip addresses within that range whether it's reserved, assigned or free like in Racktables.

It does, except that ranges of IP free addresses are aggregated. Here is an example:

image

When you click on the /27 you would get a list of all the 32 ip's within that prefix and should be able to link it to devices, virtual machines and maybe even reserve it/add comments.

That sounds like two slightly different requests.

  1. Itemising all free IP addresses. Note that in the Netbox data model, there is no object representing a "free" address; it's just a gap between other addresses. But I prefer aggregating the gaps: in an IPv6 subnet you could have millions of free addresses between A1 and A2, and I wouldn't want them listed separately.

  2. Being able to assign a free IP address directly to an interface, from the IPAM region. At the moment, Netbox doesn't work this way: if you create an IP address first, it's quite tedious to assign it to an interface. It works better if you go to the interface and add a new IP address there.

A use case for the new feature: ipv4 If you have a /26 and you created it as a "shared prefix" it is possible that you want to assign ip 1 to 8 to customer A and ip 16 to 18 to customer B. When customer A wants 2 more you would have a clear overview of the assigned list and select ip 9 and 10 to be "added" to the account of customer A. Customer A is happy not to have it's ip's scattered around the whole prefix.

I think a better solution for this is IP Address Ranges, see #834

jeremystretch commented 6 years ago

As far as I can tell, the available-prefixes and available-ips API endpoints already provide the functionality being proposed.