Score:1

Windows DHCP Server does not give correct IP

in flag

I have a Windows DHCP Server with many scopes, each one related with a VLAN, and I have a PC connected to a switchport. Then, I am changing the access VLAN on this switchport to see if the PC receives the IP address belonging to such VLAN, but the client always receives the same IP address regardless of the VLAN configured on the switchport. I have configured the DHCP relay on my firewall, and this part is working fine. Now when I change the switchport to a new VLAN, and when I do a tcpdump and see the trace, I can see the client is requesting the old IP address 172.22.2.4 (old VLAN), and the DHCP server gives this old IP address, ignoring the "Relay agent IP address" field (172.22.9.1) that the firewall is inserting in the DHCP request packet. Not sure why the PC requests the old IP after doing a ipconfig /release and ipconfig /renew. But to my understanding, I think the DHCP server should give an IP address within the 172.22.9.0/24 scope, since the Relay agent IP address is 172.22.9.1, regardless which IP the PC is asking for.

The Relay IP Address and the subnet masks of the server’s configured scopes are compared through a logical AND comparison to find a scope whose network ID matches the network ID of the Relay IP Address. When a match is found, the DHCP server allocates an IP address from that scope.

https://www.itgeared.com/dhcp-relay-agent/

The only weird thing I can see is the firewall is not inserting the "Relay agent IP address" in the GIADDR field or DHCP option 82, just in the main DHCP field, although this may be correct. Any ideas?

Attached the DHCP request and DHCP reply traces.

DCHP request

DHCP reply

Regards, Julián

paladin avatar
id flag
A Windows DHCP client tries in its default settings to get the same IP address from the DHCP server, `ipconfig /release` and `ipconfig /renew` doesn't change that. You should deny such requests from such DHCP clients and override with server settings.
Score:1
in flag

If someone interested, the problem is the DHCP server had configured a superscope:

Stop DHCP client from receiving old IP address on new VLAN

Once I deleted the superscope the service works fine.

Regards, Julián

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.