[Dnsmasq-discuss] preventing address allocation
Thu, 09 Jun 2005 12:37:14 +0200
I've got a situation that I haven't found a great answer to so far, and
I was hoping you all could help.
We've got a set up like this:
eth0, eth1 are on the same physical lan-segment
eth0 handles range 10.0.150.10-10.0.150.255
eth1 handles range 10.128.150.10-10.128.150.255
dnsmasq is configured like this (partially):
MAC address is not sent as identifier, instead client-id is CLIENT1
So the point is, client1 gets assigned a known address and so does
client2. All configuration is in one place. excellent.
So now let's say client1's dhcpcd starts and sends a UDP packet, asking
for a dhcp server and an address. The packet arrives at at eth0 and
dnsmasq says "yep, you're CLIENT1, here's your address." However, the
packet also arrives at eth1 and dnsmasq says, "that doesn't match any
context. Hmm. Here, CLIENT1, try this address" and allocates an unused
address from its allowed range for eth1.
And it's the second part that I want to disable. If a request comes to
an interface and the request is not recognized from the dhcp-host list,
dnsmasq should not allocate an unused address.
Can someone tell me how to stop it? I stopped it manually by changing
line ~ 411 from rfc2131.c:
else if (!address_allocate(context, daemon, &mess->yiaddr, mess->chaddr,
message = "no address available";
message = "not allocating address"
But this is pretty hacky! Does anyone have a better suggestion?
Thank you very much
CT SE 2