0

So, devices using DHCP to locally connect to my router can have their LAN IP addresses changed if not set to static, and my understanding is that DHCP occasionally re-allocates these addresses by itself. However, I haven't been able to find a way to induce this shuffling, which I want to do in order to test a device. Is there a way to emulate this network-wide reshuffling (or even just limited to single device)?

Thanks.

4 Answers 4

1

Assuming you have an "off-the-shelf" home router rather then something serious which allows you a lot of control of the DHCP server, you should be able to find the range of IP's allocated in the router - usually this will be a small subset of the available IP's available for the subnet. You should be able to change this subset, save, restart everything as required. (For example if the range is 192.168.1.100-200 you might want to change it to 192.168.1.50-99)

1
  • Another thing you can occassionally do - for a single device - is change its MAC address - DHCP lookups are generally tied to MAC address, so by changing that you will encourage the provision of a new address - that said, changing a MAC address is not always trivial (depends on the device and OS - Under Linux it IS trivial.)
    – davidgo
    Jul 23, 2016 at 3:44
0

You can delete the DHCP Leases in your DHCP Server. The devices in your LAN will get new addresses.

1
  • 1
    most DHCP clients will request to be allocated the same address that they had last time, so this likely will not result in a new address being assigned. Unless the address becomes unavailable to the DHCP server to allocate (gets excluded from the pool, or reserved, or assigned to another client) then it will probably just honour the client's request and give it the address it asked for.
    – Adrien
    Jul 22, 2016 at 21:52
0

As you mentioned a router, if a (long) power off does not clear the DHCP Lease Table probably a reset of the device would (which I would not do - as you will have to setup from scratch).

Another way to get a new DHCP address would be to reserve the IP of the device you want to test with a non-existent MAC address.

You could also check if you can set the lease time on your router in the DHCP settings and shorten it to a time short enough for your testing.

Be aware that a device will probably ask for the same IP it got before (default client behaviour) so you could up ending with reservations again.

If you are able to change the MAC address of the device this could also induce getting a different IP.

Also, you could setup a LAN DHCP server and disable the functionality on your router. That way you would have more control over the DHCP.(long)

0

If you want to get your DHCP server to assign the client another IP, the most reliable way would be to set up a reservation for that client MAC, assigning the new address, and change it each time you want to test.

Depending on the client, you'd need to release and renew the lease, on windows that's a simple matter of ipconfig /release and ipconfig /renew.

Keep in mind that a reservation sets the lease duration to infinite. Having said that, many DHCP clients will still periodically renew the lease, and even stop using it if they fail to renew.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .