[Dnsmasq-discuss] Tagging by interface?

Albert ARIBAUD albert.aribaud at free.fr
Tue Sep 3 12:53:39 BST 2013


Albert[us] Quitum salutem dat,

Le 03/09/2013 13:42, Quintus a écrit :
> Hi guys,
>
> I’m trying to get dnsmasq to provide IPs from different ranges based on
> the interface the requests come in. That is, I want it to provide
> different IPs for wired clients (interface eth0) and wireless clients
> (interface wlan0, hostapd already running correctly).
>
> I tried the following configuration, which does what I want:
>
> ---------------------------------------------
> dhcp-range=interface:eth0,10.37.59.3,10.37.59.62,12h
> dhcp-range=interface:wlan0,10.37.59.200,10.37.59.210,12h
> ---------------------------------------------
>
> (btw. where’s that "interface:" command documented? I didn’t find it in
> dnsmasq’s manpage, but only while googling)
>
> Now however I want to push some static routes to the clients. Googling
> turned up
> https://lists.openswan.org/pipermail/users/2012-May/021590.html
> (referencing RFC 3442), which looks good and should work. However, this
> means I need to tag my connections. So I tried tried this instead:
>
> ---------------------------------------------
> dhcp-range=set:wired,interface:eth0,10.37.59.3,10.37.59.62,12h
> dhcp-range=set:wifi,interface:wlan0,10.37.59.200,10.37.59.210,12h
>
> ...
>
> dhcp-option=tag:wired,121,10.37.59.192/26,10.37.59.2
> dhcp-option=tag:wifi,249,10.37.59.0/26,10.37.59.199
> ---------------------------------------------
>
> But dnsmasq rejects this configuration as invalid:
>
> ---------------------------------------------
> dnsmasq[12066]: dnsmasq: only one tag allowed at line 37
> of /etc/dnsmasq.conf
> dnsmasq[12066]: only one tag allowed at line 37 of /etc/dnsmasq.conf
> dnsmasq[12066]: FAILED to start up
> ---------------------------------------------
>
> Line 37 is this one, which has already been shown above:
>
> ---------------------------------------------
> dhcp-range=set:wired,interface:eth0,10.37.59.3,10.37.59.62,12h
> ---------------------------------------------

Did you try moving the 'set:wired' specification after the 
'interface:eth0' one? I.e.,

      dhcp-range=interface:eth0,set:wired,10.37.59.3,10.37.59.62,12h

> My full (obfuscated) /etc/dnsmasq.conf can be seen here:
> http://pastie.org/8294145
>
> So the basic question is: How do I both specify address ranges by
> interface and simultaneously tag connections from that interface for
> later use in `dhcp-option'?
>
> Valete,
> Marvin

Amicalement,
-- 
Albert.



More information about the Dnsmasq-discuss mailing list