[Dnsmasq-discuss] Tagging by interface?

Quintus quintus at quintilianus.eu
Tue Sep 3 12:42:54 BST 2013


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

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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20130903/f5c6148f/attachment.pgp>


More information about the Dnsmasq-discuss mailing list