[Dnsmasq-discuss] Simple dnsmasq configuration as DHCP server issue
Simon Kelley
simon at thekelleys.org.uk
Fri Nov 16 15:06:58 GMT 2012
On 16/11/12 15:00, Tomas Hozza wrote:
> Hello.
>
> I'm having some problems with configuring dnsmasq as a DHCP server.
>
> Interface configuration with DHCP off and static IP address:
> [root at localhost ~]# ifconfig
> eth0: flags=4163MULTICAST> mtu 1500
> inet 192.168.222.2 netmask 255.255.255.0 broadcast 192.168.222.255
> inet6 fe80::5054:ff:fe37:d318 prefixlen 64 scopeid 0x20
> ether 52:54:00:37:d3:18 txqueuelen 1000 (Ethernet)
> RX packets 626 bytes 158950 (155.2 KiB)
> RX errors 0 dropped 0 overruns 0 frame 0
> TX packets 1478 bytes 285104 (278.4 KiB)
> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
> device interrupt 11 base 0xe000
>
> dnsmasq command:
> [root at localhost ~]# /sbin/dnsmasq -d --strict-order --bind-dynamic --domain-needed --conf-file= --listen-address 192.168.222.2 --dhcp-range 192.168.222.10,192.168.222.254 --dhcp-leasefile=net.leases --dhcp-lease-max=243 --dhcp-no-override
> dnsmasq: started, version 2.63rc6 cachesize 150
> dnsmasq: compile time options: IPv6 GNU-getopt DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
> dnsmasq-dhcp: DHCP, IP range 192.168.222.10 -- 192.168.222.254, lease time 1h
> dnsmasq: reading /etc/resolv.conf
> dnsmasq: using nameserver 192.168.122.1#53
> dnsmasq: read /etc/hosts - 2 addresses
>
> [root at localhost ~]# netstat -anp | grep dnsmasq
> tcp 0 0 192.168.222.2:53 0.0.0.0:* LISTEN 4919/dnsmasq
> udp 0 0 192.168.222.2:53 0.0.0.0:* 4919/dnsmasq
> udp 0 0 0.0.0.0:67 0.0.0.0:* 4919/dnsmasq
>
> [root at localhost ~]# tcpdump -vv -i eth0
> tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
> 14:44:36.731716 IP (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
> 0.0.0.0.bootpc > 192.168.222.2.bootps: [udp sum ok] BOOTP/DHCP, Request from 52:54:00:c6:c4:0d (oui Unknown), length 300, xid 0x2425bc3e, secs 57, Flags [none] (0x0000)
> Client-Ethernet-Address 52:54:00:c6:c4:0d (oui Unknown)
> Vendor-rfc1048 Extensions
> Magic Cookie 0x63825363
> DHCP-Message Option 53, length 1: Discover
> Parameter-Request Option 55, length 13:
> Subnet-Mask, BR, Time-Zone, Classless-Static-Route
> Domain-Name, Domain-Name-Server, Hostname, YD
> YS, NTP, MTU, Option 119
> Default-Gateway
>
> As you can see, there are incoming DHCP Requests,
> but dnsmasq doesn't answer them and the client is
> unable to get IP address.
>
> There is another colleague having the same problem,
> and he verified, that when he replace dnsmasq with
> dhcpd the client got an IP address. Therefore it seems
> like dnsmasq issue.
>
> Can anyone please help us with this issue?
>
The first thing I worry about whenever anyone tells me that dnsmasq
ignores DHCP requests but ISC dhcpd works, is firewall/iptables rules.
You have to ensure that source address 0.0.0.0 and/or destination
address 255.255.255.255 are not intercepted. This will not affect dhcpd,
but it does affect dnsmasq.
You configuration looks fine on a casual inspection.
Cheers,
Simon.
More information about the Dnsmasq-discuss
mailing list