[Dnsmasq-discuss] dhcp-options ignored for tag

John Hanks john.hanks at colorado.edu
Tue Feb 7 16:37:31 GMT 2012


Hi,

I'm trying to get dnsmasq to return multiple DNS server entries for
one of our vlans using tags and am not having much success. Variations
of dhcp-range I've tried are:

dhcp-range=set:vlan2210,10.210.254.1,10.210.254.255,255.255.0.0,1d
dhcp-range=vlan2210,10.210.254.1,10.210.254.255,255.255.0.0,1d
dhcp-range=net:vlan2210,10.210.254.1,10.210.254.255,255.255.0.0,1d
dhcp-range=tag:vlan2210,10.210.254.1,10.210.254.255,255.255.0.0,1d

Then, the options for that tag are:

dhcp-option=tag:vlan2210,3
dhcp-option=tag:vlan2210,15,"specialdomain.colorado.edu"
dhcp-option=tag:vlan2210,6,10.210.32.1,10.210.32.2
dhcp-option=tag:vlan2210,66,10.210.32.1

I've tried those both with tag: and without by just putting in the
vlan2210 netid.

I've enabled log-dhcp and when the client gets a lease for all
permutations above, dnsmasq logs:

Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 available DHCP range:
10.210.254.1 -- 10.210.254.255
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 DHCPREQUEST(vlan2210)
10.210.33.2 00:0c:29:9a:d9:7e
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 tags: known, vlan2210
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 DHCPACK(vlan2210)
10.210.33.2 00:0c:29:9a:d9:7e bflogin00
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 requested options:
1:netmask, 28:broadcast, 2:time-offset, 121:classless-static-route,
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 requested options:
15:domain-name, 6:dns-server, 12:hostname,
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 requested options:
40:nis-domain, 41:nis-server, 42:ntp-server,
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 requested options:
26:mtu, 119:domain-search, 3:router
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 bootfile name: pxelinux.0
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 next server: 10.210.32.1
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 sent size:  1 option:
53:message-type  05
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 sent size:  4 option:
54:server-identifier  10.210.32.1
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 sent size:  4 option:
51:lease-time  ff:ff:ff:ff
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 sent size:  4 option:
1:netmask  255.255.0.0
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 sent size:  4 option:
28:broadcast  10.210.255.255
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 sent size:  4 option:
3:router  10.210.32.1
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 sent size:  4 option:
6:dns-server  10.210.32.1
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 sent size: 25 option:
15:domain-name  biofrontiers.colorado.edu
Feb  7 09:07:52 dnsmasq-dhcp[8301]: 1523440438 sent size:  9 option:
12:hostname  bflogin00

Which implies to me that the tag is set correctly, but the options I
have for that tag are ignored for both dns-server and domain-name.
Since vlan2210 is also my interface name, I repeated the above after
s/vlan2210/bfgeneral/ in all the configs, after that change the logs
say:

Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 DHCPREQUEST(vlan2210)
10.210.33.3 00:0c:29:79:55:14
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 tags: bfgeneral, known, vlan2210
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 DHCPACK(vlan2210)
10.210.33.3 00:0c:29:79:55:14 bflogin01
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 requested options:
1:netmask, 28:broadcast, 2:time-offset, 121:classless-static-route,
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 requested options:
15:domain-name, 6:dns-server, 12:hostname,
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 requested options:
40:nis-domain, 41:nis-server, 42:ntp-server,
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 requested options:
26:mtu, 119:domain-search, 3:router
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 bootfile name: pxelinux.0
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 next server: 10.210.32.1
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 sent size:  1 option:
53:message-type  05
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 sent size:  4 option:
54:server-identifier  10.210.32.1
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 sent size:  4 option:
51:lease-time  ff:ff:ff:ff
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 sent size:  4 option:
1:netmask  255.255.0.0
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 sent size:  4 option:
28:broadcast  10.210.255.255
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 sent size:  4 option:
3:router  10.210.32.1
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 sent size:  4 option:
6:dns-server  10.210.32.1
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 sent size: 25 option:
15:domain-name  biofrontiers.colorado.edu
Feb  7 09:32:25 dnsmasq-dhcp[9046]: 2473797216 sent size:  9 option:
12:hostname  bflogin01

Other details that might matter, my dhcp-hosts and dhcp-options are
included from directories with

dhcp-hostsfile=/etc/dnsmasq.dhcphosts.d
dhcp-optsfile=/etc/dnsmasq.dhcpoptions.d

It looks like this is working, at least when starting dnsmasq I see logged:

Feb  7 09:10:11 dnsmasq-dhcp[8414]: read /etc/dnsmasq.dhcphosts.d/VLAN_2210.dhcp
Feb  7 09:10:11 dnsmasq-dhcp[8414]: read
/etc/dnsmasq.dhcpoptions.d/VLAN_2210.conf

I'm using dnsmasq 2.59 on RedHat Linux 6.2. Other than ignoring my tag
specific options, everything is working fine. Any hints as to what I'm
doing wrong or a simple example of how to use network specific
dhcp-options would be appreciated.

Thanks,

jbh



More information about the Dnsmasq-discuss mailing list