Setting Up the Network Server

Preparing a server for a network installation consists of the following general tasks:

How to Configure NFS

If you have an existing NFS server, you can use this service to host the extracted contents of an ISO and any Kickstart configuration files. Ensure that the exported share directories are accessible to the IP ranges specified for the PXE boot hosts.

If you don't have an available NFS server, use the following procedure to install and configure the service to enable network installation.

Note:

These NFS configuration steps are limited only to what's relevant to a network installation.

  1. Install the nfs-utils package:
    sudo dnf install nfs-utils -y
  2. If you're running a firewall service, add the nfs service to the firewall rules.
    sudo firewall-cmd --add-service nfs --permanent

    If you're using an alternative firewall service or you have an external firewall device, ensure that you configure rules that grant PXE boot hosts access to the NFS service on this system.

  3. Create a directory to store the ISO image, for example:
    sudo mkdir /var/nfs-exports/ISOs
  4. Export the NFS share directory.
    sudo exportfs -i -o ro [subnet]:/var/nfs-exports/ISOs

    This syntax grants world access to the NFS share with read-only permissions. Adding subnet, for example 192.0.2.0/24:/var/nsf-exports/ISOs, limits access only to the subnet's clients.

    Alternatively, you can add an entry for exporting the share directory in the /etc/exports file, for example:

    /var/nsf-exports/ISOs   192.0.2.0/24(ro)

    Then, reload the /etc/exports to implement the entry:

    sudo exportfs -ra

    For more information, see the exportfs(8), exports(5), and showmount(8) manual pages.

  5. Enable and start the nfs-server service:
    sudo systemctl enable --now nfs-server
  6. Extract the downloaded ISO image to a subdirectory of the NFS share directory:
    sudo cp -a T path-to-download-image /var/nfs-exports/ISOs/ol8
  7. If using Kickstart, put the Kickstart files in a subdirectory of the NFS share directory also, such as /var/nfs-exports/ISOs/ksfiles.
  8. (Optional) From a different system, verify that the NFS share directory is accessible, for example:
    sudo mount -t nfs NFS-server-ip:/var/nfs-exports/ISOs /mnt

How to Configure dnsmasq

The dnsmasq router advertisement server is designed to act as a DNS forwarder, DHCP server, and TFTP server. Dnsmasq is applicable in most network installation scenarios and is therefore a convenient alternative to configuring separate DHCP and TFTP services.

For more information about dnsmasq, see the dnsmasq(8) manual page, the /usr/share/doc/dnsmasq-version file, and https://thekelleys.org.uk/dnsmasq/doc.html.

  1. Install the dnsmasq package.
    sudo dnf install dnsmasq -y
  2. Configure parameters in the /etc/dnsmasq.conf file.
    • At a minimum, you must have the enable-tftp entry and a defined TFTP server directory for tftp-root. See the entries in bold in the following example:

      interface=em1
      dhcp-range=10.0.0.101,10.0.0.200,6h
      dhcp-host=80:00:27:c6:a1:16,10.0.0.253,svr1,infinite
      dhcp-boot=pxelinux/pxelinux.0
      dhcp-match=set:efi-x86_64,option:client-arch,8
      dhcp-boot=tag:efi-x86_64,shim.efi
      enable-tftp
      tftp-root=/var/lib/tftpboot

      Note:

      If SELinux is enabled in enforcing mode on the system and you configured a TFTP server directory other than /var/lib/tftpboot, install the policycoreutils-python and policycoreutils packages to enable you to run the following commands:

      sudo /usr/sbin/semanage fcontext -a -t tftpdir_t "/var/tftpboot(/.*)?"
      sudo /sbin/restorecon -R -v /var/tftpboot

      These commands define the default file type of the TFTP server directory hierarchy as tftpdir_t and apply the file type to the entire directory hierarchy.

      The following list describes the other parameters in the /etc/dnsmasq.conf file:

      interface

      Specifies the interface to be monitored for incoming client requests.

      dhcp-range

      Identifies a range of available IP addresses. The 6h setting in the example above specifies a six-hour lease of the addresses.

      To configure static addresses with infinite leases, instead of a pool, specify a static network address and use the static and infinite keywords, for example:

      dhcp-range=10.0.0.253,static,infinite
      dhcp-host

      Specifies a reserved IP address for a client system. The system is identified by its name and MAC address.

      dhcp-boot

      Specifies the location of the boot loader file for clients, such as pxelinux/pxelinux.0 for BIOS-based clients. For UEFI-based clients, include the tag:efi-x86_64 keyword in the setting before specifying the boot loader, for example:

      dhcp-boot=tag:efi-x86_64,shim.efi

      You must create separate entries for BIOS-based and UEFI-based clients.

    • Uncomment the tftp-no-blocksize line in the file as shown:
      # This option stops dnsmasq from negotiating a larger blocksize for TFTP
      # transfers. It will slow things down, but may rescue some broken TFTP
      # clients.
      tftp-no-blocksize
  3. (Optional) To use dnsmasq as a caching-only name server, do the following:
    1. In the /etc/resolv.conf file, configure a name server entry for 127.0.0.1 that precedes other name server entries, for example:

      nameserver 127.0.0.1
      nameserver 10.0.0.8
      nameserver 10.0.0.4

      The dnsmasq server ignores the 127.0.0.1 entry and forwards DNS queries to the other listed name servers.

    2. Configure the firewall to accept DNS requests:

      sudo firewall-cmd --add-service=dns --permanent
  4. Enable and start the dnsmasq service.
    sudo systemctl enable --now dnsmasq