Check global host reservation address feasibility
Check global host reservation address feasibility
Currently the handling of global host reservations in Kea does not take into account the feasibility of the reserved IP address on the selected subnet when allocating an address (i.e. the reserved address may be outside of the subnet which leaves the client in an unusable state). Additionally, the subnet selection process within a shared-network may associate a lease with an incorrect subnet in that shared-network, which may result in incorrect options being passed to the client (e.g. routers
).
Kea should only hand out feasible addresses to clients and correctly match leases to subnets for global reservations with IP addresses. In the event that a global address reservation is not feasible for any subnet within a shared-network, the client should be allocated a lease out of a dynamic pool while preserving other options within the host reservation (e.g. hostname
). This feature should apply to both IPv4 addresses and IPv6 non-temporary addresses (IA_NA).
Further background may be found in ISC ticket 21365.
Current Behavior:
- if a host reservation does not have an IP address:
- defer to normal dynamic lease creation
- if a host reservation has an IP address, and the IP address overlaps with any subnet within a shared network:
- create/reuse a lease tied to the first subnet that the client class allows
- if a host reservation has an IP address, and the IP address does not overlap with any subnet in a shared network
- create/reuse a lease tied to a subnet unfit for the IP address
Desired behavior:
- if a host reservation does not have an IP address:
- defer to normal dynamic lease creation
- if a host reservation has an IP address, and the IP address overlaps with any subnet within a shared network:
- create/reuse a lease tied to the matching subnet
- if a host reservation has an IP address, and the IP address does not overlap with any subnet in a shared network
- defer to normal dynamic lease creation