UEFI PXE Boot – Equivalence of PXELINUX.0 and PXELINUX.CFG/Default Configuration

dhcppxe-bootsyslinuxtftpuefi

I use Pxe to servers with BIOS(legacy mode), which works perfectly.

Set Legacy mode and boot servers from PXE, it would load pxelinux.0 and read config menus via TFTP from /var/lib/tftpboot/pxelinux.cfg/default.

Here is tcpdump for legacy one

            Vendor-Class Option 60, length 32: "PXEClient:Arch:00000:UNDI:002001"
            END Option 255, length 0
            PAD Option 0, length 0, occurs 188
18:38:42.626709 00:0c:29:c6:72:77 > Broadcast, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    172.16.234.112.bootps > 255.255.255.255.bootpc: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0x90d61ab8, secs 6, Flags [Broadcast] (0x8000)
          Your-IP 172.16.235.94
          Server-IP 172.16.234.112
          Client-Ethernet-Address 00:25:90:d6:1a:b8
          file "/pxelinux.0"[|bootp]

18:38:42.628329 00:25:90:d6:1a:b8 > 00:0c:29:c6:72:77, ethertype IPv4 (0x0800), length 70: (tos 0x0, ttl 20, id 3, offset 0, flags [none], proto UDP (17), length 56)

    172.16.235.94.ah-esp-encap > 172.16.234.112.tftp: [udp sum ok]  28 RRQ "/pxelinux.0" octet tsize 0

    172.16.235.94.49152 > 172.16.234.112.tftp: [udp sum ok]  80 RRQ "/pxelinux.cfg/002590d6-1ab8-0607-0025-90d61ab80e0f" octet tsize 0 blksize 1408

We can see DHCP Offered an IP and tftp got pxelinux.0 and files from /pxelinux.cfg/

I can config boot menu on default, installing Centos or whatever.

Yet recently I meet the issue that new servers with UEFI.
I know I could be told whether it's legacy or UEFI by dhcpd.conf

ddns-update-style none;
default-lease-time 3600;
max-lease-time 3600;
ignore client-updates;
allow booting;
allow bootp;


option client-system-arch code 93 = unsigned integer 16;

class "pxeclients" {

        match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";

        next-server 172.16.234.112;


        if option client-system-arch = 00:00 {


                filename = "/pxelinux.0";

        }

        if option client-system-arch = 00:07 or option client-system-arch = 00:09{

                filename = "/BOOTX64.EFI";

        }

}

subnet 172.16.232.0 netmask 255.255.248.0 {

        option routers                  172.17.232.1;
        option subnet-mask              255.255.248.0;
        option domain-name-servers      202.106.0.20;
        range dynamic-bootp 172.16.235.2 172.16.239.253;

}

BOOTX64.EFI is from Centos7.5 ISO.

It's all right when it's Legacy, but it hangs on

start PXE Over IPV4

The screen flashes and switches from another windows(Cannot see what's it, incredibly fast).

Seeing from messages, it kept DHCP Request and offer.

Mar  8 19:32:36 ks dhcpd: DHCPREQUEST for 172.16.235.95 (172.16.234.112) from 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:36 ks dhcpd: DHCPACK on 172.16.235.95 to 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:36 ks dhcpd: DHCPDISCOVER from 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:36 ks dhcpd: DHCPOFFER on 172.16.235.95 to 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:40 ks dhcpd: DHCPREQUEST for 172.16.235.95 (172.16.234.112) from 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:40 ks dhcpd: DHCPACK on 172.16.235.95 to 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:40 ks dhcpd: DHCPDISCOVER from 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:40 ks dhcpd: DHCPOFFER on 172.16.235.95 to 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:44 ks dhcpd: DHCPREQUEST for 172.16.235.95 (172.16.234.112) from 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:44 ks dhcpd: DHCPACK on 172.16.235.95 to 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:44 ks dhcpd: DHCPDISCOVER from 5c:b9:01:92:f6:34 via ens192
Mar  8 19:32:44 ks dhcpd: DHCPOFFER on 172.16.235.95 to 5c:b9:01:92:f6:34 via ens192

......

Here is tcpdump from DHCP servers port 67.

   0.0.0.0.bootpc > 255.255.255.255.bootps: [udp sum ok] BOOTP/DHCP, Request from 5c:b9:01:92:f6:34, length 359, xid 0xe8ffad6f, Flags [Broadcast] (0x8000)
          Client-Ethernet-Address 5c:b9:01:92:f6:34
          Vendor-rfc1048 Extensions
            Magic Cookie 0x63825363
            DHCP-Message Option 53, length 1: Request
            Server-ID Option 54, length 4: 172.16.234.112
            Requested-IP Option 50, length 4: 172.16.235.95

     ......

            GUID Option 97, length 17: 0.55.53.53.50.53.56.54.67.85.53.52.49.88.52.75.88
            NDI Option 94, length 3: 1.3.16
            ARCH Option 93, length 2: 7
            Vendor-Class Option 60, length 32: "PXEClient:Arch:00007:UNDI:003016"
            END Option 255, length 0

19:32:28.031210 00:0c:29:c6:72:77 > Broadcast, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
    172.16.234.112.bootps > 255.255.255.255.bootpc: [udp sum ok] BOOTP/DHCP, Reply, length 300, xid 0xe8ffad6f, Flags [Broadcast] (0x8000)
          Your-IP 172.16.235.95
          Server-IP 172.16.234.112
          Client-Ethernet-Address 5c:b9:01:92:f6:34
          file "BOOTX64.EFI"[|bootp]

It seems server offered BOOTX64.EFI but client did not accept as tcpdump 'port 69` returned nothing.

In legacy mode, tcpdump port 69, files are downloaded by client.

Seeing from above message, Server's identity is

PXEClient:Arch:00007:UNDI:003016

which should match else and load BOOTX64.EFI

So I'm pretty confused, what's wrong?

What's the equivalent of UEFI config, it should match client (To detect it's UEFI or Legacy) and there should be a file which is the same as pxelinux.0 as bootloader, and a file to read boot menus.
Any suggestion is welcomed.

I googled all day, nothing useful was found, including Redhat Docs.

Explore1, seeing from this page, it said syslinux.efi is the one which same as pxelinux.0, I change dhcpd.conf and restart, does not work ,either.

Best Answer

  • pxelinux.0 offers you a PXE menu for booting legacy targets
  • BOOTX64.EFI will help you to boot a particular Linux distro but you won't have a menu of different PXE booting assets
  • pxelinux.efi syslinux.efi offers you a PXE menu for booting UEFI targets