El 2018-12-06 15:56, Geert Stappers escribió:
On Thu, Dec 06, 2018 at 06:52:11PM +0100, john doe wrote:
On 12/6/2018 3:50 PM, jmperrote wrote:
>>>> dhcp-option=eth0,6, #dns primario
>>>> dhcp-option=eth0,1, # mascara de red
>>>> dhcp-option=eth0,option:router, # gateway
>>>> dhcp-range=interface:eth1,set:VLAN_137,,,6h
>>>> dhcp-option=eth1,6, #dns primario
>>>> dhcp-option=eth1,1, # mascara de red
>>>> dhcp-option=eth1,option:router, # gateway
>>>> dhcp-range=interface:eth2,set:VLAN_237,,,6h
>>>> dhcp-option=eth2,6, #dns primario
>>>> dhcp-option=eth2,1, # mascara de red
>>>> dhcp-option=eth2,option:router, # 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,,,6h
> dhcp-range=tag:eth0,set:eth0,,,6h
> dhcp-range=tag:eth0,set:eth0,,,6h
> dhcp-option=tag:eth0,option:dns-server,
> dhcp-option=tag:eth0,option:dns-server,
> dhcp-option=tag:eth0,option:dns-server,
> dhcp-option=tag:eth0,option:router,
> dhcp-option=tag:eth0,option:router,
> dhcp-option=tag:eth0,option:router,

Check the above config again.

| dhcp-range=tag:eth0.37,set:eth0,,,6h
| dhcp-range=tag:eth0.137,set:eth0,,,6h
| dhcp-range=tag:eth0.237,set:eth0,,,6h
| dhcp-option=tag:eth0.37,option:dns-server,
| dhcp-option=tag:eth0.137,option:dns-server,
| dhcp-option=tag:eth0.237,option:dns-server,
| dhcp-option=tag:eth0.137,option:router,
| dhcp-option=tag:eth0.37,option:router,
| dhcp-option=tag:eth0.237,option:router,

Is what I would expect.

> 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 -->

If it is working for most of the hosts,

If, only if.

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.

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.

Geert Stappers

Finally we find a solution for dnsmasq with vlans


#propiedades genericas
dhcp-option=6, #dns primario
dhcp-option=1, # mascara de red

dhcp-option=tag:vlan37,3, # #gateway/router
dhcp-option=tag:vlan37,28, # broadcast

dhcp-option=tag:vlan137,3, #gateway/router
dhcp-option=tag:vlan137,28, #broadcast

dhcp-option=tag:vlan237,3, #gateway/router
dhcp-option=tag:vlan237,28, #broadcast

The last problem was "dnmasq allways assign the same router for all clients" the solution was use the tag: option on dnsmasq.conf to identified the vlan comming the request. On the dnsmasq log Just next on the request we found -->

dnsmasq-dhcp[7800]: 2756951124 DHCPREQUEST(eth0) 00:0a:e6:bf:1c:5d
Dec 10 12:30:59 dnsmasq-dhcp[7800]: 2756951124 tags: vlan237, eth0

The tag entry mark the vlans where become the request, so we to adjust the dnsmasq.conf to tell that use tag option on each option we want, for example on the roiter option.


Dnsmasq-discuss mailing list

Reply via email to