Parent/Child Prefixes not belonging to the same VRF #3773

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

Originally created by @xjs678qr on GitHub (Jun 11, 2020).

Environment

Python version: 3.6.9
NetBox version: 2.8.5

Steps to Reproduce

Create a container prefix in IPAM in the Global VRF (10.8.0.0/13) for Tenant A.
Create a container prefix in IPAM in the VRF 'Branches' (10.8.128.0/19) for Tenant A.

Expected Behavior

The child prefix 10.8.128.0/19 is considered as a child prefix of 10.8.0.0/13 and de-counted from the available IP space in 10.8.0.0/13.

Observed Behavior

When opening 10.8.0.0/13, 10.8.128.0/19 is listed amongst the child prefixes. However, the utilization for 10.8.0.0/13 is listed as 0% and in the collapsed prefix view, 10.8.128.0/19 is listed at top level.
If I alter 10.8.0.0/13 to the same VRF ('Branches') as 10.8.128.0/19, the utilization is calculated as exptected.

Originally created by @xjs678qr on GitHub (Jun 11, 2020). ### Environment Python version: 3.6.9 NetBox version: 2.8.5 ### Steps to Reproduce Create a container prefix in IPAM in the Global VRF (10.8.0.0/13) for Tenant A. Create a container prefix in IPAM in the VRF 'Branches' (10.8.128.0/19) for Tenant A. ### Expected Behavior The child prefix 10.8.128.0/19 is considered as a child prefix of 10.8.0.0/13 and de-counted from the available IP space in 10.8.0.0/13. ### Observed Behavior When opening 10.8.0.0/13, 10.8.128.0/19 is listed amongst the child prefixes. However, the utilization for 10.8.0.0/13 is listed as 0% and in the collapsed prefix view, 10.8.128.0/19 is listed at top level. If I alter 10.8.0.0/13 to the same VRF ('Branches') as 10.8.128.0/19, the utilization is calculated as exptected.
adam added the status: duplicate label 2025-12-29 18:31:09 +01:00
adam closed this issue 2025-12-29 18:31:09 +01:00
Author
Owner

@jsenecal commented on GitHub (Jun 14, 2020):

Hi @xjs678qr, could this be related to what is discussed there? https://github.com/netbox-community/netbox/issues/1073 or there? https://github.com/netbox-community/netbox/issues/2562

@jsenecal commented on GitHub (Jun 14, 2020): Hi @xjs678qr, could this be related to what is discussed there? https://github.com/netbox-community/netbox/issues/1073 or there? https://github.com/netbox-community/netbox/issues/2562
Author
Owner

@DanSheps commented on GitHub (Jun 15, 2020):

It is a duplicate of #2562

The reason for it is the way we count IP prefixes and VRF membership. In an effort to be as efficient as possible, we maintain a list of VRF's and pop the VRF once we "exit" that VRF, so if you have:

  • 10.8.0.0/13, VRF: Global
  • 10.8.0.0/19 VRF: Branches
  • 10.8.1.0/24 VRF: Global
  • 10.8.128.0/19 VRF: Branches

By the time we hit "branches" we have already exited the VRF. There will be some new logic eventually, but not quite yet as it is quite involved.

@DanSheps commented on GitHub (Jun 15, 2020): It is a duplicate of #2562 The reason for it is the way we count IP prefixes and VRF membership. In an effort to be as efficient as possible, we maintain a list of VRF's and pop the VRF once we "exit" that VRF, so if you have: * 10.8.0.0/13, VRF: Global * 10.8.0.0/19 VRF: Branches * 10.8.1.0/24 VRF: Global * 10.8.128.0/19 VRF: Branches By the time we hit "branches" we have already exited the VRF. There will be some new logic eventually, but not quite yet as it is quite involved.
Author
Owner

@DanSheps commented on GitHub (Jun 15, 2020):

Duplicate of #2562

@DanSheps commented on GitHub (Jun 15, 2020): Duplicate of #2562
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3773