Discussion:
[Dnsmasq-discuss] DHCP leases on multiple interfaces with different subnet mask
Tom Hung
2018-05-01 03:44:00 UTC
Permalink
Greetings,



I have an issue about set multiple interfaces with different subnet mask.

I set three interfaces, br-lan, br-VLAN4 and br-VLAN5. br-VLAN5 subnet mask
is 255.0.0.0, others are 255.255.255.0

When there is no DHCP leases, DHCP Client can get correct DHCP OFFER from
different interfaces.

But if client get DHCP OFFER from br-VLAN5, and then switch back to br-lan.
It will get incorrect result.

What I expect is it can be obtained in original br-lan dhcp-range. Do I miss
anything?



Here is my dnsmasq.conf and log, you can see last DHCP OFFER from br-lan is
incorrect.

======================================================

localise-queries

dhcp-range=lan,192.168.10.101,192.168.10.199,255.255.255.0,12h

dhcp-range=VLAN4,192.168.4.101,192.168.4.199,255.255.255.0,12h

dhcp-option=VLAN4,44,4.4.4.4

dhcp-option=VLAN4,6,4.4.4.1,4.4.4.2

dhcp-option=VLAN4,15,444.com

dhcp-range=VLAN5,192.0.0.101,192.0.0.199,255.0.0.0,12h

dhcp-option=VLAN5,44,5.5.5.5

dhcp-option=VLAN5,6,5.5.5.1,5.5.5.2

dhcp-option=VLAN5,15,555.com

======================================================

Mon Apr 30 03:27:10 2018 daemon.info dnsmasq[14002]: started, version 2.78
cachesize 150
Mon Apr 30 03:27:10 2018 daemon.info dnsmasq[14002]: DNS service limited to
local subnets
Mon Apr 30 03:27:10 2018 daemon.info dnsmasq[14002]: compile time options:
IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
ipset no-auth DNSSEC loop-detect inotify
Mon Apr 30 03:27:10 2018 daemon.info dnsmasq-dhcp[14002]: DHCP, IP range
192.0.0.101 -- 192.0.0.199, lease time 12h
Mon Apr 30 03:27:10 2018 daemon.info dnsmasq-dhcp[14002]: DHCP, IP range
192.168.4.101 -- 192.168.4.199, lease time 12h
Mon Apr 30 03:27:10 2018 daemon.info dnsmasq-dhcp[14002]: DHCP, IP range
192.168.10.101 -- 192.168.10.199, lease time 12h
Mon Apr 30 03:27:10 2018 daemon.info dnsmasq[14002]: using local addresses
only for domain lan
Mon Apr 30 03:27:10 2018 daemon.warn dnsmasq[14002]: no servers found in
/tmp/resolv.conf.auto, will retry
Mon Apr 30 03:27:10 2018 daemon.info dnsmasq[14002]: read /etc/hosts - 1
addresses
Mon Apr 30 03:27:10 2018 daemon.info dnsmasq[14002]: read /tmp/hosts/dhcp -
0 addresses
Mon Apr 30 03:27:10 2018 daemon.info dnsmasq-dhcp[14002]: read /etc/ethers -
0 addresses

Mon Apr 30 03:27:24 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPDISCOVER(br-lan) 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:24 2018 daemon.info dnsmasq-dhcp[14002]: DHCPOFFER(br-lan)
192.168.10.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:24 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPDISCOVER(br-lan) 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:24 2018 daemon.info dnsmasq-dhcp[14002]: DHCPOFFER(br-lan)
192.168.10.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:24 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPREQUEST(br-lan) 192.168.10.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:24 2018 daemon.info dnsmasq-dhcp[14002]: DHCPACK(br-lan)
192.168.10.155 58:ef:68:ba:4d:c6 F7C074-BA4DC6

Mon Apr 30 03:27:36 2018 daemon.info dnsmasq[14002]: query[A] pool.ntp.org
from 192.168.10.155

Mon Apr 30 03:27:38 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPDISCOVER(br-VLAN4) 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:38 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPOFFER(br-VLAN4) 192.168.4.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:38 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPDISCOVER(br-VLAN4) 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:38 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPOFFER(br-VLAN4) 192.168.4.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:38 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPREQUEST(br-VLAN4) 192.168.4.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:38 2018 daemon.info dnsmasq-dhcp[14002]: DHCPACK(br-VLAN4)
192.168.4.155 58:ef:68:ba:4d:c6 F7C074-BA4DC6

Mon Apr 30 03:27:38 2018 daemon.info dnsmasq[14002]: query[A] pool.ntp.org
from 192.168.10.155

Mon Apr 30 03:27:40 2018 daemon.info dnsmasq[14002]: query[A] pool.ntp.org
from 192.168.10.155

Mon Apr 30 03:27:42 2018 daemon.info dnsmasq[14002]: query[A] pool.ntp.org
from 192.168.4.155

Mon Apr 30 03:27:42 2018 daemon.info dnsmasq[14002]: query[A] pool.ntp.org
from 192.168.4.155

Mon Apr 30 03:27:42 2018 daemon.info dnsmasq[14002]: query[A] pool.ntp.org
from 192.168.4.155

Mon Apr 30 03:27:57 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPDISCOVER(br-VLAN5) 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:57 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPOFFER(br-VLAN5) 192.0.0.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:57 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPDISCOVER(br-VLAN5) 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:57 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPOFFER(br-VLAN5) 192.0.0.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:58 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPREQUEST(br-VLAN5) 192.0.0.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:27:58 2018 daemon.info dnsmasq-dhcp[14002]: DHCPACK(br-VLAN5)
192.0.0.155 58:ef:68:ba:4d:c6 F7C074-BA4DC6

Mon Apr 30 03:28:16 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPDISCOVER(br-lan) 58:ef:68:ba:4d:c6

Mon Apr 30 03:28:16 2018 daemon.info dnsmasq-dhcp[14002]: DHCPOFFER(br-lan)
192.0.0.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:28:16 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPREQUEST(br-lan) 192.0.0.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:28:16 2018 daemon.info dnsmasq-dhcp[14002]: DHCPACK(br-lan)
192.0.0.155 58:ef:68:ba:4d:c6 F7C074-BA4DC6

Mon Apr 30 03:28:19 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPDISCOVER(br-lan) 58:ef:68:ba:4d:c6

Mon Apr 30 03:28:19 2018 daemon.info dnsmasq-dhcp[14002]: DHCPOFFER(br-lan)
192.0.0.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:28:19 2018 daemon.info dnsmasq-dhcp[14002]:
DHCPREQUEST(br-lan) 192.0.0.155 58:ef:68:ba:4d:c6

Mon Apr 30 03:28:19 2018 daemon.info dnsmasq-dhcp[14002]: DHCPACK(br-lan)
192.0.0.155 58:ef:68:ba:4d:c6 F7C074-BA4DC6
john doe
2018-05-01 06:57:58 UTC
Permalink
Post by Tom Hung
Greetings,
I have an issue about set multiple interfaces with different subnet mask.
I set three interfaces, br-lan, br-VLAN4 and br-VLAN5. br-VLAN5 subnet mask
is 255.0.0.0, others are 255.255.255.0
When there is no DHCP leases, DHCP Client can get correct DHCP OFFER from
different interfaces.
But if client get DHCP OFFER from br-VLAN5, and then switch back to br-lan.
It will get incorrect result.
What I expect is it can be obtained in original br-lan dhcp-range. Do I miss
anything?
Here is my dnsmasq.conf and log, you can see last DHCP OFFER from br-lan is
incorrect.
======================================================
localise-queries
dhcp-range=lan,192.168.10.101,192.168.10.199,255.255.255.0,12h
dhcp-range=VLAN4,192.168.4.101,192.168.4.199,255.255.255.0,12h
In most cases tags need to be set before they can be used. Are the tags
set anywhere else in your configuration?
If no, the following example could help:

dhcp-range=set:<TAG-NAME>,...
--
John Doe
Continue reading on narkive:
Loading...