Dhcp if block on pfsense?
-
I would like to use ipxe with dhcp and it wants an if block as follows.
option client-architecture code 93 = unsigned integer 16;
if exists user-class and option user-class = "iPXE" {
filename "http://my.web.server/real_boot_script.php";
} elsif option client-architecture = 00:00 {
filename "undionly.kpxe";
} else {
filename "ipxe.efi";
}I know how to do this on linux with isc's dhcp server. I thought I read that pfsense also uses ISC's dhcp server? Would it be possible to add an if block like that?
I don't see anyway to configure that from the web interface could I just edit it directly?
Was going to try this if I could with pfsense as Fedora's Selinux keeps messing with my dhcp server. I might have to resort to another distro just for dhcp to work correctly. -
No, not easily. You would probably have to modify some code to allow a custom config block like that.
However, since all you are doing there is passing a filename to the client to boot from if you only have one type of client you may not need that. Just pass the appropriate bootfile for that client with the boot server location. Those are things you can do.Steve
-
@stephenw10 Nah it is not as easy as sending a file as ipxe does a bootloop unless you have the if block. ipxe sets user-class to "iPXE" so that you can end the boot loop. I wanted to use ipxe to use an iscsi disk as a place to boot from. Maybe I can just do that with grub and or pxelinux. On that note I would still need an if block to switch on client-architecture. I want to use grub if it is efi and pxelinux for bios boot.
-
Hmm, well pfSense does have the ability to send different boot files for different client types so you may be able to do that:
Otherwise you would need to arrange some sort of override for the auto-generated conf file. I thought there might be something build in for that, like there is for mpd.conf, but I cant see anything.
Ancient but would probably still work: https://happy-coder.com/2014/06/27/pfsense-custom-dhcpd-configuration/ YMMV!
If you do find something that works you might drop a reply here as that looks like the same problem: https://forum.netgate.com/topic/174712/ltsp-on-vlans-pfsense
Steve