[Dnsmasq-discuss] DHCP: can't asssign a fixed IP to a MAC address

Mircea Bardac (IceRAM) dev.list@mircea.bardac.net
Thu, 30 Dec 2004 18:07:00 +0200


--nextPart23011096.D2ELIZV4kt
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

I know this sounds really strange, or newbie-ish, but I really can't do thi=
s.=20
There must be something I'm missing here.

Here's my situation:
I've got some computer, each one with its MAC address. I want dnsmasq to=20
assign an IP and a name to each one, based on their MAC.

I fist want to get my computer to work properly.. and then I'll make the=20
others work too. Therefore, my goal is to get computer "aquarius" to have
IP:   192.168.0.2
name: aquarius.home.bardac.net.

=2D- /etc/dnsmasq.conf.my (included in /etc/dnsmasq.conf) --
# My Network Configuration

domain-needed
bogus-priv

resolv-file=3D/etc/resolv.dnsmasq
strict-order
no-poll

except-interface=3Deth0
bind-interfaces

#no-hosts
expand-hosts
domain=3Dhome.bardac.net

dhcp-range=3D192.168.0.10,192.168.0.20,2h
dhcp-host=3D00:0F:B0:05:43:DE,doru,192.168.0.4,infinite
dhcp-host=3D00:0F:EA:3E:F7:3C,aquarius,192.168.0.2,infinite

#dhcp-host=3Djudge
=2D--end---

=2D-- /etc/hosts ---
#<ip-address>   <hostname.domain.org>   <hostname>
127.0.0.1               localhost.localdomain   localhost
192.168.0.1             server.home.bardac.net  server
#192.168.0.2            aquarius.home.bardac.net        aquarius
#192.168.0.3            graphicstation.home.bardac.net  graphicstation
#192.168.0.4            doru.home.bardac.net    doru
=2D--end---

with these configs I get:
# dhcpcd -d
dhcpcd: MAC address =3D 00:0f:ea:3e:f7:3c
dhcpcd: your IP address =3D 192.168.0.14

Naming seems to work, but I find no way of making it use 192.168.0.2

This is the syslog output when aquarius asks for an IP (with the settings f=
rom=20
above):
server dnsmasq[2296]: DHCPDISCOVER(eth1) 00:0f:ea:3e:f7:3c
server dnsmasq[2296]: DHCPOFFER(eth1) 192.168.0.14 00:0f:ea:3e:f7:3c
server dnsmasq[2296]: DHCPREQUEST(eth1) 192.168.0.14 00:0f:ea:3e:f7:3c
server dnsmasq[2296]: DHCPACK(eth1) 192.168.0.14 00:0f:ea:3e:f7:3c aquarius

=2D--------------------------

I've also tried using "dhcp-host=3Djudge" with the following changes in the=
=20
above files:
1. uncomment "dhcp-host=3Djudge"
2. comment all the lines except dhcp-range=3D... (I don't want to be left=20
outside if it doesn't work)
3. uncomment the aquarius line in /etc/hosts
Restart dnsmasq.
on aquarius:
dhcpcd -k
dhcpcd -d
(this time, the same .14 IP assigned, but naming doesn't work).

I hope anyone can see the wrong thing I'm doing there.
I would definitely provide mode debug output, but I can't make dnsmasq give=
=20
more.

Thanks a lot.

Happy New Year everybody.

Mircea
/IceRAM

--nextPart23011096.D2ELIZV4kt
Content-Type: application/pgp-signature

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

iD8DBQBB1Cen7CQm41EQ51oRAkTHAJ9WByo0P2ArU/DRd7i884mQj/yoAQCeKUhH
hLEntKagYNqZ9rCkzHyDsp8=
=kQbk
-----END PGP SIGNATURE-----

--nextPart23011096.D2ELIZV4kt--