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


In RHEL/CentOS 7, setting up a PXE Arrange Boot Server for a few Linux conveyances is required when building a server that empowers arrange booting for client gadgets. This empowers the network-based establishment of numerous Linux distributions without the need for physical establishment discs.

The first step in setting it up is introducing the desired bundles, including DHCP, TFTP, and Syslinux. The DHCP server should at that point be configured to supply the client computers with IP addresses and arrange boot data. After that, set up the TFTP server to grant boot records and pictures for introducing Linux.

When the servers are set up, make the appropriate catalog structures and duplicate the pertinent records to the TFTP server catalog. Arrange the Syslinux bootloader's menu choices and booting choices.

Add numerous Linux distributions and their establishment pictures to the boot menu, final but not least. Restart the vital administrations, and client workstations will be able to boot over the arrange and introduce different Linux distributions utilizing the PXE arrange boot server.

Methods Used

  • Manual Configuration

  • Automated Tools

Manual Configuration

RHEL/CentOS 7 manual configuration entails carrying out each configuration step separately in order to set up a PXE Network Boot Server for multiple Linux distribution installs. Install and set up the Syslinux, DHCP, and TFTP packages first. Create a customized configuration file for the DHCP server to give the client computers IP addresses and boot settings. Configure the TFTP server to serve Linux installation images and boot files. The essential files must be copied to the TFTP server directory after the necessary directory structures have been created. Set menu settings and configure the Syslinux bootloader to handle network booting. Create a custom boot menu that offers a variety of Linux distributions and their installation images. In order to enable client workstations to boot over the network and install various Linux distributions using the PXE network boot server, restart the relevant services.

Algorithm

  • Install the necessary packages, including Syslinux, DHCP, and TFTP.

sudo yum install dhcp tftp syslinux -y
  • Set the DHCP server up −

    • Modify the configuration file for the DHCP server.

    • Provide client machines with IP addresses and startup options.

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;
   filename "pxelinux.0";
}
  • Configure your TFTP server 

    • Set the TFTP server configuration.

    • Establish the required directory structure.

    • Transfer Linux installation images and boot files to the TFTP server directory.

sudo systemctl enable tftp
sudo systemctl start tftp
sudo mkdir /var/lib/tftpboot
sudo cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
  • Syslinux's bootloader as a portion of the PXE server arrangement

    • Modify the configuration file for Syslinux.

    • Modify the configuration file for Syslinux.

default linux
prompt 1
timeout 100

label linux
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=ftp://192.168.1.10/pub/ks.cfg
  • Modify the startup menu 

    • Modify the configuration file for the bootloader.

    • Compile installation images for various Linux distributions.

  • The DHCP and TFTP services should be restarted.

sudo systemctl restart dhcpd
sudo systemctl restart tftp
  • Verify that the firewall settings, network connectivity, and permissions are all proper.

  • Client machines can now use the PXE network boot server to boot over the network and install other Linux distributions.

Automated Tools

In RHEL/CentOS 7, automated tools make it easier to configure a PXE Network Boot Server for multiple Linux distribution installs. Such tools include "Cobbler" and "Foreman," for instance. The setup is simpler and more effective using these tools.

The chosen utility offers a web interface for configuration after installation. You can specify network and server settings using this interface. The tool's repository allows you to input ISO images of Linux distributions, and the repository automatically stores and arranges these images.

The tools also offer possibilities for configuring boot menus, profiles, and customizations. The kernel options, installation settings, and package choices can all be customized for any Linux distribution.

You do not need to manually configure the underlying procedures, such as DHCP, TFTP, and Syslinux setups, because the automated tools take care of them. This makes it simpler and more user-friendly to set up a PXE Network Boot Server.

Algorithm

  • Introduce the chosen computerized apparatus (Cobbler or Foreman) on the server. These devices streamline the process of overseeing and sending Linux distributions.

sudo yum install cobbler cobbler-web
  • Configure the organizational interface of the server by indicating IP addresses, subnet veils, and door points of interest. This guarantees appropriate communication inside the network.

sudo systemctl start cobblerd
sudo systemctl start httpd
  • Import ISO records for the specified Linux distributions into the store of the computerised device. ISO records contain the establishment pictures of the Linux distributions.

sudo vi /etc/cobbler/settings
  • Define the Linux conveyances and their comparing establishment pictures to make boot menu alternatives. This permits clients to select the specified Linux conveyance during installation.

sudo mount /dev/cdrom /mnt
sudo cobbler import --name=<distribution_name> --path=/mnt --arch=<architecture> --breed=<distribution_type>
  • Create unmistakable profiles for each Linux device. These profiles can be customized with diverse bit settings, establishment choices, and bundle selections.

sudo vi /etc/cobbler/pxe/pxedefault.template
  • Ensure that the arrangement and firewall settings of the organization permit client computers to get to the PXE server. This empowers clients to boot from the PXE server and introduce Linux distributions.

sudo cobbler profile edit --name=<distribution_name> --kickstart=<kickstart_file_path>
  • Save the arrangement choices and start the PXE server. This permits the server to respond to PXE boot demands from client computers.

sudo iptables -A INPUT -p udp --dport 67:68 --sport 67:68 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 69 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 4011 -j ACCEPT
sudo service iptables save
sudo service iptables restart
  • Conserve the setup options and turn on the PXE server.

sudo cobbler sync
sudo systemctl restart cobblerd
  • Restart any vital applications to apply the changes made during the setup process.

sudo systemctl restart httpd
sudo systemctl restart dnsmasq
  • Boot a client computer from the computerised instrument (Cobbler or Foreman) and endeavour to introduce a Linux distribution. This serves as a test to confirm the usefulness of the PXE Organise Boot Server.

Conclusion

In conclusion, RHEL/CentOS 7 allows for the manual configuration or use of automated tools to configure a PXE Network Boot Server for multiple Linux distribution installations. When manual configuration is used, the procedure entails manually configuring the bootloader, boot menu, and server settings as well as installing and configuring DHCP, TFTP, and Syslinux packages. While providing a user-friendly web interface for configuring network settings, importing Linux distribution ISOs, customizing boot menus, and managing profiles, automated tools like Cobbler or Foreman streamline the setup procedure. Whatever the method, ensuring effective network booting and installation of different Linux distributions requires correct network connectivity, firewall configuration, and testing.

Updated on: 03-Aug-2023

204 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements