Prefix available IPs count is wrong #6128

Closed
opened 2025-12-29 19:37:06 +01:00 by adam · 4 comments
Owner

Originally created by @abhi1693 on GitHub (Feb 22, 2022).

NetBox version

v3.2.0-beta1

Python version

3.8

Steps to Reproduce

  1. Create a prefix with the following data
    • Prefix: 65.49.10.64/26
    • Is pool: true
  2. Add an IP address with the following data
    • Address: 65.49.10.74/32
  3. Go to the prefix page for 65.49.10.64/26 and notice the count for available IP addresses

Expected Behavior

Available IP address count should be 63

Observed Behavior

Available IP address count is 3

Originally created by @abhi1693 on GitHub (Feb 22, 2022). ### NetBox version v3.2.0-beta1 ### Python version 3.8 ### Steps to Reproduce 1. Create a prefix with the following data - Prefix: `65.49.10.64/26` - Is pool: `true` 2. Add an IP address with the following data - Address: `65.49.10.74/32` 3. Go to the prefix page for `65.49.10.64/26` and notice the count for available IP addresses ### Expected Behavior Available IP address count should be `63` ### Observed Behavior Available IP address count is `3`
adam closed this issue 2025-12-29 19:37:06 +01:00
Author
Owner

@jeremystretch commented on GitHub (Feb 22, 2022):

I'm not able to reproduce this. The available IPs count shows 63 as expected.
Screenshot 2022-02-22 at 08-30-06 65 49 10 64 26 NetBox

@jeremystretch commented on GitHub (Feb 22, 2022): I'm not able to reproduce this. The available IPs count shows 63 as expected. ![Screenshot 2022-02-22 at 08-30-06 65 49 10 64 26 NetBox](https://user-images.githubusercontent.com/13487278/155142116-7e68a14c-42b6-4a89-88ac-fdf0da720781.png)
Author
Owner

@abhi1693 commented on GitHub (Feb 22, 2022):

I have purged the database that I have been working with yesterday. I'll add more details tonight if I can reproduce this a few more times.

@abhi1693 commented on GitHub (Feb 22, 2022): I have purged the database that I have been working with yesterday. I'll add more details tonight if I can reproduce this a few more times.
Author
Owner

@abhi1693 commented on GitHub (Feb 22, 2022):

@jeremystretch I'm having a hard time with the count value here. Could you please help me here?

I have a parent prefix with 65.49.10.64/26 and is_pool=False. I flipped the is_pool value deliberately.
Then I added a child range to this with the range 65.49.10.104/26 to 65.49.10.110/26. This shows me the size of 7.
image
Then I added an IP address 65.49.10.74/32 under my parent prefix
image
Under the IP address tab of the prefix, my count is 61
image
But on the main page, the count is 54
image

What I'm missing here? Or am I not understanding the concept here of prefix and IP addresses?

@abhi1693 commented on GitHub (Feb 22, 2022): @jeremystretch I'm having a hard time with the count value here. Could you please help me here? I have a parent prefix with `65.49.10.64/26` and `is_pool=False`. I flipped the `is_pool` value deliberately. Then I added a child range to this with the range `65.49.10.104/26` to `65.49.10.110/26`. This shows me the size of `7`. ![image](https://user-images.githubusercontent.com/5083532/155182944-f6341bfe-d987-4e39-9a7f-707ce84d2981.png) Then I added an IP address `65.49.10.74/32` under my parent prefix ![image](https://user-images.githubusercontent.com/5083532/155183309-9146ec85-5d25-4837-b797-591485e8d3ab.png) Under the IP address tab of the prefix, my count is `61` ![image](https://user-images.githubusercontent.com/5083532/155183418-a235875d-049a-4d64-8430-cd62c265ca8b.png) But on the main page, the count is `54` ![image](https://user-images.githubusercontent.com/5083532/155183516-5b216011-59b2-4890-99ec-98779efb1275.png) What I'm missing here? Or am I not understanding the concept here of prefix and IP addresses?
Author
Owner

@jeremystretch commented on GitHub (Feb 23, 2022):

Your initial post makes no mention of IP ranges. IP ranges count as used space within a prefix, so what you're seeing makes sense.

But on the main page, the count is 54

The IP addresses table is showing you only IP addresses within the parent prefix, whereas the parent utilization considers both individual IP addresses and ranges.

I'm going to close this as what you've shown is expected behavior. If you need further assistance, please consider opening a discussion.

@jeremystretch commented on GitHub (Feb 23, 2022): Your initial post makes no mention of IP ranges. IP ranges count as used space within a prefix, so what you're seeing makes sense. > But on the main page, the count is 54 The IP addresses table is showing you only IP addresses within the parent prefix, whereas the parent utilization considers both individual IP addresses and ranges. I'm going to close this as what you've shown is expected behavior. If you need further assistance, please consider opening a [discussion](https://github.com/netbox-community/netbox/discussions/new).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6128