Chapter 12. Preparing a PXE installation source
You must configure TFTP and DHCP on a PXE server to enable PXE boot and network installation.
12.1. Network install overview Copy linkLink copied to clipboard!
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 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 to install Red Hat Enterprise Linux from a network 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
- Red Hat recommends using 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 this protocol might be slow and result in timeout failures.
12.2. Configuring the DHCPv4 server for network boot Copy linkLink copied to clipboard!
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.
For IPv6, see Configuring the DHCPv6 server for network boot instead.
Find the network addresses of the server.
In the following examples, the server has a network card with this configuration:
- IPv4 address
- 192.168.124.2/24
- IPv4 gateway
- 192.168.124.1
Procedure
Install the DHCP server:
yum install dhcp-server
yum install dhcp-serverCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set up a DHCPv4 server. Enter the following configuration in the
/etc/dhcp/dhcpd.conffile. Replace the addresses to match your network card.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the DHCPv4 service:
systemctl enable --now dhcpd
# systemctl enable --now dhcpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
12.3. Configuring the DHCPv6 server for network boot Copy linkLink copied to clipboard!
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.
For IPv4, see Configuring the DHCPv4 server for network boot instead.
Find the network addresses of the server.
In the following examples, the server has a network card with this configuration:
- IPv6 address
- fd33:eb1b:9b36::2/64
- IPv6 gateway
- fd33:eb1b:9b36::1
Procedure
Install the DHCP server:
yum install dhcp-server
yum install dhcp-serverCopy to Clipboard Copied! Toggle word wrap Toggle overflow Set up a DHCPv6 server. Enter the following configuration in the
/etc/dhcp/dhcpd6.conffile. Replace the addresses to match your network card.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the DHCPv6 service:
systemctl enable --now dhcpd6
# systemctl enable --now dhcpd6Copy to Clipboard Copied! Toggle word wrap Toggle overflow If DHCPv6 packets are dropped by the RP filter in the firewall, check its log. If the log contains the
rpfilter_DROPentry, disable the filter using the following configuration in the/etc/firewalld/firewalld.conffile:IPv6_rpfilter=no
IPv6_rpfilter=noCopy to Clipboard Copied! Toggle word wrap Toggle overflow
12.4. Configuring a TFTP server for BIOS-based clients Copy linkLink copied to clipboard!
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.
yum install tftp-server
# yum install tftp-serverCopy to Clipboard Copied! Toggle word wrap Toggle overflow Allow incoming connections to the
tftp servicein the firewall:firewall-cmd --add-service=tftp
# firewall-cmd --add-service=tftpCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command enables temporary access until the next server reboot.
optional: To enable permanent access, add the
--permanentoption to the command.Depending on the location of the installation ISO file, you might have to allow incoming connections for HTTP or other services.
Access the
pxelinux.0file from theSYSLINUXpackage in the DVD ISO image file, where my_local_directory is the name of the directory that you create: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,roCopy to Clipboard Copied! Toggle word wrap Toggle overflow cp -pr /mount_point/BaseOS/Packages/syslinux-tftpboot-version-architecture.rpm /my_local_directory
# cp -pr /mount_point/BaseOS/Packages/syslinux-tftpboot-version-architecture.rpm /my_local_directoryCopy to Clipboard Copied! Toggle word wrap Toggle overflow umount /mount_point
# umount /mount_pointCopy to Clipboard Copied! Toggle word wrap Toggle overflow Extract the package:
rpm2cpio syslinux-tftpboot-version-architecture.rpm | cpio -dimv
# rpm2cpio syslinux-tftpboot-version-architecture.rpm | cpio -dimvCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
pxelinux/directory intftpboot/and copy all the files from the directory into thepxelinux/directory:mkdir /var/lib/tftpboot/pxelinux
# mkdir /var/lib/tftpboot/pxelinuxCopy to Clipboard Copied! Toggle word wrap Toggle overflow cp /my_local_directory/tftpboot/* /var/lib/tftpboot/pxelinux
# cp /my_local_directory/tftpboot/* /var/lib/tftpboot/pxelinuxCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the directory
pxelinux.cfg/in thepxelinux/directory:mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfg
# mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfgCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a configuration file named
defaultand add it to thepxelinux.cfg/directory as shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
The installation program cannot boot without its runtime image. Use the
inst.stage2boot 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.repomust contain a valid.treeinfofile. -
When you select the RHEL8 installation DVD as the installation source, the
.treeinfofile points to the BaseOS and the AppStream repositories. You can use a singleinst.repooption 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-8/:mkdir -p /var/lib/tftpboot/pxelinux/images/RHEL-8/ cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/images/RHEL-8/# mkdir -p /var/lib/tftpboot/pxelinux/images/RHEL-8/ # cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/images/RHEL-8/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the
tftp.socketservice:systemctl enable --now tftp.socket
# systemctl enable --now tftp.socketCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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 when prompted to specify a boot source, and start the network installation.
12.5. Configuring a TFTP server for UEFI-based clients Copy linkLink copied to clipboard!
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 8 UEFI PXE boot supports a lowercase file format for a MAC-based GRUB menu file. For example, the MAC address file format for GRUB is grub.cfg-01-aa-bb-cc-dd-ee-ff
Procedure
As root, install the following package.
yum install tftp-server
# yum install tftp-serverCopy to Clipboard Copied! Toggle word wrap Toggle overflow Allow incoming connections to the
tftp servicein the firewall:firewall-cmd --add-service=tftp
# firewall-cmd --add-service=tftpCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command enables temporary access until the next server reboot.
Optional: To enable permanent access, add the
--permanentoption to the command.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,roCopy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the EFI boot images from the DVD ISO image:
mkdir /var/lib/tftpboot/redhat cp -r /mount_point/EFI /var/lib/tftpboot/redhat/ umount /mount_point
# mkdir /var/lib/tftpboot/redhat # cp -r /mount_point/EFI /var/lib/tftpboot/redhat/ # umount /mount_pointCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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! Toggle word wrap Toggle overflow Replace the content of
/var/lib/tftpboot/redhat/efi/boot/grub.cfgwith the following example:set timeout=60 menuentry 'RHEL 8' { linux images/RHEL-8/vmlinuz ip=dhcp inst.repo=http://192.168.124.2/RHEL-8/x86_64/iso-contents-root/ initrd images/RHEL-8/initrd.img }set timeout=60 menuentry 'RHEL 8' { linux images/RHEL-8/vmlinuz ip=dhcp inst.repo=http://192.168.124.2/RHEL-8/x86_64/iso-contents-root/ initrd images/RHEL-8/initrd.img }Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
The installation program cannot boot without its runtime image. Use the
inst.stage2boot 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.repomust contain a valid.treeinfofile. -
When you select the RHEL8 installation DVD as the installation source, the
.treeinfofile points to the BaseOS and the AppStream repositories. You can use a singleinst.repooption 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/images/RHEL-8/:mkdir -p /var/lib/tftpboot/images/RHEL-8/ cp /mount_point/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/images/RHEL-8/# mkdir -p /var/lib/tftpboot/images/RHEL-8/ # cp /mount_point/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/images/RHEL-8/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the
tftp.socketservice:systemctl enable --now tftp.socket
# systemctl enable --now tftp.socketCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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 when prompted to specify a boot source, and start the network installation.
12.6. Configuring a network server for IBM Power systems Copy linkLink copied to clipboard!
You can configure a network boot server for IBM Power systems by using GRUB.
Procedure
As root, install the following packages:
yum install tftp-server dhcp-server
# yum install tftp-server dhcp-serverCopy to Clipboard Copied! Toggle word wrap Toggle overflow Allow incoming connections to the
tftpservice in the firewall:firewall-cmd --add-service=tftp
# firewall-cmd --add-service=tftpCopy to Clipboard Copied! Toggle word wrap Toggle overflow This command enables temporary access until the next server reboot.
Optional: To enable permanent access, add the
--permanentoption to the command.Depending on the location of the installation ISO file, you might have to allow incoming connections for HTTP or other services.
Create a GRUB network boot directory inside the TFTP root:
grub2-mknetdir --net-directory=/var/lib/tftpboot
# grub2-mknetdir --net-directory=/var/lib/tftpboot Netboot directory for powerpc-ieee1275 created. Configure your DHCP server to point to /boot/grub2/powerpc-ieee1275/core.elfCopy to Clipboard Copied! Toggle word wrap Toggle overflow The command output informs you of the file name that needs to be configured in your DHCP configuration, described in this procedure.
If the PXE server runs on an x86 machine, the
grub2-ppc64le-modulesmust be installed before creating aGRUB2network boot directory inside the tftp root:yum install grub2-ppc64le-modules
# yum install grub2-ppc64le-modulesCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a GRUB configuration file:
/var/lib/tftpboot/boot/grub2/grub.cfgas shown in the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
The installation program cannot boot without its runtime image. Use the
inst.stage2boot 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.repomust contain a valid.treeinfofile. -
When you select the RHEL8 installation DVD as the installation source, the
.treeinfofile points to the BaseOS and the AppStream repositories. You can use a singleinst.repooption to load both repositories.
-
The installation program cannot boot without its runtime image. Use the
Mount the DVD ISO image using the command:
mount -t iso9660 /path_to_image/name_of_iso/ /mount_point -o loop,ro
# mount -t iso9660 /path_to_image/name_of_iso/ /mount_point -o loop,roCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a directory and copy the
initrd.imgandvmlinuzfiles from DVD ISO image into it, for example:cp /mount_point/ppc/ppc64/{initrd.img,vmlinuz} /var/lib/tftpboot/grub2-ppc64/# cp /mount_point/ppc/ppc64/{initrd.img,vmlinuz} /var/lib/tftpboot/grub2-ppc64/Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure your DHCP server to use the boot images packaged with
GRUB2as shown in the following example. If you already have a DHCP server configured, then perform this step on the DHCP server.Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Adjust the sample parameters
subnet,netmask,routers,fixed-addressandhardware ethernetto fit your network configuration. Thefile nameparameter; this is the file name that was outputted by thegrub2-mknetdircommand earlier in this procedure. On the DHCP server, start and enable the
dhcpdservice. If you have configured a DHCP server on the localhost, then start and enable thedhcpdservice on the localhost.systemctl enable --now dhcpd
# systemctl enable --now dhcpdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the
tftp.socketservice:systemctl enable --now tftp.socket
# systemctl enable --now tftp.socketCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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 when prompted to specify a boot source, and start the network installation.