Jonathan Dieter
2010-01-07 07:47:06 UTC
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
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