Setting up a ëPXE Network Boot Server\' for Multiple Linux Distribution Installations in RHEL/CentOS 7

PXE (Preboot eXecution Environment) Network Boot Server enables client machines to boot over the network and install Linux distributions without physical installation media. In RHEL/CentOS 7, this requires setting up DHCP, TFTP, and Syslinux services to serve boot files and installation images to client systems.

The setup involves installing required packages (DHCP, TFTP, Syslinux), configuring the DHCP server to provide IP addresses and boot parameters, setting up the TFTP server to serve boot files, and creating bootloader menus for multiple Linux distributions.

Methods Used

  • Manual Configuration Step-by-step setup of individual services

  • Automated Tools Using tools like Cobbler or Foreman for simplified management

Manual Configuration

Manual configuration involves installing and configuring each service separately. This approach provides complete control over the setup but requires detailed knowledge of each component.

Step-by-Step Setup

Step 1: Install required packages

sudo yum install dhcp tftp-server syslinux xinetd -y

Step 2: Configure DHCP server

Edit /etc/dhcp/dhcpd.conf to provide IP addresses and boot parameters:

subnet 192.168.1.0 netmask 255.255.255.0 {
   range 192.168.1.100 192.168.1.200;
   option routers 192.168.1.1;
   option domain-name-servers 8.8.8.8;
   filename "pxelinux.0";
   next-server 192.168.1.10;
}

Step 3: Configure TFTP server

Enable TFTP service and create directory structure:

sudo systemctl enable xinetd
sudo systemctl start xinetd
sudo mkdir -p /var/lib/tftpboot/pxelinux.cfg
sudo cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
sudo cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/

Step 4: Configure Syslinux bootloader

Create /var/lib/tftpboot/pxelinux.cfg/default:

default menu.c32
prompt 0
timeout 100
MENU TITLE PXE Boot Menu

LABEL centos7
  MENU LABEL CentOS 7
  kernel centos7/vmlinuz
  append initrd=centos7/initrd.img inst.stage2=http://192.168.1.10/centos7

LABEL ubuntu1804
  MENU LABEL Ubuntu 18.04
  kernel ubuntu1804/vmlinuz
  append initrd=ubuntu1804/initrd.gz url=http://192.168.1.10/ubuntu1804

Step 5: Start services

sudo systemctl restart dhcpd
sudo systemctl restart xinetd
sudo systemctl enable dhcpd
sudo systemctl enable xinetd

Automated Tools

Automated tools like Cobbler and Foreman simplify PXE server setup by providing web interfaces and automated configuration management. These tools handle the underlying DHCP, TFTP, and bootloader configurations automatically.

Using Cobbler

Step 1: Install Cobbler

sudo yum install epel-release -y
sudo yum install cobbler cobbler-web dnsmasq -y

Step 2: Configure Cobbler settings

Edit /etc/cobbler/settings with server IP and network details:

sudo systemctl start cobblerd
sudo systemctl start httpd
sudo systemctl enable cobblerd
sudo systemctl enable httpd

Step 3: Import Linux distributions

sudo mount /dev/cdrom /mnt
sudo cobbler import --name=centos7 --path=/mnt --arch=x86_64

Step 4: Synchronize configuration

sudo cobbler sync

Network Setup Requirements

Configure firewall rules to allow PXE traffic:

sudo firewall-cmd --permanent --add-service=dhcp
sudo firewall-cmd --permanent --add-service=tftp
sudo firewall-cmd --permanent --add-port=4011/tcp
sudo firewall-cmd --reload

Comparison

Aspect Manual Configuration Automated Tools
Setup Complexity High requires detailed knowledge Low web interface guided setup
Control Level Complete control over all settings Simplified with reasonable defaults
Maintenance Manual updates and management Automated management features
Learning Curve Steep need to understand each service Gentle intuitive web interface

Conclusion

Setting up a PXE Network Boot Server in RHEL/CentOS 7 can be accomplished through manual configuration or automated tools. Manual setup provides complete control but requires extensive knowledge of DHCP, TFTP, and bootloader configurations. Automated tools like Cobbler simplify the process with web-based management while handling the underlying complexity automatically.

Updated on: 2026-03-17T09:01:39+05:30

500 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements