Expand IP Range Limit to Account for Larger IPv6 Ranges #7899

Closed
opened 2025-12-29 20:29:40 +01:00 by adam · 11 comments
Owner

Originally created by @Joshua-M-CANARIE on GitHub (Apr 12, 2023).

NetBox version

3.4.7

Feature type

Data model extension

Proposed functionality

Increase IP Range MAX_SIZE from the current:
MAX_SIZE = 2 ** 32 - 1
and change it to accommodate IPv6 Ranges:

MAX_SIZE = 2 ** 32 - 1
if self.family == 6:
   MAX_SIZE = 2 ** 128 - 1

Use case

Organizations wanting to keep track of their IPv6 blocks are limited currently to /96 or smaller blocks. Within my organization, we have IPv6 blocks that we break into /64 ranges for peering, but attempts to keep track of these peering blocks with IP Ranges fail due to the maximum size restriction limiting to IPv4 sizes.

Database changes

No response

External dependencies

No response

Originally created by @Joshua-M-CANARIE on GitHub (Apr 12, 2023). ### NetBox version 3.4.7 ### Feature type Data model extension ### Proposed functionality Increase IP Range MAX_SIZE from the current: `MAX_SIZE = 2 ** 32 - 1` and change it to accommodate IPv6 Ranges: ``` MAX_SIZE = 2 ** 32 - 1 if self.family == 6: MAX_SIZE = 2 ** 128 - 1 ``` ### Use case Organizations wanting to keep track of their IPv6 blocks are limited currently to /96 or smaller blocks. Within my organization, we have IPv6 blocks that we break into /64 ranges for peering, but attempts to keep track of these peering blocks with IP Ranges fail due to the maximum size restriction limiting to IPv4 sizes. ### Database changes _No response_ ### External dependencies _No response_
adam added the type: featurestatus: needs ownerpending closure labels 2025-12-29 20:29:40 +01:00
adam closed this issue 2025-12-29 20:29:40 +01:00
Author
Owner

@jeremystretch commented on GitHub (Apr 13, 2023):

I'm afraid I don't understand your use case. /64s would be tracked as prefixes, not IP ranges. Could you elaborate on specifically what you're trying to model?

@jeremystretch commented on GitHub (Apr 13, 2023): I'm afraid I don't understand your use case. /64s would be tracked as prefixes, not IP ranges. Could you elaborate on specifically what you're trying to model?
Author
Owner

@Joshua-M-CANARIE commented on GitHub (Apr 13, 2023):

For IPv6, we have a /48 that we have been breaking up into /64s for smaller applications like peering, I was intending to track these /64s with ranges to allow for displaying what the next available /64 is. These subnets for purely used for peering, and therefor IP Prefixes are overkill for our application.
I recognize that it's wasteful of the IP address usage, but it's the habit with our company, and has been in place since before I joined.

@Joshua-M-CANARIE commented on GitHub (Apr 13, 2023): For IPv6, we have a /48 that we have been breaking up into /64s for smaller applications like peering, I was intending to track these /64s with ranges to allow for displaying what the next available /64 is. These subnets for purely used for peering, and therefor IP Prefixes are overkill for our application. I recognize that it's wasteful of the IP address usage, but it's the habit with our company, and has been in place since before I joined.
Author
Owner

@DanSheps commented on GitHub (Apr 14, 2023):

I spoke with Joshua about this. Here is how it is setup from my understanding. Maybe Joshua can correct me further.

X::X/48 (Aggregate)
-- X::X/64 (Prefix)
---- X::X/64 to X::Y/64 where X to Y is a /90 for example.

Available IPs in the range for the /96 is the limit for the range (2**32). I believe they would like to be able to use a complete range, all the way up to the /64 or ideally the /0 bound of a IPv6 address.

I suspect we placed the 2**32 in place not thinking about the possible IP Ranges available in IPv6

@DanSheps commented on GitHub (Apr 14, 2023): I spoke with Joshua about this. Here is how it is setup from my understanding. Maybe Joshua can correct me further. X::X/48 (Aggregate) -- X::X/64 (Prefix) ---- X::X/64 to X::Y/64 where X to Y is a /90 for example. Available IPs in the range for the /96 is the limit for the range (`2**32`). I believe they would like to be able to use a complete range, all the way up to the /64 or ideally the /0 bound of a IPv6 address. I suspect we placed the 2**32 in place not thinking about the possible IP Ranges available in IPv6
Author
Owner

@jeremystretch commented on GitHub (May 4, 2023):

I still don't understand the need to track such an enormous arbitrary range. Why not use a prefix?

@jeremystretch commented on GitHub (May 4, 2023): I still don't understand the need to track such an enormous arbitrary range. Why not use a prefix?
Author
Owner

@Joshua-M-CANARIE commented on GitHub (May 9, 2023):

To clarify what we do:

We have a /32, that we split into /48s, and split those into /64 that are used for point to point peerings.
X:X::/32
-- X:X:X::/48 (prefix)
---- X:X:X:X::/64 (range)
------ X:X:X:X::1/64 to X:X:X:X::2/64 (the peering addresses)

My question is that, you have the MAX_SIZE value used to keep ranges from being 0.0.0.0 to 255.255.255.255, but allow for any other range of IPv4 addresses to be represented in a range, but with the limitation for IPv4, IPv6 gets unproportionately limited to only a quarter of it's size, isn't it fair to provide both types of IP access to their near full range?

@Joshua-M-CANARIE commented on GitHub (May 9, 2023): To clarify what we do: We have a /32, that we split into /48s, and split those into /64 that are used for point to point peerings. X:X::/32 -- X:X:X::/48 (prefix) ---- X:X:X:X::/64 (range) ------ X:X:X:X::1/64 to X:X:X:X::2/64 (the peering addresses) My question is that, you have the MAX_SIZE value used to keep ranges from being 0.0.0.0 to 255.255.255.255, but allow for any other range of IPv4 addresses to be represented in a range, but with the limitation for IPv4, IPv6 gets unproportionately limited to only a quarter of it's size, isn't it fair to provide both types of IP access to their near full range?
Author
Owner

@jeremystretch commented on GitHub (May 9, 2023):

The MAX_SIZE constant is used to validate that the size of a range doesn't exceed the maximum value of the size database field (a signed 32-bit integer); it has nothing to do with address planning.

@jeremystretch commented on GitHub (May 9, 2023): The `MAX_SIZE` constant is used to validate that the size of a range doesn't exceed the maximum value of the `size` database field (a signed 32-bit integer); it has nothing to do with address planning.
Author
Owner

@ciroiriarte commented on GitHub (May 18, 2023):

Hello!, I have a similar situation. What would be the correct way to model this in Netbox currently?:

Delegated space --> /48 (pool segment)
Subnet --> /64 (segment)
DHCPv6 range --> space within the same /64 (range)

Currently Netbox doesn't accept a range like ????:0600:008:4089:0:ffff:0:0 - ????:0600:008:4089:0:ffff:ffff:ffff.

I assume I could mark the parent /64 as a pool and create ranges within it, but I understand pools are not actually setup as subnets in active nodes, which in this opportunity is not the case.

@ciroiriarte commented on GitHub (May 18, 2023): Hello!, I have a similar situation. What would be the correct way to model this in Netbox currently?: Delegated space --> /48 (pool segment) Subnet --> /64 (segment) DHCPv6 range --> space within the same /64 (range) Currently Netbox doesn't accept a range like ????:0600:008:4089:0:ffff:0:0 - ????:0600:008:4089:0:ffff:ffff:ffff. I assume I could mark the parent /64 as a pool and create ranges within it, but I understand pools are not actually setup as subnets in active nodes, which in this opportunity is not the case.
Author
Owner

@DanSheps commented on GitHub (May 18, 2023):

I might make sense to switch to BigIntegerField if there is a need.

@DanSheps commented on GitHub (May 18, 2023): I might make sense to switch to BigIntegerField if there is a need.
Author
Owner

@gurubert commented on GitHub (Aug 15, 2023):

We would also like to use /80 IPv6 ranges within a /64 prefix.

@gurubert commented on GitHub (Aug 15, 2023): We would also like to use /80 IPv6 ranges within a /64 prefix.
Author
Owner

@github-actions[bot] commented on GitHub (Nov 14, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Nov 14, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Feb 28, 2024):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Feb 28, 2024): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7899