Container for loopbacks shows 0% utilisation #1863

Closed
opened 2025-12-29 17:19:52 +01:00 by adam · 1 comment
Owner

Originally created by @candlerb on GitHub (Jul 23, 2018).

Issue type

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

Environment

  • Python version: 3.5.2
  • NetBox version: 2.3.5

Description

  • Create prefix 192.0.2.240/29 of type "container"
  • Create IP address 192.0.2.240/32, role "loopback"
  • Create IP address 192.0.2.241/32, role "loopback"

I was expecting to see the container as 25% used. But it shows 0% used.

I infer from this: container prefixes are counting only contained prefixes towards utilisation, and not individual IP addresses which are contained directly by the container?

Originally created by @candlerb on GitHub (Jul 23, 2018). ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [X] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> [ ] Housekeeping <!-- Changes pertaining to the codebase itself --> ### Environment * Python version: 3.5.2 * NetBox version: 2.3.5 ### Description * Create prefix 192.0.2.240/29 of type "container" * Create IP address 192.0.2.240/32, role "loopback" * Create IP address 192.0.2.241/32, role "loopback" I was expecting to see the container as 25% used. But it shows 0% used. I infer from this: container prefixes are counting only contained prefixes towards utilisation, and not individual IP addresses which are contained directly by the container?
adam closed this issue 2025-12-29 17:19:52 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 23, 2018):

I infer from this: container prefixes are counting only contained prefixes towards utilisation, and not individual IP addresses which are contained directly by the container?

This is correct. Changing the prefix to "active" (or anything other than "container") will calculate utilization based on IP addresses rather than child prefixes. This approach was chosen because either approach to determining utilization may be desired depending on the context.

@jeremystretch commented on GitHub (Jul 23, 2018): > I infer from this: container prefixes are counting only contained prefixes towards utilisation, and not individual IP addresses which are contained directly by the container? This is correct. Changing the prefix to "active" (or anything other than "container") will [calculate utilization](https://github.com/digitalocean/netbox/blob/develop/netbox/ipam/models.py#L359) based on IP addresses rather than child prefixes. This approach was chosen because either approach to determining utilization may be desired depending on the context.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1863