Add an IPv6 address defaults to 0th address #1367

Closed
opened 2025-12-29 16:31:49 +01:00 by adam · 3 comments
Owner

Originally created by @ktims on GitHub (Oct 31, 2017).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.3
  • NetBox version: 2.2.2

Description

When adding an IPv6 address to an existing prefix, the 'all-zeroes' host address seems to be considered available, and is filled in the input box, even if other IPs in the subnet are allocated, so the default is never sensible.

The all-zeroes address is reserved by RFC4291 2.6.1 as the subnet-router anycast address. Its manual assignment only makes sense on /127s, where RFC6164 asserts that the subnet-anycast mechanism MUST be disabled. At the very least, it isn't a sensible default, as operationally it should never be used for unicast, and many devices will block its usage.

Furthermore, the ipam/prefixes/<id>/available-ips endpoint appears to sort of 'do the right thing' and consider the 1st address to be the first available rather than the 0th. However, on /127s, it asserts that 0 IPs are available.

So:

  • When adding an IPv6 address, the default form-filled value should be the first available IP that is not all-zeros in the host portion, except when the mask length is /127
  • The ipam/prefixes/<id>/available-ips should be consistent with the /127 exception
Originally created by @ktims on GitHub (Oct 31, 2017). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. If none of the below apply, please raise your issue for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. ---> ### Issue type [ ] Feature request <!-- Requesting the implementation of a new feature --> [x] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) --> ### Environment * Python version: 3.5.3<!-- Example: 3.5.4 --> * NetBox version: 2.2.2<!-- Example: 2.1.3 --> <!-- BUG REPORTS must include: * A list of the steps needed to reproduce the bug * A description of the expected behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description When adding an IPv6 address to an existing prefix, the 'all-zeroes' host address seems to be considered available, and is filled in the input box, even if other IPs in the subnet are allocated, so the default is never sensible. The all-zeroes address is reserved by [RFC4291 2.6.1](https://tools.ietf.org/html/rfc4291#section-2.6.1) as the subnet-router anycast address. Its manual assignment only makes sense on /127s, where [RFC6164](https://tools.ietf.org/html/rfc6164#section-6) asserts that the subnet-anycast mechanism MUST be disabled. At the very least, it isn't a sensible default, as operationally it should never be used for unicast, and many devices will block its usage. Furthermore, the `ipam/prefixes/<id>/available-ips` endpoint appears to sort of 'do the right thing' and consider the 1st address to be the first available rather than the 0th. However, on /127s, it asserts that 0 IPs are available. So: * When adding an IPv6 address, the default form-filled value should be the first available IP that is not all-zeros in the host portion, except when the mask length is /127 * The `ipam/prefixes/<id>/available-ips` should be consistent with the /127 exception
adam added the type: feature label 2025-12-29 16:31:49 +01:00
adam closed this issue 2025-12-29 16:31:49 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 2, 2017):

The same thing happens with IPv4. NetBox is just prepopulating the network. It's not automatically choosing the first available IP because IMO it's not fair to assume that's what the user wants to add.

@jeremystretch commented on GitHub (Nov 2, 2017): The same thing happens with IPv4. NetBox is just prepopulating the network. It's not automatically choosing the first available IP because IMO it's not fair to assume that's what the user wants to add.
Author
Owner

@ktims commented on GitHub (Nov 2, 2017):

I see... this doesn't seem like very useful behaviour, as you're never going to want to assign the network address to something. But I don't really use the 'Add IP Address' button.

Where I actually noticed the discrepancy was on the IP Addresses tab, which changes the flavour of this bug slightly. In IPv6, the 0th address seems to be considered 'available' even when it's not a pool. It adds a '1 IP available' row, and is the default when clicking 'Many IPs available' or any other free block that starts at the bottom of the subnet.

@ktims commented on GitHub (Nov 2, 2017): I see... this doesn't seem like very useful behaviour, as you're *never* going to want to assign the network address to something. But I don't really use the 'Add IP Address' button. Where I actually noticed the discrepancy was on the IP Addresses tab, which changes the flavour of this bug slightly. In IPv6, the 0th address seems to be considered 'available' even when it's not a pool. It adds a '1 IP available' row, and is the default when clicking 'Many IPs available' or any other free block that starts at the bottom of the subnet.
Author
Owner

@jeremystretch commented on GitHub (Nov 15, 2017):

Guess we'll just default to the first available IP and hope people are paying attention.

@jeremystretch commented on GitHub (Nov 15, 2017): Guess we'll just default to the first available IP and hope people are paying attention.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1367