Add subnet or broadcast in prefix #2657

Closed
opened 2025-12-29 18:20:57 +01:00 by adam · 2 comments
Owner

Originally created by @ghost on GitHub (Jun 6, 2019).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.5.13

Steps to Reproduce

  1. Add prefix
  2. Enter prefix
  3. Switch to tab 'IP Addresses'
  4. Click on XXX IPs available for XXX.XXX.XXX.0/XX or XXX.XXX.XXX.255/XX ip addresses (even showing these as available)

Expected Behavior

Not showing .0 or .255 ip addresses, since they are a subnet or broadcast address

Observed Behavior

Can add .0 or .255 as useable address

Clipboard02
Clipboard01
Clipboard04
Clipboard03

Originally created by @ghost on GitHub (Jun 6, 2019). <!-- NOTE: This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.6.8 * NetBox version: 2.5.13 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> ### Steps to Reproduce 1. Add prefix 2. Enter prefix 3. Switch to tab 'IP Addresses' 4. Click on XXX IPs available for XXX.XXX.XXX.0/XX or XXX.XXX.XXX.255/XX ip addresses (even showing these as available) <!-- What did you expect to happen? --> ### Expected Behavior Not showing .0 or .255 ip addresses, since they are a subnet or broadcast address <!-- What happened instead? --> ### Observed Behavior Can add .0 or .255 as useable address ![Clipboard02](https://user-images.githubusercontent.com/48771302/59025521-a4801a80-8854-11e9-8e48-43ee16ace4f0.jpg) ![Clipboard01](https://user-images.githubusercontent.com/48771302/59025522-a4801a80-8854-11e9-8cf3-484c70857e8a.jpg) ![Clipboard04](https://user-images.githubusercontent.com/48771302/59025524-a518b100-8854-11e9-89d0-317001d73e04.jpg) ![Clipboard03](https://user-images.githubusercontent.com/48771302/59025525-a518b100-8854-11e9-8b28-acb785a23917.jpg)
adam closed this issue 2025-12-29 18:20:57 +01:00
Author
Owner

@DanSheps commented on GitHub (Jun 6, 2019):

This is most likely behaviour that has not been changed since initial release.

Couple of reasons for this:

  1. Prefixes can be designated a "pool", in which case it would be perfectly valid to have a network and broadcast address
  2. There may be specific reasons that you want to document the Network or Broadcast address, or perhaps you forgot to mark it as a pool
  3. This has to be done manually, as in you have to consciously choose to input the network or broadcast address. Both the UI and the API correctly return only the usable addresses available

I personally think the work required to implement the appropriate checks for this is better spent elsewhere.

@DanSheps commented on GitHub (Jun 6, 2019): This is most likely behaviour that has not been changed since initial release. Couple of reasons for this: 1. Prefixes can be designated a "pool", in which case it would be perfectly valid to have a network and broadcast address 2. There may be specific reasons that you want to document the Network or Broadcast address, or perhaps you forgot to mark it as a pool 3. This has to be done manually, as in you have to consciously choose to input the network or broadcast address. Both the UI and the API correctly return only the usable addresses available I personally think the work required to implement the appropriate checks for this is better spent elsewhere.
Author
Owner

@ghost commented on GitHub (Jun 11, 2019):

Thanks for your feedback. I personally think broadcast addresses should never be used and subnet address is defined by prefix, but I understand it'd be a lot of work to do.

You now know about this issue, whether or not you'd like to fix this in future belongs to you/netbox team!

@ghost commented on GitHub (Jun 11, 2019): Thanks for your feedback. I personally think broadcast addresses should never be used and subnet address is defined by prefix, but I understand it'd be a lot of work to do. You now know about this issue, whether or not you'd like to fix this in future belongs to you/netbox team!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2657