Enable (IPv6) Subnet Allocation with AddressScope/SubnetPool
What would you like to see implemented?
Hey,
we'd like to manage Subnets wih korc, but we have a requirement on IPv6. To uniquely allocate IPv6 prefixes we use Address Scopes and delegate SubnetPools to our tenants.
You can think of the AddresScope as the global routing table. SubnetPools on the other hand holds one or more unique subnets. They are linked to an Address Scope and thus cannot overlap. On the subnet creation you can provide a SubnetPool, which will then be used to allocate the subnet. The network will then also have a reference to the AdressScope for the appropriate IP family.
This enables us to ensure that nobody can "steal" any GUA prefixes we own. Only if the address scope ID on the network is set, the subnet will be advertised externally.
Adding it to the SubnetResourceSpec and making cidr optional would be amazing.
resource:
cidr: <optional - can be set to allocate specific subnet>
subnetPool:
prefixLength: <default: 64 for IPv6 and 26 for IPv4 - optional>
name: <Name or ID - required>
# This would be the equivalent OpenStack CLI flags
openstack subnet create <name> \
--prefix-length <optional - prefixLength> \
--subnet-pool <Name or ID> \
--subnet-range <optional - CIDR>
Additional information
- https://docs.openstack.org/neutron/latest/admin/config-address-scopes.html
- https://docs.openstack.org/neutron/latest/admin/config-subnet-pools.html
- https://docs.openstack.org/api-ref/network/v2/index.html#show-subnet-pool
- https://pkg.go.dev/github.com/gophercloud/gophercloud/[email protected]/openstack/networking/v2/subnets#CreateOpts
- https://pkg.go.dev/github.com/gophercloud/gophercloud/v2/openstack/networking/v2/extensions/subnetpools
Link to reference documentation
No response