The software described in this documentation is either in Extended Support or Sustaining Support. See https://www.oracle.com/us/support/library/enterprise-linux-support-policies-069172.pdf for more information.
Oracle recommends that you upgrade the software described by this documentation as soon as possible.

1.4.10 Configuring DHCP to Support iPXE Clients

iPXE extends the capabilities of PXE in many ways, including:

  • iPXE clients can boot using HTTP, iSCSI, AoE, and FCoE

  • The boot process can be controlled using scripts

  • DNS lookup is available

  • Booting across wide area networks or the Internet is possible

The gpxelinux.0 boot loader provides some iPXE features, such as DNS lookup and HTTP file transfer, and is available in the syslinux package. It does not support iPXE commands or scripts.

You can use gpxelinux.0 with BIOS-based PXE clients and with UEFI-based PXE clients in legacy mode but not in UEFI mode.

To configure the DHCP service to support iPXE clients:

  1. Edit /etc/dhcp/dhcpd.conf:

    1. Add the following lines to define the iPXE options for DHCP:

      option space ipxe;
      option ipxe-encap-opts code 175 = encapsulate ipxe;
      option ipxe.priority code 1 = signed integer 8;
      option ipxe.keep-san code 8 = unsigned integer 8;
      option ipxe.skip-san-boot code 9 = unsigned integer 8;
      option ipxe.syslogs code 85 = string;
      option ipxe.cert code 91 = string;
      option ipxe.privkey code 92 = string;
      option ipxe.crosscert code 93 = string;
      option ipxe.no-pxedhcp code 176 = unsigned integer 8;
      option ipxe.bus-id code 177 = string;
      option ipxe.bios-drive code 189 = unsigned integer 8;
      option ipxe.username code 190 = string;
      option ipxe.password code 191 = string;
      option ipxe.reverse-username code 192 = string;
      option ipxe.reverse-password code 193 = string;
      option ipxe.version code 235 = string;
      option iscsi-initiator-iqn code 203 = string;
      option ipxe.pxeext code 16 = unsigned integer 8;
      option ipxe.iscsi code 17 = unsigned integer 8;
      option ipxe.aoe code 18 = unsigned integer 8;
      option ipxe.http code 19 = unsigned integer 8;
      option ipxe.https code 20 = unsigned integer 8;
      option ipxe.tftp code 21 = unsigned integer 8;
      option ipxe.ftp code 22 = unsigned integer 8;
      option ipxe.dns code 23 = unsigned integer 8;
      option ipxe.bzimage code 24 = unsigned integer 8;
      option ipxe.multiboot code 25 = unsigned integer 8;
      option ipxe.slam code 26 = unsigned integer 8;
      option ipxe.srp code 27 = unsigned integer 8;
      option ipxe.nbi code 32 = unsigned integer 8;
      option ipxe.pxe code 33 = unsigned integer 8;
      option ipxe.elf code 34 = unsigned integer 8;
      option ipxe.comboot code 35 = unsigned integer 8;
      option ipxe.efi code 36 = unsigned integer 8;
      option ipxe.fcoe code 37 = unsigned integer 8;
      option ipxe.vlan code 38 = unsigned integer 8;
      option ipxe.menu code 39 = unsigned integer 8;
      option ipxe.sdi code 40 = unsigned integer 8;
      option ipxe.nfs code 41 = unsigned integer 8;
    2. If you do not use a proxy DHCP server, specify the following line to speed up negotiation with the DHCP server:

      option ipxe.no-pxedhcp 1;
    3. Add the following line to define the user-class option:

      option user-class code 77 = string;
    4. Configure the DHCP server to provide the IP addresses of name servers that iPXE clients can use to resolve domain names to IP addresses, for example:

      option domain-name-servers 10.0.0.1, 10.0.0.4, 10.0.0.8;
    5. Configure DHCP to specify the gpxelinux.0 boot loader for non-iPXE clients and the URI of a boot script for iPXE clients, for example:

      if exists user-class and option user-class = "iPXE" {
            filename "http://web.mydom.com/pxeboot.php";
        } else {
            filename "gpxelinux.0";
        }

      In this example, pure iPXE clients run the HTTP-served boot script pxeboot.php.

      The following is an example of a boot script for an iPXE client:

      #!ipxe
      
      dhcp
      kernel http://web.mydom.com/OSimage/OL6.6/isolinux/vmlinuz
      initrd http://web.mydom.com/OSimage/OL6.6/isolinux/initrd.img
      boot vmlinuz initrd=initrd.img ksdevice=eth0 kssendmac \
       ks=http://web.mydom.com/ksfiles/ol6u6_cfg.ks

      dhcp configures the client's network interfaces.

      kernel downloads the installation kernel.

      initrd downloads the initial ram-disk image file.

      boot boots the downloaded installation kernel. Boot line parameters, such as the name of the initial ram-disk file and the location of the kickstart file, are specified as additional arguments. Do not use the \ line-continuation character. This character is used in the example to denote that the line has been broken for printing. The boot command and all of its arguments must be on the same line.

      For more information, see https://ipxe.org/scripting and https://ipxe.org/cmd.

      Non-iPXE clients boot using gpelinux.0. A configuration file for gpxelinux.0 is named in the same way as for pxelinux.0 as described in Section 1.4.9, “About Boot-Loader Configuration Files”. Unlike pxelinux.0, you can use HTTP to access the installation kernel and initial ram-disk image files.

      The following is an example of a configuration file for gpxelinux.0:

      prompt 0
      default ol6u6
      timeout 0
      
      label ol6u6
      kernel http://websvr.mydom.com/OSimage/OL6.6/isolinux/vmlinuz
      append initrd=http://websvr.mydom.com/OSimage/OL6.6/isolinux/initrd.img \
       ksdevice=eth0 kssendmac ks=http://web.mydom.com/ksfiles/ol6u6_cfg.ks

      Do not use the \ line-continuation character. This character is used in the example to denote that the line has been broken for printing. The append keyword and all of its arguments must be on the same line.

  2. Restart the DHCP service:

    # service dhcpd restart

    If you make any changes to /etc/dhcp/dhcpd.conf, restart the dhcpd service. You do not need to restart the service if you change the content of the boot loader configuration files.