How to force client static leases (IP addresses) to update/change immediately?

2

1

My router runs dd-wrt and it assigns static leases to DHCP clients. The clients all use DHCP.

I recently changed the IP addresses I want assigned to clients. But the clients are not updating automatically. All clients are linux. Using "dhclient -r" doesn't seem to make any difference -- the client keeps the old address (unless I reboot it and the router).

I've had this same issue in the past with other routers (such as Netgear). I used to think it was purely a problem with Netgear's firmware, but now I believe I just don't know the the correct procedure or the rules by which IP addresses are updated when static leases are changed in the router. I'm seeking some explanations.

I have figured out that if I turn every off (including the router and all clients) and then boot the rotuer followed by the clients, everything will get the correct IP address. So I know how to resolve the situation. But short of that, the addresses don't seem to change, even if I wait long enough for the leases to expire. It seems like as long as a device remains connected to the router, its IP address will not change once it was assigned.

I've seen this behavior in different situations (mostly with the Netgear routers). It doesn't seem to matter if the IP was originally assigned dynamically or statically (DHCP static lease). It doesn't update while everything is still running.

Basically, I find it a real pain to have to shut off every client on my network to get IP addresses to update to a new scheme. Anyone have insights into this. I hope that if I understand it better, I'll find a more convenient way to deal with it.

(This issue is minor, but it has been bugging me for years. This time, rather than deal with it the same old way, I want to learn something new.)

MountainX

Posted 2012-03-09T00:29:51.187

Reputation: 1 735

Answers

1

It sounds like your DHCP server doesn't consider itself authoritative for the network segment it is on and is therefore not sending DHCPNAKs, which would instruct the clients to drop their old leases and go into the init state. Assuming you don't have two DHCP servers on the same segment, configure dd-wrt to be authoritative and the leases should start being dropped.

Kyle Jones

Posted 2012-03-09T00:29:51.187

Reputation: 5 706

"DHCP-Authoritative" was unchecked. However, to enable it I have to enable some DNSmasq options that I don't understand. Looks like I need to do some more research. (BTW, I only have one router.) – MountainX – 2012-03-09T01:52:36.140

1

I found a few answers online that stated that you had to manually delete DHCP clients if they've already been connected. http://www.dslreports.com/forum/r19261599-DD-WRT-Unable-to-set-static-ip-address-wotj-DD-WRT-firmware

Although that didn't work, it made me try unplugging and reconnecting the router to make all leases go away and force clients to ask for new ones. That happened to work for me.

1mike12

Posted 2012-03-09T00:29:51.187

Reputation: 111

1

I had this annoying problem for quite some time when i change devices and had to update the mac address on the static lease.

Rebooting the router always worked , but its not the most elegant solution.

What did the trick for me was going to the DHCP clients and delete the 2 related static leases :

enter image description here

This seem to cause the DHCP server to "forget" the old static lease and when the new client reboot/request ip address it gets the correct one.

Hagay Goshen

Posted 2012-03-09T00:29:51.187

Reputation: 111