Implement a function to split an existing prefix into several smaller prefixes #2664

Closed
opened 2025-12-29 18:21:00 +01:00 by adam · 8 comments
Owner

Originally created by @jasb89 on GitHub (Jun 13, 2019).

Environment
NetBox version: 2.5.13
Proposed Functionality

Add Split and Merge to prefixes.
Split will split a single network into two networks.
Merge will merge two networks with similar subnet mask to a single bigger network.

Use Case
Will help dynamic organization when allocating IP ranges to new networks to directly split/merge based on size.

Database Changes
none

External Dependencies
none

Originally created by @jasb89 on GitHub (Jun 13, 2019). Environment NetBox version: 2.5.13 Proposed Functionality Add Split and Merge to prefixes. Split will split a single network into two networks. Merge will merge two networks with similar subnet mask to a single bigger network. Use Case Will help dynamic organization when allocating IP ranges to new networks to directly split/merge based on size. Database Changes none External Dependencies none
adam added the type: featurestatus: needs ownerpending closure labels 2025-12-29 18:21:00 +01:00
adam closed this issue 2025-12-29 18:21:00 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jun 24, 2019):

Splitting seems pretty straightforward, but merging would require NetBox to make assumptions it should not be making. For instance, when merging prefix A and B, where each prefix has a different role, description, tags, etc. assigned, which should take precedence? IMO the safe option is to require the user to delete the higher prefix(es) and update the prefix length on the lower prefix.

@jeremystretch commented on GitHub (Jun 24, 2019): Splitting seems pretty straightforward, but merging would require NetBox to make assumptions it should not be making. For instance, when merging prefix A and B, where each prefix has a different role, description, tags, etc. assigned, which should take precedence? IMO the safe option is to require the user to delete the higher prefix(es) and update the prefix length on the lower prefix.
Author
Owner

@jasb89 commented on GitHub (Jun 26, 2019):

A check can be made that the two Sub-nets merged must have the same properties and/or Subnet-mask to be able to merge. Else, it would not allow the operation.
This is very useful when managing high number of dynamically created and deleted environments with the same network properties but different network size.

@jasb89 commented on GitHub (Jun 26, 2019): A check can be made that the two Sub-nets merged must have the same properties and/or Subnet-mask to be able to merge. Else, it would not allow the operation. This is very useful when managing high number of dynamically created and deleted environments with the same network properties but different network size.
Author
Owner

@jeremystretch commented on GitHub (Jun 26, 2019):

Deleting the smaller prefixes and creating a new, larger one in their place is trivial and won't disrupt any related objects.

@jeremystretch commented on GitHub (Jun 26, 2019): Deleting the smaller prefixes and creating a new, larger one in their place is trivial and won't disrupt any related objects.
Author
Owner

@jasb89 commented on GitHub (Jun 28, 2019):

For example: if we have multiple successive free /27 ranges and we need to create a /24. The tool would do the calculation and merge ranges until we have the needed size. Doing this manually is time consuming and prone to error.

@jasb89 commented on GitHub (Jun 28, 2019): For example: if we have multiple successive free /27 ranges and we need to create a /24. The tool would do the calculation and merge ranges until we have the needed size. Doing this manually is time consuming and prone to error.
Author
Owner

@jeremystretch commented on GitHub (Jun 28, 2019):

  1. Bulk-delete all but the first /27 prefix
  2. Change the remaining /27 prefix to a /24

There's no need for anything more complex.

@jeremystretch commented on GitHub (Jun 28, 2019): 1. Bulk-delete all but the first /27 prefix 2. Change the remaining /27 prefix to a /24 There's no need for anything more complex.
Author
Owner

@jeremystretch commented on GitHub (Dec 13, 2019):

Leaving this open if someone wants to volunteer to work on it. Otherwise, it will be closed after a month of inactivity.

@jeremystretch commented on GitHub (Dec 13, 2019): Leaving this open if someone wants to volunteer to work on it. Otherwise, it will be closed after a month of inactivity.
Author
Owner

@stale[bot] commented on GitHub (Dec 27, 2019):

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. Please see our contributing guide.

@stale[bot] commented on GitHub (Dec 27, 2019): 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. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@stale[bot] commented on GitHub (Jan 3, 2020):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@stale[bot] commented on GitHub (Jan 3, 2020): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2664