Static rules messing with DHCPD config
-
I seem to have a repeatable problem with modifications to the static ip assignments. It is possible that it is because I am trying to use integers for my hostname and there is some sort of sanity check, but I am not sure.
Platform info for 1G install:
Version 2.0-BETA1
built on Tue Apr 13 16:36:22 EDT 2010
FreeBSD 8.0-STABLE
Platform nanobsd
NanoBSD Boot Slice pfsense0 / ad0s1a
CPU Type Geode(TM) Integrated Processor by AMD PCSThe problem manifests itself both when I try and edit the xml config file to upload back my static assignments, as well as when I just use the gui to add a static mapping for a single mac address. The problem occurs when the changes are "applied" in the form of DHCPD going down and not coming back up even when I try clicking the little start service button next to it in the Status:Services window. I have repeated this issue several times (re-installing) before I realized that it was happening with the static assignments that had solely numeric hostnames.
I'm enough of a noob to possibly be missing a faux pas regarding using numbers for a hostname; I was simply trying to use them as a simple means of expressing extensions on a voip system.Log file follows, I think one can see the failures early, finishing with my reverting to a config that had no static assignees and reloading…
Apr 19 09:24:34 dnsmasq[35631]: read /etc/hosts - 7 addresses Apr 19 09:24:35 dhcpd: Internet Systems Consortium DHCP Server V3.0.7 Apr 19 09:24:35 dhcpd: Copyright 2004-2008 Internet Systems Consortium. Apr 19 09:24:35 dhcpd: All rights reserved. Apr 19 09:24:35 dhcpd: For info, please visit http://www.isc.org/sw/dhcp/ Apr 19 09:24:00 last message repeated 2 times Apr 19 09:24:35 dhcpd: /var/dhcpd/etc/dhcpd.conf line 40: expecting string. Apr 19 09:24:35 dhcpd: /var/dhcpd/etc/dhcpd.conf line 40: expecting string. Apr 19 09:24:35 dhcpd: option host-name 127; Apr 19 09:24:35 dhcpd: option host-name 127; Apr 19 09:24:35 dhcpd: ^ Apr 19 09:24:35 dhcpd: ^ Apr 19 09:24:35 dhcpd: Configuration file errors encountered -- exiting Apr 19 09:24:35 dhcpd: Configuration file errors encountered -- exiting Apr 19 09:24:35 php: /services_dhcp.php: The command '/usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /var/dhcpd/etc/dhcpd.conf vr0' returned exit code '1', the output was 'Internet Systems Consortium DHCP Server V3.0.7 Copyright 2004-2008 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/sw/dhcp/ /var/dhcpd/etc/dhcpd.conf line 40: expecting string. option host-name 127; ^ Configuration file errors encountered -- exiting' Apr 19 09:24:49 dhcpd: Internet Systems Consortium DHCP Server V3.0.7 Apr 19 09:24:49 dhcpd: Copyright 2004-2008 Internet Systems Consortium. Apr 19 09:24:49 dhcpd: All rights reserved. Apr 19 09:24:49 dhcpd: For info, please visit http://www.isc.org/sw/dhcp/ Apr 19 09:24:49 dhcpd: /var/dhcpd/etc/dhcpd.conf line 40: expecting string. Apr 19 09:24:49 dhcpd: /var/dhcpd/etc/dhcpd.conf line 40: expecting string. Apr 19 09:24:49 dhcpd: option host-name 127; Apr 19 09:24:49 dhcpd: option host-name 127; Apr 19 09:24:49 dhcpd: ^ Apr 19 09:24:49 dhcpd: ^ Apr 19 09:24:49 dhcpd: Configuration file errors encountered -- exiting Apr 19 09:24:49 dhcpd: Configuration file errors encountered -- exiting Apr 19 09:24:49 php: /status_services.php: The command '/usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /var/dhcpd/etc/dhcpd.conf vr0' returned exit code '1', the output was 'Internet Systems Consortium DHCP Server V3.0.7 Copyright 2004-2008 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/sw/dhcp/ /var/dhcpd/etc/dhcpd.conf line 40: expecting string. option host-name 127; ^ Configuration file errors encountered -- exiting' Apr 19 09:24:58 dhcpd: Internet Systems Consortium DHCP Server V3.0.7 Apr 19 09:24:58 dhcpd: Copyright 2004-2008 Internet Systems Consortium. Apr 19 09:24:58 dhcpd: All rights reserved. Apr 19 09:24:58 dhcpd: For info, please visit http://www.isc.org/sw/dhcp/ Apr 19 09:24:58 dhcpd: /var/dhcpd/etc/dhcpd.conf line 40: expecting string. Apr 19 09:24:58 dhcpd: /var/dhcpd/etc/dhcpd.conf line 40: expecting string. Apr 19 09:24:58 dhcpd: option host-name 127; Apr 19 09:24:58 dhcpd: option host-name 127; Apr 19 09:24:58 dhcpd: ^ Apr 19 09:24:58 dhcpd: ^ Apr 19 09:24:58 dhcpd: Configuration file errors encountered -- exiting Apr 19 09:24:58 dhcpd: Configuration file errors encountered -- exiting Apr 19 09:24:58 php: /status_services.php: The command '/usr/local/sbin/dhcpd -user dhcpd -group _dhcp -chroot /var/dhcpd -cf /var/dhcpd/etc/dhcpd.conf vr0' returned exit code '1', the output was 'Internet Systems Consortium DHCP Server V3.0.7 Copyright 2004-2008 Internet Systems Consortium. All rights reserved. For info, please visit http://www.isc.org/sw/dhcp/ /var/dhcpd/etc/dhcpd.conf line 40: expecting string. option host-name 127; ^ Configuration file errors encountered -- exiting' Apr 19 09:25:03 check_reload_status: syncing firewall Apr 19 09:25:48 dhcpd: Internet Systems Consortium DHCP Server V3.0.7 Apr 19 09:25:48 dhcpd: Copyright 2004-2008 Internet Systems Consortium. Apr 19 09:25:48 dhcpd: All rights reserved. Apr 19 09:25:48 dhcpd: For info, please visit http://www.isc.org/sw/dhcp/
I hope this helps, I really like the way 2.0 is looking! Thank you everyone for all of the hard work.
arri -
Please post the contents of /var/dhcpd/etc/dhcpd.conf and the dhcpd portion of your config.xml
-
dhcpd.conf in working order:
option domain-name "key.lan"; option ldap-server code 95 = text; option domain-search-list code 119 = text; default-lease-time 7200; max-lease-time 86400; log-facility local7; ddns-update-style none; one-lease-per-client true; deny duplicates; ping-check true; authoritative; subnet 10.28.0.0 netmask 255.255.0.0 { pool { range 10.28.68.150 10.28.68.240; } option routers 10.28.68.1; option domain-name-servers 10.28.68.1; } host s_lan_0 { hardware ethernet 00:23:69:4e:ec:a7; fixed-address 10.28.68.7; option host-name dancinap; } host s_lan_1 { hardware ethernet 00:15:6d:b5:12:b7; fixed-address 10.28.68.30; option host-name ubntupstairs; } host s_lan_2 { hardware ethernet 00:15:6d:b5:29:a4; fixed-address 10.28.68.31; option host-name ubntcontrol; } host s_lan_3 { hardware ethernet 00:15:6d:b6:54:83; fixed-address 10.28.68.33; option host-name UBNTWifiAP; } host s_lan_4 { hardware ethernet 00:13:20:2d:03:02; fixed-address 10.28.68.40; option host-name oban; } host s_lan_5 { hardware ethernet 00:1f:d0:81:a5:24; fixed-address 10.28.68.45; option host-name MAMBA; } host s_lan_6 { hardware ethernet 00:15:99:62:bc:4a; fixed-address 10.28.68.79; option host-name printershipping; } host s_lan_7 { hardware ethernet 00:08:5d:1b:a3:90; fixed-address 10.28.68.101; option host-name ext101; } host s_lan_8 { hardware ethernet 00:08:5d:10:9d:fc; fixed-address 10.28.68.127; option host-name ext27; }
-
XML in working order:
<dhcpd><lan><enable><range><from>10.28.68.150</from> <to>10.28.68.240</to></range> <defaultleasetime><maxleasetime><netmask><failover_peerip><gateway><domain><domainsearchlist><ddnsdomain><tftp><ldap><next-server><filename><rootpath><staticmap><mac>00:23:69:4e:ec:a7</mac> <ipaddr>10.28.68.7</ipaddr> <hostname>dancinap</hostname> <descr>Access point and router at Dan's house</descr></staticmap> <staticmap><mac>00:15:6d:b5:12:b7</mac> <ipaddr>10.28.68.30</ipaddr> <hostname>ubntupstairs</hostname> <descr>Powerstation 5 upstairs on office roof</descr></staticmap> <staticmap><mac>00:15:6d:b5:29:a4</mac> <ipaddr>10.28.68.31</ipaddr> <hostname>ubntcontrol</hostname> <descr>Nanostation 5 at Control Room on Plant 1 roof</descr></staticmap> <staticmap><mac>00:15:6d:b6:54:83</mac> <ipaddr>10.28.68.33</ipaddr> <hostname>UBNTWifiAP</hostname> <descr>Upstairs access point for wifi</descr></staticmap> <staticmap><mac>00:13:20:2d:03:02</mac> <ipaddr>10.28.68.40</ipaddr> <hostname>oban</hostname></staticmap> <staticmap><mac>00:1f:d0:81:a5:24</mac> <ipaddr>10.28.68.45</ipaddr> <hostname>MAMBA</hostname> <descr>Edgar's Desk has two adapters</descr></staticmap> <staticmap><mac>00:15:99:62:bc:4a</mac> <ipaddr>10.28.68.79</ipaddr> <hostname>printershipping</hostname> <descr>West Shipping Dock</descr></staticmap> <staticmap><mac>00:08:5d:1b:a3:90</mac> <ipaddr>10.28.68.101</ipaddr> <hostname>ext101</hostname> <descr>aastra 57i</descr></staticmap> <staticmap><mac>00:08:5d:10:9d:fc</mac> <ipaddr>10.28.68.127</ipaddr> <hostname>ext27</hostname> <descr>aastra 57i</descr></staticmap></rootpath></filename></next-server></ldap></tftp></ddnsdomain></domainsearchlist></domain></gateway></failover_peerip></netmask></maxleasetime></defaultleasetime></enable></lan> <opt1><staticmap><mac>00:15:99:62:bc:4a</mac> <ipaddr>10.28.69.79</ipaddr> <hostname>printshipping</hostname> <descr>West Shipping Dock</descr></staticmap></opt1></dhcpd>
-
dhcpd.conf in non-working order, see last static assignment with numeric hostname (27) as the difference:
option domain-name "key.lan"; option ldap-server code 95 = text; option domain-search-list code 119 = text; default-lease-time 7200; max-lease-time 86400; log-facility local7; ddns-update-style none; one-lease-per-client true; deny duplicates; ping-check true; authoritative; subnet 10.28.0.0 netmask 255.255.0.0 { pool { range 10.28.68.150 10.28.68.240; } option routers 10.28.68.1; option domain-name-servers 10.28.68.1; } host s_lan_0 { hardware ethernet 00:23:69:4e:ec:a7; fixed-address 10.28.68.7; option host-name dancinap; } host s_lan_1 { hardware ethernet 00:15:6d:b5:12:b7; fixed-address 10.28.68.30; option host-name ubntupstairs; } host s_lan_2 { hardware ethernet 00:15:6d:b5:29:a4; fixed-address 10.28.68.31; option host-name ubntcontrol; } host s_lan_3 { hardware ethernet 00:15:6d:b6:54:83; fixed-address 10.28.68.33; option host-name UBNTWifiAP; } host s_lan_4 { hardware ethernet 00:13:20:2d:03:02; fixed-address 10.28.68.40; option host-name oban; } host s_lan_5 { hardware ethernet 00:1f:d0:81:a5:24; fixed-address 10.28.68.45; option host-name MAMBA; } host s_lan_6 { hardware ethernet 00:15:99:62:bc:4a; fixed-address 10.28.68.79; option host-name printershipping; } host s_lan_7 { hardware ethernet 00:08:5d:1b:a3:90; fixed-address 10.28.68.101; option host-name ext101; } host s_lan_8 { hardware ethernet 00:08:5d:10:9d:fc; fixed-address 10.28.68.127; option host-name 27; }
-
XML in non working order, again, note the hostname for 10.28.68.127 is "27":
<dhcpd><lan><enable><range><from>10.28.68.150</from> <to>10.28.68.240</to></range> <defaultleasetime><maxleasetime><netmask><failover_peerip><gateway><domain><domainsearchlist><ddnsdomain><tftp><ldap><next-server><filename><rootpath><staticmap><mac>00:23:69:4e:ec:a7</mac> <ipaddr>10.28.68.7</ipaddr> <hostname>dancinap</hostname> <descr>Access point and router at Dan's house</descr></staticmap> <staticmap><mac>00:15:6d:b5:12:b7</mac> <ipaddr>10.28.68.30</ipaddr> <hostname>ubntupstairs</hostname> <descr>Powerstation 5 upstairs on office roof</descr></staticmap> <staticmap><mac>00:15:6d:b5:29:a4</mac> <ipaddr>10.28.68.31</ipaddr> <hostname>ubntcontrol</hostname> <descr>Nanostation 5 at Control Room on Plant 1 roof</descr></staticmap> <staticmap><mac>00:15:6d:b6:54:83</mac> <ipaddr>10.28.68.33</ipaddr> <hostname>UBNTWifiAP</hostname> <descr>Upstairs access point for wifi</descr></staticmap> <staticmap><mac>00:13:20:2d:03:02</mac> <ipaddr>10.28.68.40</ipaddr> <hostname>oban</hostname></staticmap> <staticmap><mac>00:1f:d0:81:a5:24</mac> <ipaddr>10.28.68.45</ipaddr> <hostname>MAMBA</hostname> <descr>Edgar's Desk has two adapters</descr></staticmap> <staticmap><mac>00:15:99:62:bc:4a</mac> <ipaddr>10.28.68.79</ipaddr> <hostname>printershipping</hostname> <descr>West Shipping Dock</descr></staticmap> <staticmap><mac>00:08:5d:1b:a3:90</mac> <ipaddr>10.28.68.101</ipaddr> <hostname>ext101</hostname> <descr>aastra 57i</descr></staticmap> <staticmap><mac>00:08:5d:10:9d:fc</mac> <ipaddr>10.28.68.127</ipaddr> <hostname>27</hostname> <descr>aastra 57i</descr></staticmap></rootpath></filename></next-server></ldap></tftp></ddnsdomain></domainsearchlist></domain></gateway></failover_peerip></netmask></maxleasetime></defaultleasetime></enable></lan> <opt1><staticmap><mac>00:15:99:62:bc:4a</mac> <ipaddr>10.28.69.79</ipaddr> <hostname>printshipping</hostname> <descr>West Shipping Dock</descr></staticmap></opt1></dhcpd>
-
I hope that helps, I've got to put it back to working now, all I have to do is either revert to the config that has strings in the hostnames and apply, or just edit the hostname from the gui and apply the new rules to get dhcpd running again.
-
A quick scan through a couple of RFCs suggests a hostname should begin with a letter. This might be crucial to the way dhcpd parses its configuration file.
How about calling your hosts ext127 or ext-127 or similar?
-
That is what I have done. It's certainly not a crucial situation for me, and I didn't know any better when I did it back in the 1.2 release when I first started with pfSense. That it worked then, and didn't now is the only reason I brought it up.
Thanks again, sorry to distract from more pressing matters.
-
That is what I have done. It's certainly not a crucial situation for me, and I didn't know any better when I did it back in the 1.2 release when I first started with pfSense. That it worked then, and didn't now is the only reason I brought it up.
Thanks again, sorry to distract from more pressing matters.
Any chance you still have a config backup and a CD around for 1.2 that you could toss on a spare box and see what is different about its dhcpd.conf that caused it to work? (Perhaps they were quoted or put in some other way)
It may have been an older version of ISC-DHCPD that allowed it, but I suppose it's possible something else changed in how the config was written. There was about a two-year gap between 1.2 and 1.2.3.
As wallabybob pointed out, hostnames should start with a letter, so the numeric hostnames are invalid. But if that is the case then the GUI should also be rejecting those as invalid hostnames.