Discussion:
[Dnsmasq-discuss] Help with dnsmasq and vlans tags
jmperrote
2018-12-03 15:27:47 UTC
Permalink
We need help to configure dnsmasq with vlans tagged on router.

We actually have a dnsmasq server serving dns and dhcp, and 3 nics, one
for each vlans:

dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.37.1 # gateway

dhcp-range=interface:eth0,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.137.1 # gateway

dhcp-range=interface:eth0,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.237.1 # gateway


Know we are migratting to a dnsmasq solution with one nic a tagged
vlans: But the result is not that we want:

We configure this:

dhcp-range=tag:vlan37,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-range=tag:vlan137,set:VLAN_137,10.11.137.50,10.11.137.200,6h
dhcp-range=tag:vlan237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=tag:vlan37,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:dns-server,10.11.37.15
dhcp-option=tag:vlan237,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:router,10.11.137.1
dhcp-option=tag:vlan37,option:router,10.11.37.1
dhcp-option=tag:vlan237,option:router,10.11.237.1

But all clients recive allways the same gateway, 10.11.237.1

regards.
john doe
2018-12-03 16:30:55 UTC
Permalink
Post by jmperrote
We need help to configure dnsmasq with vlans tagged on router.
We actually have a dnsmasq server serving dns and dhcp, and 3 nics, one
dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.237.1 # gateway
Know we are migratting to a dnsmasq solution with one nic a tagged
dhcp-range=tag:vlan37,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-range=tag:vlan137,set:VLAN_137,10.11.137.50,10.11.137.200,6h
dhcp-range=tag:vlan237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=tag:vlan37,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:dns-server,10.11.37.15
dhcp-option=tag:vlan237,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:router,10.11.137.1
dhcp-option=tag:vlan37,option:router,10.11.37.1
dhcp-option=tag:vlan237,option:router,10.11.237.1
But all clients recive allways the same gateway, 10.11.237.1
I'm not sure to fully understand the issue(s) you are facing.
As far as dnsmasq is concerned, there is no differences between 3
physical "nicks" and 3 VLAN tagged interfaces (802.1Q).
So for a start you could simply try:

# Specify DHCP range with a tag
dhcp-range=set:vlan99,172.23.100.200,172.23.100.230,12h
dhcp-range=set:vlan100,172.23.101.200,172.23.101.230,12h
dhcp-range=set:vlan100,172.23.102.200,172.23.102.230,12h
--
John Doe
jmperrote
2018-12-04 11:02:48 UTC
Permalink
Post by john doe
Post by jmperrote
We need help to configure dnsmasq with vlans tagged on router.
We actually have a dnsmasq server serving dns and dhcp, and 3 nics, one
dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.237.1 # gateway
Know we are migratting to a dnsmasq solution with one nic a tagged
dhcp-range=tag:vlan37,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-range=tag:vlan137,set:VLAN_137,10.11.137.50,10.11.137.200,6h
dhcp-range=tag:vlan237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=tag:vlan37,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:dns-server,10.11.37.15
dhcp-option=tag:vlan237,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:router,10.11.137.1
dhcp-option=tag:vlan37,option:router,10.11.37.1
dhcp-option=tag:vlan237,option:router,10.11.237.1
But all clients recive allways the same gateway, 10.11.237.1
I'm not sure to fully understand the issue(s) you are facing.
As far as dnsmasq is concerned, there is no differences between 3
physical "nicks" and 3 VLAN tagged interfaces (802.1Q).
# Specify DHCP range with a tag
dhcp-range=set:vlan99,172.23.100.200,172.23.100.230,12h
dhcp-range=set:vlan100,172.23.101.200,172.23.101.230,12h
dhcp-range=set:vlan100,172.23.102.200,172.23.102.230,12h
John Doe, sorry for my mistake, my actual configuration of dnsmasq are:

dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.37.1 # gateway

dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth1,6,10.11.37.15 #dns primario
dhcp-option=eth1,1,255.255.255.0 # mascara de red
dhcp-option=eth1,option:router,10.11.137.1 # gateway

dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth2,6,10.11.37.15 #dns primario
dhcp-option=eth2,1,255.255.255.0 # mascara de red
dhcp-option=eth2,option:router,10.11.237.1 # gateway

We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and try
to replace for one nic with VLANs tagged.

We try the tag option and the dhcp assign ip on correct range for each
PC on each vlan, but dnsmasq allways assign to the PC the same gateway,
that is the las vlan configured.

For example on this configuraton assign the correct range to the PC, but
the gateway always assign 10.11.237.1 gateway, to all PC

dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway

dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway

dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway


It is necessary to use "vconfig" to configure virtual vlan interface on
the operating system, or can use tagged vlans from the router ?

regards.
Geert Stappers
2018-12-04 13:39:21 UTC
Permalink
Post by jmperrote
Post by john doe
Post by jmperrote
We need help to configure dnsmasq with vlans tagged on router.
We actually have a dnsmasq server serving dns and dhcp, and 3 nics,
I'm not sure to fully understand the issue(s) you are facing.
In my words "VLAN is a new concept"
Post by jmperrote
Post by john doe
As far as dnsmasq is concerned, there is no differences between 3
physical "nicks" and 3 VLAN tagged interfaces (802.1Q).
# Specify DHCP range with a tag
dhcp-range=set:vlan99,172.23.100.200,172.23.100.230,12h
dhcp-range=set:vlan100,172.23.101.200,172.23.101.230,12h
dhcp-range=set:vlan100,172.23.102.200,172.23.102.230,12h
dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth1,6,10.11.37.15 #dns primario
dhcp-option=eth1,1,255.255.255.0 # mascara de red
dhcp-option=eth1,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth2,6,10.11.37.15 #dns primario
dhcp-option=eth2,1,255.255.255.0 # mascara de red
dhcp-option=eth2,option:router,10.11.237.1 # gateway
We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and try to
replace for one nic with VLANs tagged.
We try the tag option and the dhcp assign ip on correct range for each PC on
each vlan, but dnsmasq allways assign to the PC the same gateway, that is
the las vlan configured.
For example on this configuraton assign the correct range to the PC, but the
gateway always assign 10.11.237.1 gateway, to all PC
dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway
It is necessary to use "vconfig" to configure virtual vlan interface on the
operating system, or can use tagged vlans from the router ?
The above question rewritten in my words:

} Who helps me understanding VLANs?
} Where do I need to change what? At Operating System? Router? Both??

Seen the question.

On the 'Problem / Subject: Re: [Dnsmasq-discuss] Help with dnsmasq and vlans tags'
start with focus on just 'VLAN'. After that, add dnsmasq.


Groeten
Geert Stappers
--
Leven en laten leven
john doe
2018-12-04 15:26:46 UTC
Permalink
Post by john doe
Post by jmperrote
We need help to configure dnsmasq with vlans tagged on router.
We actually have a dnsmasq server serving dns and dhcp, and 3 nics, one
dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.237.1 # gateway
Know we are migratting to a dnsmasq solution with one nic a tagged
dhcp-range=tag:vlan37,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-range=tag:vlan137,set:VLAN_137,10.11.137.50,10.11.137.200,6h
dhcp-range=tag:vlan237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=tag:vlan37,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:dns-server,10.11.37.15
dhcp-option=tag:vlan237,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:router,10.11.137.1
dhcp-option=tag:vlan37,option:router,10.11.37.1
dhcp-option=tag:vlan237,option:router,10.11.237.1
But all clients recive allways the same gateway, 10.11.237.1
I'm not sure to fully understand the issue(s) you are facing.
As far as dnsmasq is concerned, there is no differences between 3
physical "nicks" and 3 VLAN tagged interfaces  (802.1Q).
# Specify DHCP range with a tag
dhcp-range=set:vlan99,172.23.100.200,172.23.100.230,12h
dhcp-range=set:vlan100,172.23.101.200,172.23.101.230,12h
dhcp-range=set:vlan100,172.23.102.200,172.23.102.230,12h
    dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
    dhcp-option=eth0,6,10.11.37.15 #dns primario
    dhcp-option=eth0,1,255.255.255.0 # mascara de red
    dhcp-option=eth0,option:router,10.11.37.1 # gateway
    dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
    dhcp-option=eth1,6,10.11.37.15 #dns primario
    dhcp-option=eth1,1,255.255.255.0 # mascara de red
    dhcp-option=eth1,option:router,10.11.137.1 # gateway
    dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
    dhcp-option=eth2,6,10.11.37.15 #dns primario
    dhcp-option=eth2,1,255.255.255.0 # mascara de red
    dhcp-option=eth2,option:router,10.11.237.1 # gateway
We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and try
to replace for one nic with VLANs tagged.
We try the tag option and the dhcp assign ip on correct range for each
PC on each vlan, but dnsmasq allways assign to the PC the same gateway,
that is the las vlan configured.
For example on this configuraton assign the correct range to the PC, but
the gateway always assign 10.11.237.1 gateway, to all PC
dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway
It is necessary to use "vconfig" to configure virtual vlan interface on
the operating system, or can use tagged vlans from the router ?
To be able to answer your question I need to know the following:

- What hardware is the router (netgear, cisco ...)?
- What type of distribution (name and version) are you using 'vconfig'
on (Linux, Oracle)?

I can't answer your question without knowing your network topology, but
if the router is VLAN tagging capable I would use it and also use the
DHCP capability from that router.

Also, to isolate whether it is a vlan configuration or a dnsmasq issue
simply try the line I have provided, obviously you can change the Ip
ranges to your liking.
--
John Doe
jmperrote
2018-12-05 12:09:25 UTC
Permalink
Post by john doe
Post by john doe
Post by jmperrote
We need help to configure dnsmasq with vlans tagged on router.
We actually have a dnsmasq server serving dns and dhcp, and 3 nics, one
dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.237.1 # gateway
Know we are migratting to a dnsmasq solution with one nic a tagged
dhcp-range=tag:vlan37,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-range=tag:vlan137,set:VLAN_137,10.11.137.50,10.11.137.200,6h
dhcp-range=tag:vlan237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=tag:vlan37,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:dns-server,10.11.37.15
dhcp-option=tag:vlan237,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:router,10.11.137.1
dhcp-option=tag:vlan37,option:router,10.11.37.1
dhcp-option=tag:vlan237,option:router,10.11.237.1
But all clients recive allways the same gateway, 10.11.237.1
I'm not sure to fully understand the issue(s) you are facing.
As far as dnsmasq is concerned, there is no differences between 3
physical "nicks" and 3 VLAN tagged interfaces  (802.1Q).
# Specify DHCP range with a tag
dhcp-range=set:vlan99,172.23.100.200,172.23.100.230,12h
dhcp-range=set:vlan100,172.23.101.200,172.23.101.230,12h
dhcp-range=set:vlan100,172.23.102.200,172.23.102.230,12h
    dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
    dhcp-option=eth0,6,10.11.37.15 #dns primario
    dhcp-option=eth0,1,255.255.255.0 # mascara de red
    dhcp-option=eth0,option:router,10.11.37.1 # gateway
    dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
    dhcp-option=eth1,6,10.11.37.15 #dns primario
    dhcp-option=eth1,1,255.255.255.0 # mascara de red
    dhcp-option=eth1,option:router,10.11.137.1 # gateway
    dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
    dhcp-option=eth2,6,10.11.37.15 #dns primario
    dhcp-option=eth2,1,255.255.255.0 # mascara de red
    dhcp-option=eth2,option:router,10.11.237.1 # gateway
We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and try
to replace for one nic with VLANs tagged.
We try the tag option and the dhcp assign ip on correct range for each
PC on each vlan, but dnsmasq allways assign to the PC the same gateway,
that is the las vlan configured.
For example on this configuraton assign the correct range to the PC, but
the gateway always assign 10.11.237.1 gateway, to all PC
dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway
It is necessary to use "vconfig" to configure virtual vlan interface on
the operating system, or can use tagged vlans from the router ?
- What hardware is the router (netgear, cisco ...)?
- What type of distribution (name and version) are you using 'vconfig'
on (Linux, Oracle)?
I can't answer your question without knowing your network topology, but
if the router is VLAN tagging capable I would use it and also use the
DHCP capability from that router.
Also, to isolate whether it is a vlan configuration or a dnsmasq issue
simply try the line I have provided, obviously you can change the Ip
ranges to your liking.
Hello john doe,

Send the data:
-- Router mikrotik RB1100 AH
-- Ubuntu 16.04
-- Using vconfig with 3 VLANs

Yes, the router have capabilitie to dhcp, you recommend to use that
instead of dnsmasq for dhcp ?.

Regards.
Geert Stappers
2018-12-05 12:58:31 UTC
Permalink
Post by jmperrote
Post by john doe
    dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
    dhcp-option=eth0,6,10.11.37.15 #dns primario
    dhcp-option=eth0,1,255.255.255.0 # mascara de red
    dhcp-option=eth0,option:router,10.11.37.1 # gateway
    dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
    dhcp-option=eth1,6,10.11.37.15 #dns primario
    dhcp-option=eth1,1,255.255.255.0 # mascara de red
    dhcp-option=eth1,option:router,10.11.137.1 # gateway
    dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
    dhcp-option=eth2,6,10.11.37.15 #dns primario
    dhcp-option=eth2,1,255.255.255.0 # mascara de red
    dhcp-option=eth2,option:router,10.11.237.1 # gateway
We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and
try to replace for one nic with VLANs tagged.
We try the tag option and the dhcp assign ip on correct range for each
PC on each vlan, but dnsmasq allways assign to the PC the same
gateway, that is the las vlan configured.
For example on this configuraton assign the correct range to the PC,
but the gateway always assign 10.11.237.1 gateway, to all PC
dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway
It is necessary to use "vconfig" to configure virtual vlan interface
on the operating system, or can use tagged vlans from the router ?
- What hardware is the router (netgear, cisco ...)?
- What type of distribution (name and version) are you using 'vconfig'
on (Linux, Oracle)?
I can't answer your question without knowing your network topology, but
if the router is VLAN tagging capable I would use it and also use the
DHCP capability from that router.
Also, to isolate whether it is a vlan configuration or a dnsmasq issue
simply try the line I have provided, obviously you can change the Ip
ranges to your liking.
Hello john doe,
Hello Mailinglist,
Post by jmperrote
-- Router mikrotik RB1100 AH
-- Ubuntu 16.04
-- Using vconfig with 3 VLANs
Yes, the router have capabilitie to dhcp,
you recommend to use that instead of dnsmasq for dhcp ?.
What I did read in the reply from john doe:

Other options might resolve the original problem.


But, yes, it is possible to replace
three NICs with single NIC plus three VLANs. Surely for DHCP stuff.
If three NICs were choose due high bandwidth usage,
that can't be solved by "VLAN".


Cheers
Geert Stappers
jmperrote
2018-12-05 13:35:50 UTC
Permalink
Post by Geert Stappers
Post by jmperrote
Post by john doe
    dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
    dhcp-option=eth0,6,10.11.37.15 #dns primario
    dhcp-option=eth0,1,255.255.255.0 # mascara de red
    dhcp-option=eth0,option:router,10.11.37.1 # gateway
    dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
    dhcp-option=eth1,6,10.11.37.15 #dns primario
    dhcp-option=eth1,1,255.255.255.0 # mascara de red
    dhcp-option=eth1,option:router,10.11.137.1 # gateway
    dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
    dhcp-option=eth2,6,10.11.37.15 #dns primario
    dhcp-option=eth2,1,255.255.255.0 # mascara de red
    dhcp-option=eth2,option:router,10.11.237.1 # gateway
We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and
try to replace for one nic with VLANs tagged.
We try the tag option and the dhcp assign ip on correct range for each
PC on each vlan, but dnsmasq allways assign to the PC the same
gateway, that is the las vlan configured.
For example on this configuraton assign the correct range to the PC,
but the gateway always assign 10.11.237.1 gateway, to all PC
dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway
It is necessary to use "vconfig" to configure virtual vlan interface
on the operating system, or can use tagged vlans from the router ?
- What hardware is the router (netgear, cisco ...)?
- What type of distribution (name and version) are you using 'vconfig'
on (Linux, Oracle)?
I can't answer your question without knowing your network topology, but
if the router is VLAN tagging capable I would use it and also use the
DHCP capability from that router.
Also, to isolate whether it is a vlan configuration or a dnsmasq issue
simply try the line I have provided, obviously you can change the Ip
ranges to your liking.
Hello john doe,
Hello Mailinglist,
Post by jmperrote
-- Router mikrotik RB1100 AH
-- Ubuntu 16.04
-- Using vconfig with 3 VLANs
Yes, the router have capabilitie to dhcp,
you recommend to use that instead of dnsmasq for dhcp ?.
Other options might resolve the original problem.
But, yes, it is possible to replace
three NICs with single NIC plus three VLANs. Surely for DHCP stuff.
If three NICs were choose due high bandwidth usage,
that can't be solved by "VLAN".
Cheers
Geert Stappers
_______________________________________________
Dnsmasq-discuss mailing list
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
We need to use one nics with vlans, just to simplify the solution, the
bandwidth usage is slow, we have maybe 250 PC.

With trhee nics and one IP for each are working since longtime fine,
know we try to reconvert the solution ussing VLANS and one nic.

Regards
Geert Stappers
2018-12-05 14:36:49 UTC
Permalink
On Wed, Dec 05, 2018 at 10:35:50AM -0300, jmperrote wrote:
<bigsnip/>
With three nics and one IP for each are working since longtime fine,
now we try to reconvert the solution using VLANS and one nic.
start with focus on just 'VLAN'. After that, add dnsmasq.


Cheers
Geert Stappers
john doe
2018-12-05 15:59:49 UTC
Permalink
Post by Geert Stappers
Post by jmperrote
Post by john doe
    dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
    dhcp-option=eth0,6,10.11.37.15 #dns primario
    dhcp-option=eth0,1,255.255.255.0 # mascara de red
    dhcp-option=eth0,option:router,10.11.37.1 # gateway
    dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
    dhcp-option=eth1,6,10.11.37.15 #dns primario
    dhcp-option=eth1,1,255.255.255.0 # mascara de red
    dhcp-option=eth1,option:router,10.11.137.1 # gateway
    dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
    dhcp-option=eth2,6,10.11.37.15 #dns primario
    dhcp-option=eth2,1,255.255.255.0 # mascara de red
    dhcp-option=eth2,option:router,10.11.237.1 # gateway
We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and
try to replace for one nic with VLANs tagged.
We try the tag option and the dhcp assign ip on correct range for each
PC on each vlan, but dnsmasq allways assign to the PC the same
gateway, that is the las vlan configured.
For example on this configuraton assign the correct range to the PC,
but the gateway always assign 10.11.237.1 gateway, to all PC
dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway
It is necessary to use "vconfig" to configure virtual vlan interface
on the operating system, or can use tagged vlans from the router ?
- What hardware is the router (netgear, cisco ...)?
- What type of distribution (name and version) are you using 'vconfig'
on (Linux, Oracle)?
I can't answer your question without knowing your network topology, but
if the router is VLAN tagging capable I would use it and also use the
DHCP capability from that router.
Also, to isolate whether it is a vlan configuration or a dnsmasq issue
simply try the line I have provided, obviously you can change the Ip
ranges to your liking.
Hello john doe,
Hello Mailinglist,
Post by jmperrote
-- Router mikrotik RB1100 AH
-- Ubuntu 16.04
-- Using vconfig with 3 VLANs
Yes, the router have capabilitie to dhcp,
you recommend to use that instead of dnsmasq for dhcp ?.
Other options might resolve the original problem.
But, yes, it is possible to replace
three NICs with single NIC plus three VLANs. Surely for DHCP stuff.
If three NICs were choose due high bandwidth usage,
that can't be solved by "VLAN".
I guess nick bonding could be used with VLAN.
--
John Doe
jmperrote
2018-12-06 14:50:22 UTC
Permalink
Post by john doe
Post by Geert Stappers
Post by jmperrote
Post by john doe
    dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
    dhcp-option=eth0,6,10.11.37.15 #dns primario
    dhcp-option=eth0,1,255.255.255.0 # mascara de red
    dhcp-option=eth0,option:router,10.11.37.1 # gateway
    dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
    dhcp-option=eth1,6,10.11.37.15 #dns primario
    dhcp-option=eth1,1,255.255.255.0 # mascara de red
    dhcp-option=eth1,option:router,10.11.137.1 # gateway
    dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
    dhcp-option=eth2,6,10.11.37.15 #dns primario
    dhcp-option=eth2,1,255.255.255.0 # mascara de red
    dhcp-option=eth2,option:router,10.11.237.1 # gateway
We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and
try to replace for one nic with VLANs tagged.
We try the tag option and the dhcp assign ip on correct range for each
PC on each vlan, but dnsmasq allways assign to the PC the same
gateway, that is the las vlan configured.
For example on this configuraton assign the correct range to the PC,
but the gateway always assign 10.11.237.1 gateway, to all PC
dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway
It is necessary to use "vconfig" to configure virtual vlan
interface
on the operating system, or can use tagged vlans from the router ?
- What hardware is the router (netgear, cisco ...)?
- What type of distribution (name and version) are you using 'vconfig'
on (Linux, Oracle)?
I can't answer your question without knowing your network topology, but
if the router is VLAN tagging capable I would use it and also use the
DHCP capability from that router.
Also, to isolate whether it is a vlan configuration or a dnsmasq issue
simply try the line I have provided, obviously you can change the Ip
ranges to your liking.
Hello john doe,
Hello Mailinglist,
Post by jmperrote
-- Router mikrotik RB1100 AH
-- Ubuntu 16.04
-- Using vconfig with 3 VLANs
Yes, the router have capabilitie to dhcp,
you recommend to use that instead of dnsmasq for dhcp ?.
Other options might resolve the original problem.
But, yes, it is possible to replace
three NICs with single NIC plus three VLANs. Surely for DHCP stuff.
If three NICs were choose due high bandwidth usage,
that can't be solved by "VLAN".
I guess nick bonding could be used with VLAN.
Hello, ok trying a solution to resolv dnsmasq with vlans and one nic, I
do next

I reconfigured the dnsmasq with this and the mikrotik router with tagged
vlans.

dhcp-range=tag:eth0,set:eth0,10.11.37.50,10.11.37.200,6h
dhcp-range=tag:eth0,set:eth0,10.11.137.50,10.11.137.200,6h
dhcp-range=tag:eth0,set:eth0,10.11.237.50,10.11.237.200,6h
dhcp-option=tag:eth0,option:dns-server,10.11.37.15
dhcp-option=tag:eth0,option:dns-server,10.11.37.15
dhcp-option=tag:eth0,option:dns-server,10.11.37.15
dhcp-option=tag:eth0,option:router,10.11.137.1
dhcp-option=tag:eth0,option:router,10.11.37.1
dhcp-option=tag:eth0,option:router,10.11.237.1
dhcp-option=tag:eth0,1,255.255.255.0

The assign of ip work fine, each PC on each vlan pickup a IP on
corresponding vlan, but on 3 PCs allways assign the same gateway -->
10.11.237.1

Example
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 available DHCP range:
10.11.137.50 -- 10.11.137.200
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 available DHCP range:
10.11.237.50 -- 10.11.237.200
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 client provides name:
networking3
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 DHCPREQUEST(eth0)
10.11.137.96 10:78:d2:d7:b2:5c
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 tags: eth0
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 DHCPACK(eth0)
10.11.137.96 10:78:d2:d7:b2:5c networking3
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 requested options:
1:netmask, 28:broadcast, 2:time-offset, 3:router,
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 requested options:
15:domain-name, 6:dns-server, 119:domain-search,
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 requested options:
12:hostname, 44:netbios-ns, 47:netbios-scope,
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 requested options:
26:mtu, 121:classless-static-route, 42:ntp-server,
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 requested options: 249,
33:static-route, 252
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 next server: 10.11.37.15
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 1 option:
53:message-type 05
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
54:server-identifier 10.11.37.15
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
51:lease-time 00:00:54:60
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
58:T1 00:00:2a:30
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
59:T2 00:00:49:d4
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
1:netmask 255.0.0.0
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
28:broadcast 10.11.37.255
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 23 option:
15:domain-name prueba.prueba.ar
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 11 option:
12:hostname networking3
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
3:router 10.11.237.1
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
3:router 10.11.37.1
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
3:router 10.11.137.1
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
6:dns-server 10.11.37.15
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
6:dns-server 10.11.37.15
Dec 6 14:38:57 dnsmasq-dhcp[1717]: 4259865864 sent size: 4 option:
6:dns-server 10.11.37.15


regards.
john doe
2018-12-06 17:52:11 UTC
Permalink
Post by jmperrote
Post by john doe
Post by Geert Stappers
Post by jmperrote
    dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
    dhcp-option=eth0,6,10.11.37.15 #dns primario
    dhcp-option=eth0,1,255.255.255.0 # mascara de red
    dhcp-option=eth0,option:router,10.11.37.1 # gateway
    dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
    dhcp-option=eth1,6,10.11.37.15 #dns primario
    dhcp-option=eth1,1,255.255.255.0 # mascara de red
    dhcp-option=eth1,option:router,10.11.137.1 # gateway
    dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
    dhcp-option=eth2,6,10.11.37.15 #dns primario
    dhcp-option=eth2,1,255.255.255.0 # mascara de red
    dhcp-option=eth2,option:router,10.11.237.1 # gateway
We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and
try to replace for one nic with VLANs tagged.
We try the tag option and the dhcp assign ip on correct range for each
PC on each vlan, but dnsmasq allways assign to the PC the same
gateway, that is the las vlan configured.
For example on this configuraton assign the correct range to the PC,
but the gateway always assign 10.11.237.1 gateway, to all PC
dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway
It is necessary to use "vconfig" to configure virtual vlan interface
on the operating system, or can use tagged vlans from the router ?
 - What hardware is the router (netgear, cisco ...)?
 - What type of distribution (name and version) are you using
'vconfig'
on (Linux, Oracle)?
I can't answer your question without knowing your network topology, but
if the router is VLAN tagging capable I would use it and also use the
DHCP capability from that router.
Also, to isolate whether it is a vlan configuration or a dnsmasq issue
simply try the line I have provided, obviously you can change the Ip
ranges to your liking.
Hello john doe,
Hello Mailinglist,
Post by jmperrote
 -- Router mikrotik RB1100 AH
 -- Ubuntu 16.04
 -- Using vconfig with 3 VLANs
Yes, the router have capabilitie to dhcp,
you recommend to use that instead of dnsmasq for dhcp ?.
  Other options might resolve the original problem.
But, yes, it is possible to replace
three NICs with single NIC plus three VLANs.  Surely for DHCP stuff.
If three NICs were choose due high bandwidth usage,
that can't be solved by "VLAN".
I guess nick bonding could be used with VLAN.
Hello, ok trying a solution to resolv dnsmasq with vlans and one nic, I
do next
I reconfigured the dnsmasq with this and the mikrotik router with tagged
vlans.
dhcp-range=tag:eth0,set:eth0,10.11.37.50,10.11.37.200,6h
dhcp-range=tag:eth0,set:eth0,10.11.137.50,10.11.137.200,6h
dhcp-range=tag:eth0,set:eth0,10.11.237.50,10.11.237.200,6h
dhcp-option=tag:eth0,option:dns-server,10.11.37.15
dhcp-option=tag:eth0,option:dns-server,10.11.37.15
dhcp-option=tag:eth0,option:dns-server,10.11.37.15
dhcp-option=tag:eth0,option:router,10.11.137.1
dhcp-option=tag:eth0,option:router,10.11.37.1
dhcp-option=tag:eth0,option:router,10.11.237.1
dhcp-option=tag:eth0,1,255.255.255.0
The assign of ip work fine, each PC on each vlan pickup a IP on
corresponding vlan, but on 3 PCs allways assign the same gateway -->
10.11.237.1
If it is working for most of the hosts, my guess is that you need to
renew the lease on those hosts.

EG with dhclient:

$ dhclient -r <INT-NAME> && dhclient <INT-NAME>

Where <INT-NAME> is the name of the interface on which the lease need to
be released and acquired.
--
John Doe
Geert Stappers
2018-12-06 18:56:47 UTC
Permalink
Post by john doe
Post by jmperrote
Post by jmperrote
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth1,6,10.11.37.15 #dns primario
dhcp-option=eth1,1,255.255.255.0 # mascara de red
dhcp-option=eth1,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth2,6,10.11.37.15 #dns primario
dhcp-option=eth2,1,255.255.255.0 # mascara de red
dhcp-option=eth2,option:router,10.11.237.1 # gateway
Hello, ok trying a solution to resolv dnsmasq with vlans and one nic, I
do next
I reconfigured the dnsmasq with this and the mikrotik router with tagged
vlans.
dhcp-range=tag:eth0,set:eth0,10.11.37.50,10.11.37.200,6h
dhcp-range=tag:eth0,set:eth0,10.11.137.50,10.11.137.200,6h
dhcp-range=tag:eth0,set:eth0,10.11.237.50,10.11.237.200,6h
dhcp-option=tag:eth0,option:dns-server,10.11.37.15
dhcp-option=tag:eth0,option:dns-server,10.11.37.15
dhcp-option=tag:eth0,option:dns-server,10.11.37.15
dhcp-option=tag:eth0,option:router,10.11.137.1
dhcp-option=tag:eth0,option:router,10.11.37.1
dhcp-option=tag:eth0,option:router,10.11.237.1
Check the above config again.

| dhcp-range=tag:eth0.37,set:eth0,10.11.37.50,10.11.37.200,6h
| dhcp-range=tag:eth0.137,set:eth0,10.11.137.50,10.11.137.200,6h
| dhcp-range=tag:eth0.237,set:eth0,10.11.237.50,10.11.237.200,6h
| dhcp-option=tag:eth0.37,option:dns-server,10.11.37.15
| dhcp-option=tag:eth0.137,option:dns-server,10.11.37.15
| dhcp-option=tag:eth0.237,option:dns-server,10.11.37.15
| dhcp-option=tag:eth0.137,option:router,10.11.137.1
| dhcp-option=tag:eth0.37,option:router,10.11.37.1
| dhcp-option=tag:eth0.237,option:router,10.11.237.1

Is what I would expect.
Post by john doe
Post by jmperrote
The assign of ip work fine, each PC on each vlan pickup a IP on
corresponding vlan, but on 3 PCs allways assign the same gateway -->
10.11.237.1
If it is working for most of the hosts,
If, only if.
Post by john doe
my guess is that you need to renew the lease on those hosts.
$ dhclient -r <INT-NAME> && dhclient <INT-NAME>
Where <INT-NAME> is the name of the interface on which the lease need to
be released and acquired.
No, start with a static address at the clients.
Then check if connecting the "dnsmasq host with 3 VLANID" works.
Me and Murphy say that it doesn't work.
I say that the switch needs additional configuration.
Feel free to proof me wrong.


Groeten
Geert Stappers
--
Leven en laten leven
john doe
2018-12-05 15:40:16 UTC
Permalink
Post by jmperrote
Post by john doe
Post by jmperrote
We need help to configure dnsmasq with vlans tagged on router.
We actually have a dnsmasq server serving dns and dhcp, and 3 nics, one
dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0,6,10.11.37.15 #dns primario
dhcp-option=eth0,1,255.255.255.0 # mascara de red
dhcp-option=eth0,option:router,10.11.237.1 # gateway
Know we are migratting to a dnsmasq solution with one nic a tagged
dhcp-range=tag:vlan37,set:VLAN_37,10.11.37.50,10.11.37.200,6h
dhcp-range=tag:vlan137,set:VLAN_137,10.11.137.50,10.11.137.200,6h
dhcp-range=tag:vlan237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=tag:vlan37,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:dns-server,10.11.37.15
dhcp-option=tag:vlan237,option:dns-server,10.11.37.15
dhcp-option=tag:vlan137,option:router,10.11.137.1
dhcp-option=tag:vlan37,option:router,10.11.37.1
dhcp-option=tag:vlan237,option:router,10.11.237.1
But all clients recive allways the same gateway, 10.11.237.1
I'm not sure to fully understand the issue(s) you are facing.
As far as dnsmasq is concerned, there is no differences between 3
physical "nicks" and 3 VLAN tagged interfaces  (802.1Q).
# Specify DHCP range with a tag
dhcp-range=set:vlan99,172.23.100.200,172.23.100.230,12h
dhcp-range=set:vlan100,172.23.101.200,172.23.101.230,12h
dhcp-range=set:vlan100,172.23.102.200,172.23.102.230,12h
    dhcp-range=interface:eth0,set:VLAN_37,10.11.37.50,10.11.37.200,6h
    dhcp-option=eth0,6,10.11.37.15 #dns primario
    dhcp-option=eth0,1,255.255.255.0 # mascara de red
    dhcp-option=eth0,option:router,10.11.37.1 # gateway
    dhcp-range=interface:eth1,set:VLAN_137,10.11.137.90,10.11.137.98,6h
    dhcp-option=eth1,6,10.11.37.15 #dns primario
    dhcp-option=eth1,1,255.255.255.0 # mascara de red
    dhcp-option=eth1,option:router,10.11.137.1 # gateway
    dhcp-range=interface:eth2,set:VLAN_237,10.11.237.50,10.11.237.200,6h
    dhcp-option=eth2,6,10.11.37.15 #dns primario
    dhcp-option=eth2,1,255.255.255.0 # mascara de red
    dhcp-option=eth2,option:router,10.11.237.1 # gateway
We have 3 nics on the system eth0/eth1/eth2, one for each VLAN, and try
to replace for one nic with VLANs tagged.
We try the tag option and the dhcp assign ip on correct range for each
PC on each vlan, but dnsmasq allways assign to the PC the same gateway,
that is the las vlan configured.
For example on this configuraton assign the correct range to the PC, but
the gateway always assign 10.11.237.1 gateway, to all PC
dhcp-range=interface:eth0.37,set:VLAN_37,10.11.37.90,10.11.37.98,6h
dhcp-option=eth0.37,6,10.11.37.15 #dns primario
dhcp-option=eth0.37,1,255.255.255.0 # mascara de red
dhcp-option=eth0.37,option:router,10.11.37.1 # gateway
dhcp-range=interface:eth0.137,set:VLAN_137,10.11.137.90,10.11.137.98,6h
dhcp-option=eth0.137,6,10.11.37.15 #dns primario
dhcp-option=eth0.137,1,255.255.255.0 # mascara de red
dhcp-option=eth0.137,option:router,10.11.137.1 # gateway
dhcp-range=interface:eth0.237,set:VLAN_237,10.11.237.50,10.11.237.200,6h
dhcp-option=eth0.237,6,10.11.37.15 #dns primario
dhcp-option=eth0.237,1,255.255.255.0 # mascara de red
dhcp-option=eth0.237,option:router,10.11.237.1 # gateway
It is necessary to use "vconfig" to configure virtual vlan interface on
the operating system, or can use tagged vlans from the router ?
 - What hardware is the router (netgear, cisco ...)?
 - What type of distribution (name and version) are you using 'vconfig'
on (Linux, Oracle)?
I can't answer your question without knowing your network topology, but
if the router is VLAN tagging capable I would use it and also use the
DHCP capability from that router.
Also, to isolate whether it is a vlan configuration or a dnsmasq issue
simply try the line I have provided, obviously you can change the Ip
ranges to your liking.
Hello john doe,
 -- Router mikrotik RB1100 AH
 -- Ubuntu 16.04
 -- Using vconfig with 3 VLANs
Yes, the router have capabilitie to dhcp, you recommend to use that
instead of dnsmasq for dhcp ?.
The only reason why i menssioned the router is because it might be
easier to configure vlan tagging and dhcp there! :)


Here is my understanding of your network topology, is that correct?:

The router (mikrotik RB1100 AH) is connected to the wan interface of
the Ubuntu box and the rest of your network is behind that Ubuntu box

router -- ubuntu box -- devices(switch ...) supporting IEEE 802.1q



It's been ages since I've used 'vconfig' and I won't be able to help you
configure VLAN tagging using vconfig (see (1)).
However, Ubuntu 16.0* supports Systemd which can configure VLAN tagged
interface.


When you are sure that your VLANs (1) are working properly, you can then
add dnsmasq into the mix.

Also, why is your DNS server directive pointing to "10.11.37.15"?

1) https://wiki.ubuntu.com/vlan
--
John Doe
Loading...