Discussion:
DHCP custom options?
Jonathan Dieter
2010-01-07 07:47:06 UTC
Permalink
In our school, we are currently using the ISC dhcp server on a CentOS
server, with the BIND DNS server running on the same server. We give
the computers in the school static addresses handed out over DHCP, and
unknown computers get addresses in a different range.

I would like to migrate both DHCP and DNS over to pfsense as it is far
easier to administer than my current python-foo scripts, but I've hit a
wall with dhcpd.conf.

All of our computers are set to netboot gpxe from our tftp server and
then use gpxe to load files from our web server (if you want to know
why, see http://cedarandthistle.wordpress.com/2009/10/09/pxe-and-gpxe).
The problem is that this requires an if-statement in dhcpd.conf. I can
add that using the Edit File menu option in pfsense, but if I add a new
computer using the web interface, the if-statement gets wiped.

Is there any way to add the following if-statement directly into the web
interface in such a way that it won't get removed?


if exists user-class and option user-class = "gPXE" {
filename "http://lesson.lesbg.com/netboot/pxelinux.0";
} else {
if binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)) =
"0:19:d1:9a:fe:4b" or binary-to-ascii(16, 8, ":", substring(hardware, 1,
6)) = "0:1e:ec:69:3d:1e" or binary-to-ascii(16, 8, ":",
substring(hardware, 1, 6)) = "0:1d:72:9e:9f:e" or binary-to-ascii(16, 8,
":", substring(hardware, 1, 6)) = "0:19:d1:9a:ff:29" {
filename "/linux-install/undi.pxe";
} else {
filename "/linux-install/gpxe.pxe";
}
}

Thanks,
Jonathan
Chris Buechler
2010-01-07 09:08:13 UTC
Permalink
Post by Jonathan Dieter
In our school, we are currently using the ISC dhcp server on a CentOS
server, with the BIND DNS server running on the same server.  We give
the computers in the school static addresses handed out over DHCP, and
unknown computers get addresses in a different range.
I would like to migrate both DHCP and DNS over to pfsense as it is far
easier to administer than my current python-foo scripts, but I've hit a
wall with dhcpd.conf.
All of our computers are set to netboot gpxe from our tftp server and
then use gpxe to load files from our web server (if you want to know
why, see http://cedarandthistle.wordpress.com/2009/10/09/pxe-and-gpxe).
The problem is that this requires an if-statement in dhcpd.conf.  I can
add that using the Edit File menu option in pfsense, but if I add a new
computer using the web interface, the if-statement gets wiped.
Is there any way to add the following if-statement directly into the web
interface in such a way that it won't get removed?
Look in /etc/inc/services.inc under "write dhcpd.conf". You can hard
code it there, though that won't survive upgrades, it will work.

---------------------------------------------------------------------
To unsubscribe, e-mail: support-unsubscribe-***@public.gmane.org
For additional commands, e-mail: support-help-***@public.gmane.org

Commercial support available - https://portal.pfsense.org
Jonathan Dieter
2010-01-07 09:24:24 UTC
Permalink
Post by Chris Buechler
Post by Jonathan Dieter
Is there any way to add the following if-statement directly into the web
interface in such a way that it won't get removed?
Look in /etc/inc/services.inc under "write dhcpd.conf". You can hard
code it there, though that won't survive upgrades, it will work.
Brilliant.

If I was to code up a section under "Additional BOOTP/DHCP Options" in
the "DHCP Server" menu item called something like "Other DHCP
configuration statements" that would allow straight dhcpd.conf
statements, would upstream pfsense take it?

I'm just hoping to find a method that would benefit others (and not
disappear on upgrades).

Jonathan
Chris Buechler
2010-01-11 08:06:02 UTC
Permalink
Post by Jonathan Dieter
Post by Chris Buechler
Post by Jonathan Dieter
Is there any way to add the following if-statement directly into the web
interface in such a way that it won't get removed?
Look in /etc/inc/services.inc under "write dhcpd.conf". You can hard
code it there, though that won't survive upgrades, it will work.
Brilliant.
If I was to code up a section under "Additional BOOTP/DHCP Options" in
the "DHCP Server" menu item called something like "Other DHCP
configuration statements" that would allow straight dhcpd.conf
statements, would upstream pfsense take it?
We already have that ability built into 2.0, which will likely be the
next stable release (barring any security issues necessitating an
updated 1.2.x), so you'll just have to enter it in the GUI after the
next upgrade.

---------------------------------------------------------------------
To unsubscribe, e-mail: support-unsubscribe-***@public.gmane.org
For additional commands, e-mail: support-help-***@public.gmane.org

Commercial support available - https://portal.pfsense.org

Continue reading on narkive:
Loading...