1

I have a Raspberry Pi connected to my laptop (running 13.04 with Gnome) via direct ethernet using these instructions. Normally, the RPi will connect and work just fine. However, if I disconnect the RPi and try to reconnect it before the DHCP lease expires, it won't acquire a new lease, and therefore won't connect properly (no ssh access). I tried using sudo dhclient -r as per here but that has no effect on the file, it does cancel me dhcp lease to the outside internet.

  • ok, new development. The DHCP lease just expired on its own, and the Pi reconnected once I rebooted it. I'd still like to know how to force this, though. – user2461671 Aug 1 '13 at 16:11
0

I know this is a very old post, but I could not easily find a simple answer online for how to release/renew DHCP leases using dnsmasq so I figured I would share for anyone else who needed help on this. I am running on a Raspberry Pi debian_version 10, using it as a remote VPN tunnel, so using DHCP to manage a subnet.

There multiple services that can manage assigning IP addresses through DHCP. The link you references is for dhclient, which is a different DHCP service.

To force DHCP renewed leases, you have to remove old lease and have dnsmasq issue a new one.

To view current leases:

cat /var/lib/misc/dnsmasq.leases

To remove the old lease(s), manually delete the lines for each entry here:

sudo nano /var/lib/misc/dnsmasq.leases

Restarting dnsmasq did not issue new leases on my subnet, perhaps because the devices on the network still saw their lease had not expired. Restarting the Pi after editing the leases file worked for me - new leases were generated after reboot.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for?Browse other questions tagged or ask your own question.