We're using dhcp server on windows server 2019, configured to assign addresses, based on option 82, suboption 5 (link selection).
When client doesn't have any previously assigned addresses everything works well, but if client has an address (or had it in the past) - there are some problems.
Looks like, when dhcp server receives request with option 50 (requested address) set, it prefer to assign address specified by client regardless of value of the link selection suboption.
Here are some scenarios:
1. Client got an address and then moved to another location (another subnet). dhcp server renews existing lease instead of issuing new address fron new subnet (from another scope). Client loses it's network connectivity, because its network parameters are wrong for new subnet.
We have preconfigured images for virtual machines. When we had preparing them, they had an IP address, but since then correspondin lease was expired and it was removed from dhcp server database. When virtual machine deploys in subnet, different that one, where image was prepared, dhcp client also send option 50 with that old IP address. Dhcp server issues lease for that address, and again VM gets wrong network parameters from wrong scope and doesn't get network connectivity.
2'. But when old IP is taken by another client, dhcp server issues lease from correct scope.
This completely vioaltes rfc 3527:
When the DHCP server is allocating an address and this sub-option is present, then the DHCP server MUST allocate the address on either:
- the subnet specified in the link-selection sub-option, or;
- a subnet on the same link (also known as a network segment) as the subnet specified by the link-selection sub-option
Dhcp server does not allocate address on subnet or segment, specified in link-selection sub-option.
How to make dhcp server honor link selection option?
I'm attaching screenshots of dhcp request/reply and scopes config
client on subnet 10.81.25.0/24 specifies requested address 10.81.19.52
dhcp ACKs adress 10.81.19.52, ignoring subnet in link-selection suboption