[Dnsmasq-discuss] uDHCP Client, dnsmasq doe snot broadcast DCHP Reply, Assumes IP Address In Request

Grant Traynor grant.traynor at switchdin.com
Wed Apr 19 00:38:02 BST 2017


I'm having an issue with the DHCP Server in dnsmasq. I'm using it with
NetworkManager to support sharing of internet connections between
dynamically plugged Ethernet interfaces (USB Ethernet Adaptors hotplugged /
unplugged into a RaspberryPi).

NetworkManager sets up dnsmasq to serve on the interface when it's plugged
in. It runs multiple dnsmasq instances, one for each interface as it comes
and goes. dnsmasq is being run by NetworkManager as follows:

/usr/sbin/dnsmasq --conf-file --no-hosts --keep-in-foreground
--bind-interfaces --except-interface=lo --clear-on-reload --strict-order
--listen-address= --dhcp-range=,,60m
--dhcp-option=option:router, --dhcp-lease-max=50

​This all seems to work fine on the FIRST time a DHCP address is offered.
But when the raspberrypi is rebooted, or ethernet devices are enabled and
disabled, the subnet for each interface can change. This doesn't seem to be
an issue until a client attempts to renew it's IP address. The client makes
a DHCP request to the server using the TCP broadcast address as expected.​

23:26:56.002026 00:03:ac:0c:92:f9 (oui Unknown) > Broadcast, ethertype IPv4
(0x0800), length 351: (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto
UDP (17), length 337)
    * >*: BOOTP/DHCP, Request from
00:03:ac:0c:92:f9 (oui Unknown), length 309, xid 0x6ec92a2c, secs 12263,
Flags [none]
          Client-Ethernet-Address 00:03:ac:0c:92:f9 (oui Unknown)
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Discover
            Client-ID Option 61, length 7: ether 00:03:ac:0c:92:f9
            Requested-IP Option 50, length 4:
            MSZ Option 57, length 2: 576
            Parameter-Request Option 55, length 7:
              Subnet-Mask, Default-Gateway, Domain-Name-Server, Hostname
              Domain-Name, BR, NTP
            Vendor-Class Option 60, length 12: "udhcp 1.22.1"
            Hostname Option 12, length 21: "

​But dnsmasq appears to generate a response to the requested IP,
effectively assuming that the client is listening on that address, which
doesn't necessarily seem to be the case.​

23:26:56.002780 00:e0:4c:68:01:e4 (oui Unknown) > 00:03:ac:0c:92:f9 (oui
Unknown), ethertype IPv4 (0x0800), length 342: (tos 0xc0, ttl 64, id 38232,
offset 0, flags [none], proto UDP (17), length 328) > BOOTP/DHCP, Reply, length 300,
xid 0x6ec92a2c, secs 12263, Flags [none]
          Client-Ethernet-Address 00:03:ac:0c:92:f9 (oui Unknown)
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Offer
            Server-ID Option 54, length 4:
            Lease-Time Option 51, length 4: 3600
            RN Option 58, length 4: 1800
            RB Option 59, length 4: 3150
            Subnet-Mask Option 1, length 4:
            BR Option 28, length 4:
            Domain-Name-Server Option 6, length 4:
            Default-Gateway Option 3, length 4:

Should the response not go back to or some other broadcast
address? It appears as though the uDHCP client of TCP stack on the client
is ignoring the response as it does not assume that it's requested IP
address has in fact been allocated to it?

I'm a relative NOOB on this stuff, so I'd appreciate any guidance anyone
can offer.

Kind Regards,

Grant Traynor
Chief Technology Officer
SwitchDin Pty Ltd
Mob +61.428408558
grant.traynor at switchdin.com
http://www.switchdin.com/ <http://switchd.in/>

Level 2, Building B, 91 Parry Street, Newcastle West, NSW, 2302

This email and any attachments are proprietary and confidential and are
intended solely for the use of the individual to whom it is addressed. Any
views or opinions expressed are solely those of the author and do not
necessarily reflect or represent those of SwitchDin Pty Ltd. If you have
received this email in error, please let us know immediately by reply email
and delete it from your system. You may not use, disseminate, distribute or
copy this message nor disclose its contents to anyone.
SwitchDin Pty Ltd (ABN 29 154893857) PO Box 1165, Newcastle NSW 2300
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20170419/ffc90515/attachment.html>

More information about the Dnsmasq-discuss mailing list