[Dnsmasq-discuss] no reaction on dhcp request

Simon Kelley simon at thekelleys.org.uk
Thu Sep 21 18:22:12 BST 2006


Roman Zimmermann wrote:
> hi!
> 
> I recently ran into a rather disturbing problem issue while trying to
> configure dnsmasq as a dhcp server.
> 
> I have it running as a dns-server for some time now and never had any
> issues. Then i simply set some dhcp-x config variables and tried but it
> simply did nothing when a request came in and I've been unable to
> determine why...
> 
> These are the steps that I took to narrow the cause:
> 
> - I checked the logs - nothing there.
> - I tried another dhcp-server (udhcpd) and it worked fine on the same
> machine
> - I checked whether dnsmasq is listening on the right port
> # netstat -lup | grep bootps
> udp  0  0 *:bootps  *:*  13975/dnsmasq
> 
> - I checked the network communication with tcpdump and it showed only
> the incomming broadcast but no response
> 
> - I used strace (strace dnsmasq -dq) to see if there is something coming
> in when the request arrives. And indeed something happened:
> 
> # dnsmasq -dq
> dnsmasq: started, version 2.31 cachesize 150
> dnsmasq: compile time options: IPv6 GNU-getopt no-ISC-leasefile no-DBus
> no-I18N
> dnsmasq: DHCP, IP range 192.168.0.128 -- 192.168.0.254, lease time 3d
> dnsmasq: using local addresses only for domain zimmermann.local
> dnsmasq: reading /etc/ppp/resolv.conf
> dnsmasq: using nameserver x.x.x.x#53
> dnsmasq: using nameserver x.x.x.x#53
> dnsmasq: using local addresses only for domain zimmermann.local
> dnsmasq: read /etc/hosts - 5 addresses
> 
> [many lines here after start]
> 
> ) = 1 (in [6])
> time(NULL)                              = 1158856108
> stat64("/etc/ppp/resolv.conf", {st_mode=S_IFREG|0644, st_size=52, ...})
> = 0
> recvmsg(6, {msg_name(0)=NULL, msg_iov(1)=[{"\1\1\6\0\f\276\22E\0\0\0\0
> \300\250\0\25\0\0\0\0\0\0\0\0"..., 548}], msg_controllen=24,
> {cmsg_len=24, cmsg_level=SOL_IP, cmsg_type=, ...}, msg_flags=0},
> MSG_PEEK) = 250
> recvmsg(6, {msg_name(16)={sa_family=AF_INET, sin_port=htons(68),
> sin_addr=inet_addr("192.168.0.21")}, msg_iov(1)=[{"\1\1\6\0\f\276\22E\0
> \0\0\0\300\250\0\25\0\0\0\0\0\0\0\0"..., 548}], msg_controllen=24,
> {cmsg_len=24, cmsg_level=SOL_IP, cmsg_type=, ...}, msg_flags=0}, 0) =
> 250
> ioctl(6, SIOCGIFNAME, {ifr_index=2, ifr_name="eth0"}) = 0
> ioctl(6, SIOCGIFADDR, {ifr_name="eth0", ifr_addr={AF_INET,
> inet_addr("192.168.0.127")}}) = 0
> sendto(3, "\24\0\0\0\26\0\5\3\3\0\0\0\0\0\0\0\2@\0\0", 20, 0,
> {sa_family=AF_NETLINK, pid=0, groups=00000000}, 12) = 20
> recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"D\0\0\0\24\0\2\0\3\0\0\0
> \0227\0\0\2\10\200\376\1\0\0\0"..., 400}], msg_controllen=0,
> msg_flags=0}, MSG_PEEK) = 316
> recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"D\0\0\0\24\0\2\0\3\0\0\0
> \0227\0\0\2\10\200\376\1\0\0\0"..., 400}], msg_controllen=0,
> msg_flags=0}, 0) = 316
> recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\3\0\0\0
> \0227\0\0\0\0\0\0\1\0\0\0\10\0"..., 400}], msg_controllen=0,
> msg_flags=0}, MSG_PEEK) = 20
> recvmsg(3, {msg_name(0)=NULL, msg_iov(1)=[{"\24\0\0\0\3\0\2\0\3\0\0\0
> \0227\0\0\0\0\0\0\1\0\0\0\10\0"..., 400}], msg_controllen=0,
> msg_flags=0}, 0) = 20
> select(12, [3 4 5 6 8 11], [], [], NULL <unfinished ...>
> 
> 
> Here is my config (without comments):
> # grep '^[^#].*' /etc/dnsmasq.conf
> domain-needed
> bogus-priv
> resolv-file=/etc/ppp/resolv.conf
> local=/zimmermann.local/
> except-interface=ppp0
> domain=zimmermann.local
> dhcp-range=192.168.0.128,192.168.0.254,72h
> dhcp-lease-max=127
> mx-host=zimmermann.local,mithril.zimmermann.local,50
> mx-target=mithril.zimmermann.local
> localmx
> 
> 
> Now I really don't know what went wrong, but I hope this list is the
> right place to seek help and hopefully find the answer.
> Thanks in advance for any help
> 

Are you using the word "request" to mean any packet from the dhcp
client, or specifically DHCPREQUEST operation, cf DISCOVER, INFORM?

If the client already has a lease, from the other DHCP server, and
attempts to renew it then dnsmasq might ignore that - it won't tread on
the toes of another DHCP server which has already issued a lease.
There's some clues that you client is already configured in the strace
output you sent, but I can't be sure.

Try asking your DHCP client to release any lease it already has and then
 start it again. If that doesn't work, send me a complete tcpdump
(tcpdump -s 0 -w <file>) of the conversation, and I'll try and find out
what's going on.

Cheers,

Simon.





More information about the Dnsmasq-discuss mailing list