Discussion:
[Dnsmasq-discuss] doc issue: dhcp on multiple interfaces
Harald Dunkel
2018-04-26 10:31:27 UTC
Permalink
Hi folks,
maybe I am too blind to see, but apparently something like
    dhcp-range=em1,10.0.0.10,10.0.0.254,12h
    dhcp-range=em2,10.0.1.10,10.0.1.254,12h
is not mentioned in the man page. Is it possible that the
interface part was lost?
PS: is it

dhcp-range=::,constructor:em1,ra-stateless,ra-names
dhcp-range=::,constructor:em2,ra-stateless,ra-names
or
dhcp-range=em1,::,constructor:em1,ra-stateless,ra-names
dhcp-range=em2,::,constructor:em2,ra-stateless,ra-names

?

Regards
Harri
Chris Novakovic
2018-04-26 11:03:33 UTC
Permalink
maybe I am too blind to see, but apparently something like
    dhcp-range=em1,10.0.0.10,10.0.0.254,12h
    dhcp-range=em2,10.0.1.10,10.0.1.254,12h
is not mentioned in the man page. Is it possible that the
interface part was lost?
If you're referring to the ability to limit particular DHCP ranges to
particular interfaces, the information's all in there (albeit admittedly
The tag system works as follows: For each DHCP request, dnsmasq collects a set of valid tags from active configuration lines which include set:<tag>, including one from the dhcp-range used to allocate the address, one from any matching dhcp-host (and "known" or "known-othernet" if a dhcp-host matches) The tag "bootp" is set for BOOTP requests, and a tag whose name is the name of the interface on which the request arrived is also set.
-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-addr>[,<end-addr>|<mode>][,<netmask>[,<broadcast>]][,<lease time>]
-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-IPv6addr>[,<end-IPv6addr>|constructor:<interface>][,<mode>][,<prefix-len>][,<lease time>]
[...]
The optional set:<tag> sets an alphanumeric label which marks this network so that dhcp options may be specified on a per-network basis. When it is prefixed with 'tag:' instead, then its meaning changes from setting a tag to matching it. Only one tag may be set, but more than one tag may be matched.
Harald Dunkel
2018-04-26 11:52:07 UTC
Permalink
Post by Chris Novakovic
If you're referring to the ability to limit particular DHCP ranges to
particular interfaces, the information's all in there (albeit admittedly
The tag system works as follows: For each DHCP request, dnsmasq collects a set of valid tags from active configuration lines which include set:<tag>, including one from the dhcp-range used to allocate the address, one from any matching dhcp-host (and "known" or "known-othernet" if a dhcp-host matches) The tag "bootp" is set for BOOTP requests, and a tag whose name is the name of the interface on which the request arrived is also set.
-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-addr>[,<end-addr>|<mode>][,<netmask>[,<broadcast>]][,<lease time>]
-F, --dhcp-range=[tag:<tag>[,tag:<tag>],][set:<tag>,]<start-IPv6addr>[,<end-IPv6addr>|constructor:<interface>][,<mode>][,<prefix-len>][,<lease time>]
[...]
The optional set:<tag> sets an alphanumeric label which marks this network so that dhcp options may be specified on a per-network basis. When it is prefixed with 'tag:' instead, then its meaning changes from setting a tag to matching it. Only one tag may be set, but more than one tag may be matched.
So it should be

dhcp-range=tag:em1,10.0.0.10,10.0.0.254,12h
dhcp-range=tag:em2,10.0.1.10,10.0.1.254,12h

Or is it

dhcp-range=set:em1,10.0.0.10,10.0.0.254,12h
dhcp-range=set:em2,10.0.1.10,10.0.1.254,12h

? If I omit the "tag:" and "set:", which one is it?
Chris Novakovic
2018-04-26 12:07:20 UTC
Permalink
Post by Harald Dunkel
So it should be
    dhcp-range=tag:em1,10.0.0.10,10.0.0.254,12h
    dhcp-range=tag:em2,10.0.1.10,10.0.1.254,12h
Or is it
    dhcp-range=set:em1,10.0.0.10,10.0.0.254,12h
    dhcp-range=set:em2,10.0.1.10,10.0.1.254,12h
Assuming your intention is to restrict DHCP ranges to particular
interfaces, you should use "tag:".
Post by Harald Dunkel
If I omit the "tag:" and "set:", which one is it?
That appears to be undefined behaviour, according to the man page. :)
Harald Dunkel
2018-04-26 13:03:24 UTC
Permalink
Post by Chris Novakovic
Post by Harald Dunkel
So it should be
    dhcp-range=tag:em1,10.0.0.10,10.0.0.254,12h
    dhcp-range=tag:em2,10.0.1.10,10.0.1.254,12h
Or is it
    dhcp-range=set:em1,10.0.0.10,10.0.0.254,12h
    dhcp-range=set:em2,10.0.1.10,10.0.1.254,12h
Assuming your intention is to restrict DHCP ranges to particular
interfaces, you should use "tag:".
Post by Harald Dunkel
If I omit the "tag:" and "set:", which one is it?
That appears to be undefined behaviour, according to the man page. :)
This system evolved from an earlier, more limited one and for backward
compatibility "net:" may be used instead of "tag:" and "set:" may be
omitted.
Using either "tag:" or "set:" should be considered mandatory. Sometimes
old, replaced features should be dropped.


Thanx for your help
Harri
Chris Novakovic
2018-04-26 12:07:25 UTC
Permalink
Post by Harald Dunkel
So it should be
    dhcp-range=tag:em1,10.0.0.10,10.0.0.254,12h
    dhcp-range=tag:em2,10.0.1.10,10.0.1.254,12h
Or is it
    dhcp-range=set:em1,10.0.0.10,10.0.0.254,12h
    dhcp-range=set:em2,10.0.1.10,10.0.1.254,12h
Assuming your intention is to restrict DHCP ranges to particular
interfaces, you should use "tag:".
Post by Harald Dunkel
If I omit the "tag:" and "set:", which one is it?
That appears to be undefined behaviour, according to the man page. :)
Geert Stappers
2018-04-26 12:50:53 UTC
Permalink
maybe I am too blind to see, but apparently something like
dhcp-range=em1,10.0.0.10,10.0.0.254,12h
dhcp-range=em2,10.0.1.10,10.0.1.254,12h
is not mentioned in the man page. Is it possible that the
interface part was lost?
range 10.0.0.10...10.0.0.254 is for interface in that range
range 10.0.1.10...10.0.1.254 is for interface in that range


Back to
Is it possible that the interface part was lost?
There is no need to manual map an interface to a DHCP-range.

If there is a deeper problem behind the original question,
then please express yourself.


Groeten
Geert Stappers
--
Leven en laten leven
Harald Dunkel
2018-04-27 06:29:39 UTC
Permalink
Post by Geert Stappers
maybe I am too blind to see, but apparently something like
dhcp-range=em1,10.0.0.10,10.0.0.254,12h
dhcp-range=em2,10.0.1.10,10.0.1.254,12h
is not mentioned in the man page. Is it possible that the
interface part was lost?
range 10.0.0.10...10.0.0.254 is for interface in that range
range 10.0.1.10...10.0.1.254 is for interface in that range
The interface "em1" has the IP address 10.0.0.2, i.e. it is not
in this range. Same goes for em2.

I would guess that dnsmasq looks at the netmask in this case?


Regards
Harri

Continue reading on narkive:
Loading...