[Dnsmasq-discuss] Sometimes forgets to hand out known dhcp-host IP
Simon Kelley
simon at thekelleys.org.uk
Fri Mar 8 17:14:30 GMT 2013
On 07/03/13 14:34, hansen wrote:
> Hi dnsmasq'ueraders :)
>
> I have a small network, where I am trying to split my network into to
> ranges.
> One range for local machines and another range for guests. On two
> different interfaces connected to dnsmasq.
>
> Usually I don't have any problems, but sometimes my local machines end
> up on the guest range network.
> If I release the DHCP on the machine and reboot it, then it is 50/50 if
> the go back to local network or end up on guest network again.
>
> Is this network setup just bad and not possible to behave as I expect -
> or is it just a configuration mistake?
> I am running dnsmasq 2.65 on FreeBSD 7.4.
> Looking at the changelog it seems like the feature I'm looking for was
> removed in 2.63 (Remove the interface:<interface> argument in --dhcp-range)
No that feature won't fix the problem.
The problem is that you have two interfaces (em1 and em2) connected to
the same broadcast domain. That's not something that dnsmasq knows how
to deal with, and it gets confused when is gives a client an address
associated with one interface, and then it turns up on a different
interface.
Can you use one physical interface on the machine running dnsmasq, and
give it two addresses?
Cheers,
Simon.
>
> Any hints are more than welcome! Thank you in advance,
> -hansen
>
> Here is how it looks, when it gives the wrong IP:
> 08:23:42 dnsmasq-dhcp[68210]: DHCPREQUEST(em1) 192.168.2.107
> 50:e5:49:d1:7b:82
> 08:23:42 dnsmasq-dhcp[68210]: DHCPNAK(em1) 192.168.2.107
> 50:e5:49:d1:7b:82 wrong network
> 08:23:42 dnsmasq-dhcp[68210]: DHCPREQUEST(em2) 192.168.2.107
> 50:e5:49:d1:7b:82
> 08:23:42 dnsmasq-dhcp[68210]: DHCPACK(em2) 192.168.2.107
> 50:e5:49:d1:7b:82 PC07
> 08:23:46 dnsmasq-dhcp[68210]: DHCPDISCOVER(em1) 50:e5:49:d1:7b:82
> 08:23:46 dnsmasq-dhcp[68210]: DHCPOFFER(em1) 10.10.10.17 50:e5:49:d1:7b:82
> 08:23:46 dnsmasq-dhcp[68210]: DHCPDISCOVER(em2) 50:e5:49:d1:7b:82
> 08:23:46 dnsmasq-dhcp[68210]: DHCPOFFER(em2) 192.168.2.107 50:e5:49:d1:7b:82
> 08:23:46 dnsmasq-dhcp[68210]: DHCPREQUEST(em1) 10.10.10.17 50:e5:49:d1:7b:82
> 08:23:46 dnsmasq-dhcp[68210]: DHCPACK(em1) 10.10.10.17 50:e5:49:d1:7b:82
> PC07
> 08:23:46 dnsmasq-dhcp[68210]: not giving name PC07 to the DHCP lease of
> 10.10.10.17 because the name exists in /etc/hosts with address 192.168.2.107
> 08:23:46 dnsmasq-dhcp[68210]: DHCPREQUEST(em2) 10.10.10.17 50:e5:49:d1:7b:82
> 08:23:46 dnsmasq-dhcp[68210]: DHCPNAK(em2) 10.10.10.17 50:e5:49:d1:7b:82
> wrong server-ID
> 08:23:55 dnsmasq-dhcp[68210]: DHCPINFORM(em2) 10.10.10.17
> 50:e5:49:d1:7b:82 ignored
> 08:23:55 dnsmasq-dhcp[68210]: DHCPINFORM(em1) 10.10.10.17 50:e5:49:d1:7b:82
> 08:23:55 dnsmasq-dhcp[68210]: DHCPACK(em1) 10.10.10.17 50:e5:49:d1:7b:82
> PC07
>
> Here is the normal way, when it gives the correct IP:
> 08:44:55 dnsmasq-dhcp[68210]: DHCPREQUEST(em2) 192.168.2.106
> 00:19:b9:26:83:8b
> 08:44:55 dnsmasq-dhcp[68210]: DHCPACK(em2) 192.168.2.106
> 00:19:b9:26:83:8b PC06
> 08:44:55 dnsmasq-dhcp[68210]: DHCPREQUEST(em1) 192.168.2.106
> 00:19:b9:26:83:8b
> 08:44:55 dnsmasq-dhcp[68210]: DHCPNAK(em1) 192.168.2.106
> 00:19:b9:26:83:8b wrong network
> 08:44:59 dnsmasq-dhcp[68210]: DHCPINFORM(em2) 192.168.2.106
> 00:19:b9:26:83:8b
> 08:44:59 dnsmasq-dhcp[68210]: DHCPACK(em2) 192.168.2.106
> 00:19:b9:26:83:8b PC06
> 08:44:59 dnsmasq-dhcp[68210]: DHCPINFORM(em1) 192.168.2.106
> 00:19:b9:26:83:8b
> 08:44:59 dnsmasq-dhcp[68210]: DHCPACK(em1) 192.168.2.106
> 00:19:b9:26:83:8b PC06
>
> The constant difference between correct and wrong DHCP'ing is the first
> interface to get a DHCPREQUEST.
> When it fails, it's always because em1 is called first.
>
> #=============dnsmasq.conf:START
> domain-needed
> bogus-priv
> no-resolv
> no-poll
> expand-hosts
>
> server=8.8.8.8
> server=8.8.4.4
> interface=em2
> interface=em1
>
> dhcp-range=tag:em2,set:localpc,192.168.2.0,static,infinite
> dhcp-range=tag:em1,tag:!localpc,10.10.10.10,10.10.10.99,1h
>
> dhcp-host=00:19:B9:26:2f:a6,192.168.2.101,PC01,infinite
> dhcp-host=00:19:B9:26:87:35,192.168.2.102,PC02,infinite
> dhcp-host=00:19:B9:26:83:af,192.168.2.103,PC03,infinite
> dhcp-host=00:19:B9:26:8b:12,192.168.2.104,PC04,infinite
> dhcp-host=00:19:B9:26:85:55,192.168.2.105,PC05,infinite
> dhcp-host=00:19:B9:26:83:8b,192.168.2.106,PC06,infinite
> dhcp-host=50:e5:49:d1:7b:82,192.168.2.107,PC07,infinite
>
> dhcp-ignore=tag:localpc,tag:known,tag:em2
>
> dhcp-option=tag:em2,19,0
> dhcp-option=42,0.0.0.0
> dhcp-option=tag:em2,44,0.0.0.0
> dhcp-option=tag:em2,45,0.0.0.0
> dhcp-option=tag:em2,46,8
> dhcp-option=tag:em2,47
>
> dhcp-lease-max=200
> dhcp-authoritative
> cache-size=500
> no-negcache
> #=============dnsmasq.conf:END
>
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
More information about the Dnsmasq-discuss
mailing list