OpenWrt Forum Archive

Topic: [SOLVED] Weird DHCP issue

The content of this topic has been archived on 26 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I am having problems to assign a static IP address to a certain device in my network; all other devices with a static IP address seem to work properly, but this particular printer seems to be imposing its will to the DNSMASQ server.

This is the relevant part of my "/etc/config/dhcp":

config dnsmasq
    option domainneeded '1'
    option boguspriv '1'
    option localise_queries '1'
    option rebind_protection '1'
    option rebind_localhost '1'
    option local '/intranet/'
    option domain 'intranet'
    option expandhosts '1'
    option readethers '1'
    option leasefile '/tmp/dhcp.leases'
    option resolvfile '/tmp/resolv.conf.auto'
    option localservice '0'
    option dnssec '1'
    option dnsseccheckunsigned '0'
    option authoritative '1'
    option filterwin2k '1'

config dhcp 'lan'
    option interface 'lan'
    option start '64'
    option limit '128'
    option leasetime '1d'
    option dhcpv6 'server'
    option ra 'server'

config host
    option name 'impresora'
    option mac '00:15:99:ed:cc:55'
    option ip '192.168.1.192'

When I switch the device on, this is what I see:

Tue Oct 18 22:03:37 2016 daemon.info dnsmasq-dhcp[24758]: 5830 available DHCP range: 192.168.1.64 -- 192.168.1.191
Tue Oct 18 22:03:37 2016 daemon.info dnsmasq-dhcp[24758]: 5830 vendor class: SAMSUNG Network Printer
Tue Oct 18 22:03:37 2016 daemon.info dnsmasq-dhcp[24758]: 5830 client provides name: IMPRESORA
Tue Oct 18 22:03:37 2016 daemon.info dnsmasq-dhcp[24758]: 5830 DHCPREQUEST(br-lan) 192.168.1.149 00:15:99:ed:cc:55 
Tue Oct 18 22:03:37 2016 daemon.info dnsmasq-dhcp[24758]: 5830 DHCPNAK(br-lan) 192.168.1.149 00:15:99:ed:cc:55 static lease available
Tue Oct 18 22:03:37 2016 daemon.info dnsmasq-dhcp[24758]: 5830 broadcast response
Tue Oct 18 22:03:37 2016 daemon.info dnsmasq-dhcp[24758]: 5830 sent size:  1 option: 53 message-type  6
Tue Oct 18 22:03:37 2016 daemon.info dnsmasq-dhcp[24758]: 5830 sent size:  4 option: 54 server-identifier  192.168.1.254
Tue Oct 18 22:03:37 2016 daemon.info dnsmasq-dhcp[24758]: 5830 sent size: 22 option: 56 message  73:74:61:74:69:63:20:6c:65:61:73:65:20:61...

Looks like the device asks for a certain IP address (DHCPREQUEST(br-lan) 192.168.1.149 00:15:99:ed:cc:55), and the router denies such request because there is a fixed IP address assigned (DHCPNAK(br-lan) 192.168.1.149 00:15:99:ed:cc:55 static lease available). However, immediately after that come these messages:

Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 available DHCP range: 192.168.1.64 -- 192.168.1.191
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 vendor class: SAMSUNG Network Printer
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 client provides name: IMPRESORA
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 DHCPREQUEST(br-lan) 192.168.1.149 00:15:99:ed:cc:55 
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 tags: lan, br-lan
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 DHCPACK(br-lan) 192.168.1.149 00:15:99:ed:cc:55 IMPRESORA
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 requested options: 1:netmask, 3:router, 6:dns-server, 7:log-server, 
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 requested options: 12:hostname, 15:domain-name, 18:extension-path, 
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 requested options: 23:default-ttl, 26:mtu, 44:netbios-ns, 46:netbios-nodetype, 
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 requested options: 51:lease-time, 54:server-identifier, 58:T1, 
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 requested options: 59:T2, 78, 79
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 next server: 192.168.1.254
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 broadcast response
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  1 option: 53 message-type  5
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  4 option: 54 server-identifier  192.168.1.254
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  4 option: 51 lease-time  1d
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  4 option: 58 T1  12h
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  4 option: 59 T2  21h
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  4 option:  1 netmask  255.255.255.0
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  4 option: 28 broadcast  192.168.1.255
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  4 option:  3 router  192.168.1.254
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  4 option:  6 dns-server  192.168.1.254
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  8 option: 15 domain-name  intranet
Tue Oct 18 22:03:41 2016 daemon.info dnsmasq-dhcp[24758]: 5451 sent size:  9 option: 12 hostname  IMPRESORA

Looks like the device tries again (DHCPREQUEST(br-lan) 192.168.1.149 00:15:99:ed:cc:55) and the router simply accepts the request (DHCPACK(br-lan) 192.168.1.149 00:15:99:ed:cc:55 IMPRESORA).

Has anybody any idea why this might be happening, please?
Many thanks!

(Last edited by eduperez on 19 Oct 2016, 22:16)

Its possible device once got random IP address from the pool and re-requesting it again.
Remove /tmp/dhcp.leases and restart dnsmasq, then switch off and on device.

(Last edited by bolvan on 18 Oct 2016, 21:40)

bolvan wrote:

Its possible device once got random IP address from the pool and re-requesting it again.
Remove /tmp/dhcp.leases and restart dnsmasq, then switch off and on device.

Yes, that is my impression too; but I do not understand why DNSMASQ bends over and accepts that request. I tried what you suggested, but the device is still obtaining the old address.

So that guy insist on 149 address. What if you set ip range so that 149 is not there ? For example, from 10 limit 117 - it will be from 10 to 127

Well, after many experiments with different values, after deleting all temporary files several times, after trying to do the same with other devices, ... rebooting the router did the trick. Many thanks!

The discussion might have continued from here.