Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Dhcp if block on pfsense?

    Scheduled Pinned Locked Moved General pfSense Questions
    4 Posts 2 Posters 561 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      PenguinJeff
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        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

        P 1 Reply Last reply Reply Quote 0
        • P
          PenguinJeff @stephenw10
          last edited by PenguinJeff

          @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.

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            Hmm, well pfSense does have the ability to send different boot files for different client types so you may be able to do that:
            Screenshot from 2022-10-25 01-52-30.png

            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

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.