Pre-requirement & reference:
Refer to following two links to build an essential environment for PXE server.
How to configure a PXE server on CentOS 7 (Legacy Boot)
Install PXE server on CentOS 7 via dnsmasq & vsftp @FWA-1010VC
Purpose:
More and more systems support UEFI PXE boot, PXE server has to be prepared with proper boot and configuration files accordingly. This article is based on Legacy environment to extend capability to support UEFI boot.
Target Audience:
For those users having Legacy PXE server but would like to extend its capability to support UEFI boot too.
Additional Steps from Recent Legacy PXE Server:
1. Files for UEFI boot located in /tftpboot folder
grub/grub.conf
grubx64.efi
2. Make DHCP daemon supports Legacy and UEFI requests from Clients. This steps allow DHCP server offer correct boot loader to client by requesting types
# vi /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
Authoritative;
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
option arch code 93 = unsigned integer 16; # RFC4578
default-lease-time 259200;
max-lease-time 518400;
option routers 192.168.17.99;
option broadcast-address 192.168.17.255;
option subnet-mask 255.255.255.0;
option domain-name-servers 168.95.1.1,140.111.66.1,8.8.8.8;
ddns-update-style interim;
ignore client-updates;
allow booting;
allow bootp;
allow unknown-clients;
server-name pxis;
subnet 192.168.17.0 netmask 255.255.255.0 {
range 192.168.17.100 192.168.17.199;
class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 192.168.17.99;
if option arch = 00:07 {
filename "grubx64.efi"; # for UEFI client
} else {
filename "pxelinux.0"; # for legacy client
}
option domain-name-servers 8.8.8.8;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.17.255;
option routers 192.168.17.99;
}
}
3. Set up & Check the boot menu , you may change the file path according to your folder structure. Here my ubuntu netboot image is located to "/tftpboot/boot/6"
# cat /tftpboot/grub/grub.cfg
set default=10
set timeout=90
set gfxpayload=keep
### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu20.04_install_http' --class ubuntu --class gnu-linux --classs gnu --class os {
linuxefi /boot/6/vmlinuz inst.repo=http://192.168.17.99/ubuntu20.04 vga=off console=tty0 console=ttyS0,115200n8 apparmor=0
initrdefi /boot/6/initrd }
4. Restart Services and check if your client was able to boot from PXE server in UEFI mode.
# systemctl start tftp
# systemctl enable tftp
# systemctl start xinetd
# systemctl enable xinetd
Demo & Checks:
1. At Client machine, chose UEFI PXE port
2. The client should be able to get an IP from PXE server and download gurbx64.efi file, and then see the grub menu for boot.
* Attached grub files for reference
Comments
0 comments
Please sign in to leave a comment.