TransWikia.com

Client requesting an old address to DHCP server bypassing DHCP reservation

Server Fault Asked by mguima on October 5, 2020

I have a somewhat weird question in my home network. Although this is not a "problem", I thought that this would be an opportunitty for learning.

Subnet:   192.168.43.64
Range:    192.168.43.65 to ...94       (30)

Fixed Addresses:        ...90 to ...94   (5)
  DHCP server (router): ...93

DHCP Range:             ...65 to ...89  (25)  
   17 DHCP reservations ...65 to ...81  (17)
   dynamic DHCP range   ...82 to ...89   (8)

DHCP lease time: 600 minutes.
There are no devices using the dynamic adresses by now.

Last May I downloaded the last-version of Raspbian, booted it in a Raspberry Pi 1 and a "WiPi" dongle. The dongle got the same …74 IP address reserved for it in the DHCP list. I turned the device off a few hours later and never turned on since then.

Now (September), I booted a new RaspberryPi4 with that same SD card. I was expecting that the new device would get a new IP from the dynamic range …82 to …89. But, for my surprise, the device got the same …74-ended IP that is RESERVED in the DHCP server list for the Wi-Pi dongle (RPi 4 uses its own Wlan interface, with other MAC address).

I think that the reason is that same SDcard was in a system that received the …74-ended address from DHCP server before; after that, even in a completely new system new RPi 4 with new WLAN adapter, the OS "remembers" the previous IP, because of the "wlan0" settings – even with other physical hardware and other MAC address.

Although I can wonder about that reason for the OS requesting the same address, I find it weird that the DHCP "agreed" with the request, because this requested IP was in the reservation list, and because there were free available IP’s in the dynamic range. Shouldn’t honour the reservations, and force an IP from the dynamic range instead of acknowledging the request?

DHCPREQUEST for 192.168.43.74 on wlan0 to 255.255.255.255 port 67
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPACK of 192.168.43.74 from 192.168.43.93
RTNETLINK answers: File exists
bound to 192.168.43.74 -- renewal in 16028 seconds.

I will try to resolve the "issue" just deleting dhclient.leases and see what happens. Before that, I will boot up the old Pi with its dongle just for seeing what the router’s DHCP server will do to solve this mess. I think that the router will be clueless about it and give a dynamic address to the dongle, because the reserved address is in use.

Long story short, my two (and a half) questions are:

1 – Is the "wlan0 hypothesis" right? Did RPi 4 got this IP because the OS in the SD card requested the same address that was leased to its wlan0 a few months ago?

2 – Is the DHCP reservation list just "suggestion", not mandatory? Is it normal that, if a device requests an IP reserved to another device, and provided that this address is free, the DHCP server leases this IP to the requesting device?

2 1/2 – With a Linux-based DHCP server, instead of a cheap-router’s DHCP server, would it be possible to set a DHCP reservation list as mandatory?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP