phpipam / phpipam

phpipam development repository
https://phpipam.net
2.21k stars 731 forks source link

Merging subnets into a supernet #2358

Open brick78 opened 5 years ago

brick78 commented 5 years ago

Once a subnet (let's say a /24) has been split into smaller subnets (e.g. multiple /28) it doesn't seem to be possible to expand some /28 subnets into a larger subnet still within the parent /24. Or merge all of the smaller subnets back into a /24.

For example: 10.0.0.0/24 is split into multiple subnets creating 10.0.0.0/28, 10.0.0.16/28, 10.0.0.32/28, etc. If the first two /28 subnets then need to be merged to create 10.0.0.0/27 it does not seem possible without first deleting 10.0.0.16/28 (which includes all IP assignments within it) before expanding 10.0.0.0/28.

Similarly, if all subnets within 10.0.0.0/24 then need to be merged back into the single /24 subnet again the only way to do this seems to be to delete all subnets and IPs within the parent.

Am I missing the way to do this or is the functionality simply not present?

zombah commented 5 years ago

It is possible with recompute function inside settings import/export. So you import supernet and start recompute, it will nest more specific subnets inside this supernet.