Open In App

How to setup a PXE boot server with NFS on CentOS?

Last Updated : 24 Mar, 2023
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
Report

Pre-boot eXecution Environment, or PXE, is a protocol based on BootP, DHCP, and TFTP and is often used for remote booting and operating system installation on many connected machines to the same network. A PXE server supplies the boot and installs images for PXE, which operates in a client-server context. The client is essentially a Network Interface Card (NIC) with PXE functionality on a bare computer that receives images from the PXE server for installation and booting. For network installation of Linux operating systems and remote booting of diskless computers with light or compact operating systems, PXE boot client-server environments are frequently employed. In this post, we'll demonstrate how to set up a Network Installation Server on a computer using PXE boot and NFS.

Setup a PXE boot server with NFS on CentOS

Follow the below steps to set up a PXE boot server with NFS on CentOS:

Step 1: Install and set up the DNSMASQ server

We must emphasize that one of your network interfaces needs to be set up with a static IP address. Update your system software packages and install the DNSMASQ daemon after configuring a static IP address.

# dnf install dnsmasq
Installing dnsmaq
 

Step 2: Locate containing the /etc/dnsmasq.conf default configuration file

When DNSMASQ is installed, its default configuration file is located in the /etc/dnsmasq.conf directory.

# mv /etc/dnsmasq.conf  /etc/dnsmasq.conf.backup
# nano /etc/dnsmasq.conf
Locate /etc/dnsmasq-conf file
 

Step 3: Install the SYSLINUX bootloaders

Use the following command to install the Syslinux PXE bootloader package once DNSMASQ's primary setup is complete.

# dnf install syslinux
Installing SYSLINUX bootloaders
 

Step 4: PXE bootloaders for Syslinux

By using the ls command as demonstrated, you can verify that the Syslinux PXE bootloaders are installed at /usr/share/syslinux.

# ls /usr/share/syslinux
PXE bootloaders for Syslinux
 

Step 5: Install TFTP-Server and copy it using the SYSLINUX Bootloaders

Install TFTP-Server after that, and then do as instructed to copy all of the Syslinux bootloaders from /usr/share/syslinux to /var/lib/tftpboot.

# dnf install tftp-server
# cp -r /usr/share/syslinux/* /var/lib/tftpboot
Installing TFTP Server
 

Step 6: Configure the PXE Server Configuration File

The following commands should be used first to generate a default file and a directory called pxelinux.cfg.

# mkdir /var/lib/tftpboot/pxelinux.cfg
# touch /var/lib/tftpboot/pxelinux.cfg/default
Configuring PXE Server
 

Step 7: Installation of the Linux distribution correctly

It's important to keep in mind that the paths specified in this file must be relative to the /var/lib/tftpboot directory.

# nano /var/lib/tftpboot/pxelinux.cfg/default
Installing Linux Distribution
 

Step 8: Update the PXE Server using CentOS 8 boot images

The CentOS 8 DVD ISO Image must be downloaded locally using the wget command and mounted in order to add CentOS 8 images to PXE Server.

Updating PXE Server using CentOS
 

Conclusion:

PXE is a strong tool that can make the jobs of all information technology professionals much easier. Clients, servers, virtual machines (VM), and embedded internet of things (IoT) devices can all benefit from it.


Next Article

Similar Reads