Questo contenuto non è disponibile nella lingua selezionata.
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 Copia collegamentoCollegamento copiato negli appunti!
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 to prepare for an installation of Red Hat Enterprise Linux from a network by using HTTP or PXE is as follows:
- 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 Copia collegamentoCollegamento copiato negli appunti!
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! Toggle word wrap Toggle overflow 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.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the DHCPv4 service:
systemctl enable --now kea-dhcp4
# systemctl enable --now kea-dhcp4
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.3. Configuring the DHCPv6 server for network boot Copia collegamentoCollegamento copiato negli appunti!
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! Toggle word wrap Toggle overflow 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.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the DHCPv6 service:
systemctl enable --now kea-dhcp6
# systemctl enable --now kea-dhcp6
Copy 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_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! Toggle word wrap Toggle overflow
7.4. Configuring a TFTP server for BIOS-based clients Copia collegamentoCollegamento copiato negli appunti!
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! Toggle word wrap Toggle overflow Allow incoming connections to the
tftp service
in the firewall:firewall-cmd --add-service=tftp
# firewall-cmd --add-service=tftp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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! Toggle word wrap Toggle overflow 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! 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.cfg
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a configuration file named
default
and 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.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! Toggle word wrap Toggle overflow Start and enable the
tftp.socket
service:systemctl enable --now tftp.socket
# systemctl enable --now tftp.socket
Copy 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 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 Copia collegamentoCollegamento copiato negli appunti!
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! Toggle word wrap Toggle overflow Allow incoming connections to the
tftp service
in the firewall:firewall-cmd --add-service=tftp
# firewall-cmd --add-service=tftp
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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! 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/
# mkdir /var/lib/tftpboot/redhat # cp -r /mount_point/EFI /var/lib/tftpboot/redhat/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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! 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.cfg
with the following example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
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! 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 or Network Boot when prompted to specify a boot source, and start the network installation.