Le 15/01/2025 à 18:12, Geert Stappers a écrit :
On Wed, Jan 15, 2025 at 04:28:53PM +0100, Nicolas Granger wrote:
Le 15/01/2025 à 13:54, john doe via Dnsmasq-discuss a écrit :
On 1/15/25 11:50, GRANGER Nicolas wrote:
Hi all,


I am unable to get dnsmasq to issue ip addresses to known hosts
only. Upon DHCPDISCOVER it fails with no address available.


The network interface is called lan with ip address 192.168.2.254/24


$ sudo dnsmasq -d --bind-interfaces -i lan --except-interface=lo \
   --dhcp-range=192.168.2.0,static,255.255.255.0 \
   --dhcp-host=ac:1f:xx:xx:xx:xx,192.168.2.19

for a simple /24, I don't specify a netmask!

Are you sure that the client is sending the mac address that you are
expecting?

What version of Dnsmasq are you using?

The version is 2.90 and the mac address is correct.

With a regular dhcp-range, dnsmasq pulls an ip from the range, not the one
of the host.

$ sudo dnsmasq -d --bind-interfaces -i lan --except-interface=lo \
   --dhcp-range=192.168.2.100,192.168.2.150,255.255.255.0 \
   --dhcp-host=ac:1f:xx:xx:xx:xx,192.168.2.19
dnsmasq: started, version 2.90 cachesize 150
dnsmasq: compile time options: IPv6 GNU-getopt DBus no-UBus i18n IDN2 DHCP
DHCPv6 no-Lua TFTP conntrack ipset nftset auth cryptohash DNSSEC loop-detect
inotify dumpfile
dnsmasq-dhcp: DHCP, static leases only on 192.168.2.0, lease time 1h
dnsmasq-dhcp: DHCP, IP range 192.168.2.100 -- 192.168.2.150, lease time 1h
dnsmasq-dhcp: DHCP, sockets bound exclusively to interface lan
dnsmasq: reading /etc/resolv.conf
dnsmasq: using nameserver 127.0.0.53#53
dnsmasq: read /etc/hosts - 8 names
dnsmasq-dhcp: DHCPDISCOVER(lan) 192.168.2.56 ac:1f:xx:xx:xx:xx
dnsmasq-dhcp: DHCPOFFER(lan) 192.168.2.101 ac:1f:xx:xx:xx:xx
dnsmasq-dhcp: DHCPREQUEST(lan) 192.168.2.101 ac:1f:xx:xx:xx:xx
dnsmasq-dhcp: DHCPACK(lan) 192.168.2.101 ac:1f:xx:xx:xx:xx node19

And what can be seen on the wire?



Groeten
Geert Stappers

The long lease time by default misled me to think the renewal
failed. It eventually switches to the desired address at the end of the
lease:

DHCPREQUEST(lan) 192.168.2.19ac:1f:xx:xx:xx:xx
DHCPNAK(lan) 192.168.2.19ac:1f:xx:xx:xx:xx address not available
DHCPREQUEST(lan) 192.168.2.19ac:1f:xx:xx:xx:xx
DHCPNAK(lan) 192.168.2.19ac:1f:xx:xx:xx:xx address not available
DHCPDISCOVER(lan) 192.168.2.19ac:1f:xx:xx:xx:xx
DHCPOFFER(lan) 192.168.2.1ac:1f:xx:xx:xx:xx
DHCPREQUEST(lan) 192.168.2.1ac:1f:xx:xx:xx:xx
DHCPACK(lan) 192.168.2.1ac:1f:xx:xx:xx:xx node19

Thanks for the help.


_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to