[Dnsmasq-discuss] Cannot setup DHCP

Roy Marples uberlord@gentoo.org
Wed, 01 Dec 2004 16:57:27 +0000


--=-6Ph9bE1j10canOe9Hry4
Content-Type: text/plain; charset=iso-8859-5
Content-Transfer-Encoding: quoted-printable

On Wed, 2004-12-01 at 16:39 +0000, Simon Kelley wrote:
> =B8=DB=EC=EF =B5=D2=E1=D5=D5=D2 wrote:
> >    Hi, folks!
> > I have dnsmasq-2.18 on my linux box with 2 network intefaces:
> > eth0 =3D 192.168.0.10/24 and eth1 =3D public IP.
> > /etc/dnsmasq.conf is like following
> > (I skip comments, blank lines and default values):
> >     bind-interfaces
> >     interface lo
> >     interface eth0
> >     expand-hosts
> >     dhcp-range=3D192.168.0.50,192.168.0.150,12h
> >     read-ethers  # really exists and accepted by dnsmasq
> >     dhcp-option=3D42,0.0.0.0  # NTP server =3D dnsmasq host
> >=20
> > Dnsmasq starts and acts as DNS-service successfully,
> > also listens on UDP port 67, _but_! does nothing
> > as DHCP-service: "dhcpcd -T eth0" sleeps until timeout.
> > Periodically dnsmasq puts to syslog following message:
> > "dnsmasq: no address range available for DHCP request via eth0".
> >=20
> > I don't understand this error, because 192.168.0.50-150
> > is completely owned by 192.168.0.10/24.
> > Well, can somebody explain me: what's wrong here?
> >=20
> > WBR, Ilya
> >=20
>=20
> Carefully check the configuration of eth0, both the netmask and=20
> broadcast address. Dnsmasq uses that information when looking for a=20
> valid DHCP range, and if (for instance) you had set the netmask to=20
> 255.255.255.128, then you would see the behaviour you are describing.
>=20
> It's possible to override the netmask and broadcast addresses by=20
> including them in the dhcp-range, like so:
>=20
> dhcp-range=3D192.168.0.50,192.168.0.150,255.255.255.0,192.168.0.255,12h
>=20
> Are you using a DHCP relay? If so then including the netmask in the=20
> dhcp-range is mandatory for networks connected via the DHCP relay.
>=20
> Cheers,
>=20
> Simon.
>=20

I've seen this behaviour too with dhcpcd, but cannot get to the bottom
of it. I think it's dhcpcd's fault

If an entry exists for the host in dnsmasq.leases, then dhcpcd gets it's
address just fine and everything is dandy. If there is not an entry,
then dhcpcd times out - but still gets its information and an entry
appears in dnsmasq.leases

Other dhcp clients (dhclient, pump, udhcpc) do not have this problem
with dnsmasq. I was hoping to test dhcpcd against another dhcp server
before reporting this myself though.

HTH

--=20
Roy Marples <uberlord@gentoo.org>
Gentoo Linux Developer

--=-6Ph9bE1j10canOe9Hry4
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD8DBQBBrff2MfrAiBQZ0f4RAm5EAJ9Oidk8bGoh1zSREn9FWmrConaF4wCfTtqm
WtfYWURGJAyNnmv8He8tVcI=
=zulE
-----END PGP SIGNATURE-----

--=-6Ph9bE1j10canOe9Hry4--