Off-Topic > Off-Topic - Tiny Core Lounge

dnsmasq's DHCP server not exerting enough control over leases

<< < (2/2)

Rich:
Hi GNUser

--- Quote from: GNUser on December 27, 2019, 08:22:06 PM --- ... I thought that if a device is connected and its lease expires, then DHCP server would renegotiate a lease (preferably one for the same IP address).  ...
--- End quote ---
The fact that the laptop gets suspended may be coming into play. The DHCP server can't renegotiate a lease with a laptop that
won't answer.

GNUser:
Rich, I think you're absolutely right. The server probably does attempt to renegotiate a lease, but the attempt fails if laptop happens to be suspended at the time.

I created a shell script to run when her laptop resumes from suspend, /etc/pm/sleep.d/dhcp-renegotiate


--- Code: ---#!/bin/sh

if [ "$1" = "resume" ]; then
    dhclient -r
    dhclient wlan0
fi
--- End code ---

This seems to do the trick.

(I'm still alarmed that my router does not force a renegotiation when it detects a device with no lease or expired lease, but I'll let that go for now.)

Thanks, Rich!

hiro:
you're thinking of it the wrong way around.
the *client* has to renegotiate, not the server.
also, the *client* has to check if some given IP is already taken, regardless what the server says.
this is not a safety feature, it is assumed the clients will behave.

GNUser:
Thanks, hiro. That's very helpful.

It seems the client makes most of the decisions, server mainly provides information that the client requests. I thought it worked the other way around, no wonder I was surprised.

Navigation

[0] Message Index

[*] Previous page

Go to full version