[Dnsmasq-discuss] [Fwd: Re: Dnsmasq and host with 2 network interfaces]
Sun, 12 Dec 2004 18:04:40 +0000
A private conversation which I'm posting to the mailing list with the
permission of all involved for future reference.
-------- Original Message --------
Subject: Re: Dnsmasq and host with 2 network interfaces
Date: Thu, 9 Dec 2004 08:04:07 +0100
From: Clemens Ender <firstname.lastname@example.org>
To: Simon Kelley <email@example.com>
Quoting Simon Kelley <firstname.lastname@example.org>:
> Clemens Ender wrote:
>> I'm trying to setup a dnsmasq for my LAN. It's a very nice piece of
>> software and
>> it works very well, however I'm stuck with a little detail. I have a
>> which has a ethernet- and a wifi-card builtin. Usually I connect to
>> my LAN via
>> the wireless card, but sometimes I wanna connect it via the ethernet
>> card. Is
>> it possible to have the IP and/or hostname "follow" the notebook.
>> Thanks for your help in advance!
>> Clemens Ender
> It should be possible: the key is something called a "client-id" which
> is what the DHCP server uses to identify a machine.
> Normally the client-id set to be the same as the MAC address by the DHCP
> client, or not set at all, in which case the DHCP server falls back to
> using the MAC address. This gives the familiar effect where an DHCP
> lease and IP get bound to the MAC address.
> Most DHCP clients (on Linux/Unix, anyway) have a way to set the
> client-ID. Dhcpcd, for instance, uses the -I flag.
> You can bind a hostname/IP to a client-ID in dnsmasq.conf like this:
> The client-ID can be given either as hex bytes, like a MAC address, or
> as a string.
Thanks a lot for your ultra-quick response! Of course I immediately tried it
out, and after some attempts it finally worked. The actual problem was
XP (should have mentioned, that my Notebook is a dual-boot "WindowsXP vs.
Debian" machine). I had to do some hard googling to find out that there is a
registry-tweak to set the DHCP client identifier being sent to the DHCP
when issuing a DHCP request.
There has to be a registry key
which is a REG_DWORD value specifiying the client ID. It's sent in reverse
byte-order, meaning that the value 0x01020304 is sent as "04:03:02:01".
(also see: http://www.jsiinc.com/SUBF/TIP2800/rh2845.htm)
Now I just have to try to "emulate" this behaviour with a dhcp-client
and hope that it can be integrated into ifup/ifdown mechanism.
Thanks for your help,