[Dnsmasq-discuss] #known, set:, tag:, and dhcp-helper..

B. Cook bcook at poughkeepsieschools.org
Wed Apr 16 21:36:14 UTC 2014


Trying to do this in dnsmasq without having to build scripts to sed/awk..

I have a default global.conf which looks like this:

conf-file=/etc/dnsmasq.d/allow.dhcp
dhcp-ignore=#known

conf-file=/etc/dnsmasq.d/dnsmasq.bldg1.dhcp  # 10.20.0/20
conf-file=/etc/dnsmasq.d/dnsmasq.bldg2.dhcp  # 10.20.16/20
conf-file=/etc/dnsmasq.d/dnsmasq.bldg3.dhcp  # 10.20.32/20

at the top of each bldg[1,2,3].dhcp I have this:

domain=bldg1.lan,10.20.0.0/20
dhcp-range=bldg1,10.20.12.1,10.20.14.254,255.255.240.0,4h
dhcp-option=bldg1,option:router,10.20.0.1
dhcp-option=bldg1,option:domain-name,bldg1.lan
..
dhcp-host=00:11:22:33:44:55:66,10.20.11.295,name-ipad
..
conf-file=/etc/dnsmasq.d/allow.dhcp

..

So what I have is a setup that for each building there are ranges of
allowed (10.20.12-10.20.14 in this case) for the allow.dhcp hosts to
end up in.

Question 1) if I do not have the allow.dhcp as the first line of the
global.conf AND the last line of the bldg.dhcp this does not work..

I am looking to have a set of devices (with known mac addresses) to be
in a group (administration).. but I want this group to be a part of
each building.  I want these devices to pull from a different
pool/range of addresses.

so in building1 the ip range I would like them to use is
10.20.11.1-11.254. (I think this is tag or set; either of which I can
not get to work correctly)

so in building2 this same set of mac addresss would be
10.20.27.1-27.254. Same tag/set (administration).

Currently I have 50 or so of these devices in each building config,
when someone gets one or two more devices.. I'm editing twelve config
files :P - oops made a typo.. go fix it.

I'm looking for something like another include file:

administration.dhcp
dhcp-host=set:administration,11:22:33:44:55:66,username-device

then in each building config
dhcp-range=tag:administration,10.20.11.1,10.20.11.254,2h

Which would assign a user an ip from the tag'ged administration rage
(when they are in that building) and a different range when they are
in another building.

I am not able to figure out where the problem lies (in my syntax or
logic) but the end result is that this pseudo-code when made into
actual configs does not work as intended.

Currently running this on a CentOS 6.5 machine, dnsmasq 2.68 self
built/compiled rpm.

Thank you for taking the time to read and possibly respond to this request.



More information about the Dnsmasq-discuss mailing list