Chapter 7. Preparing a PXE installation source
You must configure TFTP and DHCP on a PXE server to enable PXE boot and network installation.
7.1. Network installation overview
A network installation allows you to install Red Hat Enterprise Linux to a system that has access to an installation server. At a minimum, two systems are required for a network installation:
- Server
- A system running a DHCP server, an HTTP, HTTPS, FTP, or NFS server, and in the PXE boot case, a TFTP server. Although each server can run on a different physical system, the procedures in this section assume a single system is running all servers.
- Client
- The system to which you are installing Red Hat Enterprise Linux. Once installation starts, the client queries the DHCP server, receives the boot files from the HTTP or TFTP server, and downloads the installation environment image from the HTTP, HTTPS, FTP or NFS server. Unlike other installation methods, the client does not require any physical boot media for the installation to start.
To boot a client from the network, enable network boot in the firmware or in a quick boot menu on the client. On some hardware, the option to boot from a network might be disabled, or not available.
The workflow steps to prepare for an installation of Red Hat Enterprise Linux from a network by using HTTP or PXE are as follows:
Procedure
- Export the installation ISO image or the installation tree to an NFS, HTTPS, HTTP, or FTP server.
- Configure the HTTP or TFTP server and DHCP server, and start the HTTP or TFTP service on the server.
- Boot the client and start the installation.
You can choose between the following network boot protocols:
- HTTP
- Use the HTTP boot if your client UEFI supports it. HTTP boot is usually more reliable.
- PXE (TFTP)
- PXE boot is more widely supported by client systems, but sending the boot files over TFTP protocol might be slow and result in timeout failures.
7.2. Configuring the DHCPv4 server for network boot
Enable the DHCP version 4 (DHCPv4) service on your server, so that it can provide network boot functionality.
Prerequisites
- You are preparing network installation over the IPv4 protocol.
Find the network addresses of the server.
In the following examples, the server has a network interface
enp1s0
with this configuration:- IPv4 address
- 192.168.124.2/24
- IPv4 gateway + DNS server
- 192.168.124.1
Procedure
Install the DHCP server:
dnf install kea
# dnf install kea
Copy to Clipboard Copied! Set up a DHCPv4 server. Enter the following configuration in the
/etc/kea/kea-dhcp4.conf
file. Replace the addresses to match your network card.{ "Dhcp4": { "interfaces-config": { "interfaces": [ "enp1s0" ] }, "subnet4": [ { "id": 1, "subnet": "192.168.124.0/24", "pools": [ { "pool": "192.168.124.100 - 192.168.124.200" } ], "option-data": [ { "space": "dhcp4", "name": "routers", "code": 3, "data": "192.168.124.10" }, { "space": "dhcp4", "name": "domain-name-servers", "code": 6, "data": "192.168.124.10" } ] } ], "client-classes": [ { "name": "uefi PXE Clients", "test": "substring(option[60].hex,0,9) == 'PXEClient' and option[93].hex == 0x0007", "next-server": "192.168.124.2", "boot-file-name": "/uefi/BOOT/BOOTX64.EFI" }, { "name": "bios PXE Clients", "test": "substring(option[60].hex,0,9) == 'PXEClient' and option[93].hex == 0x0000", "next-server": "192.168.124.2", "boot-file-name": "syslinux/pxelinux.0" }, { "name": "uefi HTTP Clients", "test": "substring(option[60].hex,0,10) == 'HTTPClient' and option[93].hex == 0x0007", "option-data": [ { "space": "dhcp4", "name": "vendor-class-identifier", "code": 60, "data": "HTTPClient" } ], "next-server": "192.168.124.2", "boot-file-name": "http://192.168.124.2/uefi/BOOT/BOOTX64.EFI" } ] } }
{ "Dhcp4": { "interfaces-config": { "interfaces": [ "enp1s0" ] }, "subnet4": [ { "id": 1, "subnet": "192.168.124.0/24", "pools": [ { "pool": "192.168.124.100 - 192.168.124.200" } ], "option-data": [ { "space": "dhcp4", "name": "routers", "code": 3, "data": "192.168.124.10" }, { "space": "dhcp4", "name": "domain-name-servers", "code": 6, "data": "192.168.124.10" } ] } ], "client-classes": [ { "name": "uefi PXE Clients", "test": "substring(option[60].hex,0,9) == 'PXEClient' and option[93].hex == 0x0007", "next-server": "192.168.124.2", "boot-file-name": "/uefi/BOOT/BOOTX64.EFI" }, { "name": "bios PXE Clients", "test": "substring(option[60].hex,0,9) == 'PXEClient' and option[93].hex == 0x0000", "next-server": "192.168.124.2", "boot-file-name": "syslinux/pxelinux.0" }, { "name": "uefi HTTP Clients", "test": "substring(option[60].hex,0,10) == 'HTTPClient' and option[93].hex == 0x0007", "option-data": [ { "space": "dhcp4", "name": "vendor-class-identifier", "code": 60, "data": "HTTPClient" } ], "next-server": "192.168.124.2", "boot-file-name": "http://192.168.124.2/uefi/BOOT/BOOTX64.EFI" } ] } }
Copy to Clipboard Copied! Start the DHCPv4 service:
systemctl enable --now kea-dhcp4
# systemctl enable --now kea-dhcp4
Copy to Clipboard Copied!
7.3. Configuring the DHCPv6 server for network boot
Enable the DHCP version 6 (DHCPv4) service on your server, so that it can provide network boot functionality.
Prerequisites
- You are preparing network installation over the IPv6 protocol.
Find the network addresses of the server.
In the following examples, the server has a network interface
enp1s0
with this configuration:- IPv6 address
- fd33::2/64
- IPv6 gateway
- fd33::1
Procedure
Install the DHCP server:
dnf install kea
# dnf install kea
Copy to Clipboard Copied! Set up a DHCPv6 server. Enter the following configuration in the
/etc/kea/kea-dhcp6.conf
file. Replace the addresses to match your network card.{ "Dhcp6": { "interfaces-config": { "interfaces": [ "enp1s0" ] }, "subnet6": [ { "id": 1, "subnet": "fd33::/64", "interface": "enp1s0", "pools": [ { "pool": "fd33::100-fd33::200" } ] } ], "client-classes": [ { "name": "uefi PXE Clients", "test": "substring(option[16].hex,6,9) == 'PXEClient' and substring(option[16].hex,21,5) == '00007'", "option-data": [ { "space": "dhcp6", "name": "bootfile-url", "code": 59, "data": "tftp://[fd33::2]/uefi/BOOT/BOOTX64.EFI" } ] }, { "name": "bios PXE Clients", "test": "substring(option[16].hex,6,9) == 'PXEClient' and substring(option[16].hex,21,5) == '00000'", "option-data": [ { "space": "dhcp6", "name": "bootfile-url", "code": 59, "data": "tftp://[fd33::2]/syslinux/pxelinux.0" } ] }, { "name": "uefi HTTP Clients", "test": "substring(option[16].hex,6,10) == 'HTTPClient' and substring(option[16].hex,22,5) == '00007'", "option-data": [ { "space": "dhcp6", "name": "bootfile-url", "code": 59, "data": "http://[fd33::2]/uefi/BOOT/BOOTX64.EFI" } ] } ] } }
{ "Dhcp6": { "interfaces-config": { "interfaces": [ "enp1s0" ] }, "subnet6": [ { "id": 1, "subnet": "fd33::/64", "interface": "enp1s0", "pools": [ { "pool": "fd33::100-fd33::200" } ] } ], "client-classes": [ { "name": "uefi PXE Clients", "test": "substring(option[16].hex,6,9) == 'PXEClient' and substring(option[16].hex,21,5) == '00007'", "option-data": [ { "space": "dhcp6", "name": "bootfile-url", "code": 59, "data": "tftp://[fd33::2]/uefi/BOOT/BOOTX64.EFI" } ] }, { "name": "bios PXE Clients", "test": "substring(option[16].hex,6,9) == 'PXEClient' and substring(option[16].hex,21,5) == '00000'", "option-data": [ { "space": "dhcp6", "name": "bootfile-url", "code": 59, "data": "tftp://[fd33::2]/syslinux/pxelinux.0" } ] }, { "name": "uefi HTTP Clients", "test": "substring(option[16].hex,6,10) == 'HTTPClient' and substring(option[16].hex,22,5) == '00007'", "option-data": [ { "space": "dhcp6", "name": "bootfile-url", "code": 59, "data": "http://[fd33::2]/uefi/BOOT/BOOTX64.EFI" } ] } ] } }
Copy to Clipboard Copied! Start the DHCPv6 service:
systemctl enable --now kea-dhcp6
# systemctl enable --now kea-dhcp6
Copy to Clipboard Copied! If DHCPv6 packets are dropped by the RP filter in the firewall, check its log. If the log contains the
rpfilter_DROP
entry, disable the filter using the following configuration in the/etc/firewalld/firewalld.conf
file:IPv6_rpfilter=no
IPv6_rpfilter=no
Copy to Clipboard Copied!
7.4. Configuring a TFTP server for BIOS-based clients
You must configure a TFTP server and DHCP server and start the TFTP service on the PXE server for BIOS-based AMD and Intel 64-bit systems.
Procedure
As root, install the following package.
dnf install tftp-server
# dnf install tftp-server
Copy to Clipboard Copied! Allow incoming connections to the
tftp service
in the firewall:firewall-cmd --add-service=tftp
# firewall-cmd --add-service=tftp
Copy to Clipboard Copied! This command enables temporary access until the next server reboot.
Optional: To enable permanent access, repeat the previous command together with the
--permanent
option.Depending on the location of the installation ISO file, you might have to allow incoming connections for HTTP or other services.
Install
syslinux-tftpboot
package:dnf -y install syslinux-tftpboot
# dnf -y install syslinux-tftpboot
Copy to Clipboard Copied! Create a
pxelinux
directory in the/var/lib/tftpboot
directory and copy all the files provided by thesyslinux-tftpboot
package (located in/tftpboot
directory) into thepxelinux
directory:mkdir /var/lib/tftpboot/pxelinux cp /tftpboot/* /var/lib/tftpboot/pxelinux
# mkdir /var/lib/tftpboot/pxelinux # cp /tftpboot/* /var/lib/tftpboot/pxelinux
Copy to Clipboard Copied! Create the directory
pxelinux.cfg
in thepxelinux
directory:mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfg
# mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfg
Copy to Clipboard Copied! Create a configuration file named
default
and add it to thepxelinux.cfg
directory as shown in the following example:DEFAULT menu.c32 MENU TITLE Red Hat Enterprise Linux 10.0 Installation TIMEOUT 600 LABEL default MENU LABEL ^Install Red Hat Enterprise Linux 10.0 KERNEL /pxelinux/images/RHEL-10/vmlinuz APPEND initrd=/pxelinux/images/RHEL-10/initrd.img inst.repo=http://192.168.124.2/redhat/iso quiet LABEL text MENU LABEL Install Red Hat Enterprise Linux 10.0 in ^text mode KERNEL /pxelinux/images/RHEL-10/vmlinuz APPEND initrd=/pxelinux/images/RHEL-10/initrd.img inst.repo=http://192.168.124.2/redhat/iso inst.text quiet LABEL rescue MENU LABEL ^Rescue a Red Hat Enterprise Linux system KERNEL /pxelinux/images/RHEL-10/vmlinuz APPEND initrd=/pxelinux/images/RHEL-10/initrd.img inst.stage2=http://192.168.124.2/redhat/iso inst.rescue quiet LABEL local MENU LABEL Boot from ^local drive LOCALBOOT 0xffff
DEFAULT menu.c32 MENU TITLE Red Hat Enterprise Linux 10.0 Installation TIMEOUT 600 LABEL default MENU LABEL ^Install Red Hat Enterprise Linux 10.0 KERNEL /pxelinux/images/RHEL-10/vmlinuz APPEND initrd=/pxelinux/images/RHEL-10/initrd.img inst.repo=http://192.168.124.2/redhat/iso quiet LABEL text MENU LABEL Install Red Hat Enterprise Linux 10.0 in ^text mode KERNEL /pxelinux/images/RHEL-10/vmlinuz APPEND initrd=/pxelinux/images/RHEL-10/initrd.img inst.repo=http://192.168.124.2/redhat/iso inst.text quiet LABEL rescue MENU LABEL ^Rescue a Red Hat Enterprise Linux system KERNEL /pxelinux/images/RHEL-10/vmlinuz APPEND initrd=/pxelinux/images/RHEL-10/initrd.img inst.stage2=http://192.168.124.2/redhat/iso inst.rescue quiet LABEL local MENU LABEL Boot from ^local drive LOCALBOOT 0xffff
Copy to Clipboard Copied! -
The installation program cannot boot without its runtime image. Use the
inst.stage2
boot option to specify location of the image. Alternatively, you can use theinst.repo=
option to specify the image as well as the installation source. -
The installation source location used with
inst.repo
must contain a valid.treeinfo
file. -
When you select the content of RHEL10 installation DVD as the installation source, the
.treeinfo
file points to the BaseOS and the AppStream repositories. You can use a singleinst.repo
option to load both repositories.
-
The installation program cannot boot without its runtime image. Use the
Create a subdirectory to store the boot image files in the
/var/lib/tftpboot
directory, and copy the boot image files to the directory. In this example, the directory is/var/lib/tftpboot/pxelinux/images/RHEL-10
:mkdir -p /var/lib/tftpboot/pxelinux/images/RHEL-10 cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/images/RHEL-10/
# mkdir -p /var/lib/tftpboot/pxelinux/images/RHEL-10 # cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/images/RHEL-10/
Copy to Clipboard Copied! Start and enable the
tftp.socket
service:systemctl enable --now tftp.socket
# systemctl enable --now tftp.socket
Copy to Clipboard Copied! The PXE boot server is now ready to serve PXE clients. You can start the client, which is the system to which you are installing Red Hat Enterprise Linux. Select PXE Boot or Network Boot when prompted to specify a boot source, and start the network installation.
7.5. Configuring a TFTP server for UEFI-based clients
You must configure a TFTP server and DHCP server and start the TFTP service on the PXE server for UEFI-based AMD64, Intel 64, and 64-bit ARM systems.
Red Hat Enterprise Linux 10 UEFI PXE boot supports, apart from the default grub menu file (grub.cfg), a lowercase file format for a MAC-based grub menu file. For example, the MAC address file format for grub2 can be grub.cfg-01-aa-bb-cc-dd-ee-ff
Procedure
As root, install the following package.
dnf install tftp-server
# dnf install tftp-server
Copy to Clipboard Copied! Allow incoming connections to the
tftp service
in the firewall:firewall-cmd --add-service=tftp
# firewall-cmd --add-service=tftp
Copy to Clipboard Copied! This command enables temporary access until the next server reboot.
Optional: To enable permanent access, repeat the previous command together with the
--permanent
option.Depending on the location of the installation ISO file, you might have to allow incoming connections for HTTP or other services.
Access the EFI boot image files from the DVD ISO image:
mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
# mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
Copy to Clipboard Copied! Copy the EFI boot images from the DVD ISO image:
mkdir /var/lib/tftpboot/redhat cp -r /mount_point/EFI /var/lib/tftpboot/redhat/
# mkdir /var/lib/tftpboot/redhat # cp -r /mount_point/EFI /var/lib/tftpboot/redhat/
Copy to Clipboard Copied! Create a subdirectory to store the boot image files in the
/var/lib/tftpboot/
directory, and copy the boot image files to the directory. In this example, the directory is/var/lib/tftpboot/images/RHEL-10/
:mkdir -p /var/lib/tftpboot/images/RHEL-10/ cp /mount_point/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/images/RHEL-10/ umount /mount_point
# mkdir -p /var/lib/tftpboot/images/RHEL-10/ # cp /mount_point/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/images/RHEL-10/ # umount /mount_point
Copy to Clipboard Copied! Fix the permissions of the copied files:
chmod -R 755 /var/lib/tftpboot/redhat/
# chmod -R 755 /var/lib/tftpboot/redhat/
Copy to Clipboard Copied! Replace the content of
/var/lib/tftpboot/redhat/EFI/BOOT/grub.cfg
with the following example:set default="1" set timeout=60 function load_video { insmod efi_gop insmod efi_uga insmod video_bochs insmod video_cirrus insmod all_video } load_video set gfxpayload=keep menuentry 'Install Red Hat Enterprise Linux 10.0' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/RHEL-10/vmlinuz inst.repo=http://192.168.124.2/redhat/iso quiet initrdefi /images/RHEL-10/initrd.img } submenu 'Troubleshooting -->' { menuentry 'Install Red Hat Enterprise Linux 10.0 in text mode' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/RHEL-10/vmlinuz inst.repo=http://192.168.124.2/redhat/iso inst.text quiet initrdefi /images/RHEL-10/initrd.img } menuentry 'Rescue a Red Hat Enterprise Linux system' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/RHEL-10/vmlinuz inst.stage2=http://192.168.124.2/redhat/iso inst.rescue quiet initrdefi /images/RHEL-10/initrd.img } }
set default="1" set timeout=60 function load_video { insmod efi_gop insmod efi_uga insmod video_bochs insmod video_cirrus insmod all_video } load_video set gfxpayload=keep menuentry 'Install Red Hat Enterprise Linux 10.0' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/RHEL-10/vmlinuz inst.repo=http://192.168.124.2/redhat/iso quiet initrdefi /images/RHEL-10/initrd.img } submenu 'Troubleshooting -->' { menuentry 'Install Red Hat Enterprise Linux 10.0 in text mode' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/RHEL-10/vmlinuz inst.repo=http://192.168.124.2/redhat/iso inst.text quiet initrdefi /images/RHEL-10/initrd.img } menuentry 'Rescue a Red Hat Enterprise Linux system' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/RHEL-10/vmlinuz inst.stage2=http://192.168.124.2/redhat/iso inst.rescue quiet initrdefi /images/RHEL-10/initrd.img } }
Copy to Clipboard Copied! -
The installation program cannot boot without its runtime image. Use the
inst.stage2
boot option to specify location of the image. Alternatively, you can use theinst.repo=
option to specify the image as well as the installation source. -
The installation source location used with
inst.repo
must contain a valid.treeinfo
file. -
When you select the RHEL10 installation DVD as the installation source, the
.treeinfo
file points to the BaseOS and the AppStream repositories. You can use a singleinst.repo
option to load both repositories.
-
The installation program cannot boot without its runtime image. Use the
Start and enable the
tftp.socket
service:systemctl enable --now tftp.socket
# systemctl enable --now tftp.socket
Copy to Clipboard Copied! The PXE boot server is now ready to serve PXE clients. You can start the client, which is the system to which you are installing Red Hat Enterprise Linux. Select PXE Boot or Network Boot when prompted to specify a boot source, and start the network installation.