Multiple subnet PXE installation with Linux DHCP

Linux DHCP PXE

In computing, the Pre-boot Execution Environment describes a standardized client-server environment that boots a software or operating system, retrieved from a network, on PXE-enabled clients. On the client side it requires only a PXE-enabled network interface controller or LAN card, and uses a small set of industry-standard network protocols such as DHCP and TFTP to retrieve a dynamic IP and load the flash image over network. Refer to the solution section for more details.

Topic

  • Linux DHCP configuration to support multiple-subnet PXE environment
  • How to setup a DHCP server to support multiple-subnet PXE environment?
  • Multiple-Subnet PXE environemnt configuration with Linux DHCP

apt

  • Linux
  • Centos
  • RHEL
  • Ubuntu
  • Debian
  • Suse
  • Arch Linux
  • Windows

Solution


Setup details

  • DHCP Server has 2 NIC adapters with two network subnets
  • Subnets: 192.168.10.0/24, 192.168.11.0/24
  • DHCP/TFTP server IP: 192.168.10.10(eth0), 192.168.11.10(eth1)
  • DHCP and TFTP server on a single system has 192.168.10.10 and 192.168.11.10 IP addresses.

Configuration

Prerequisites

DHCP Configuration

Following are the sample DHCP configuration present in /etc/dhcp/dhcpd.conf file supports multiple subnet PXE installation.

authoritative;
allow booting;
allow bootp;
option option-128 code 128 = string;
option option-129 code 129 = text;

subnet 192.168.10.0 netmask 255.255.255.0 {
        option routers                  192.168.10.1;
        option subnet-mask              255.255.255.0;
        option broadcast-address       192.168.10.255;
        option domain-name-servers     192.168.10.4;
        default-lease-time 28800;
        max-lease-time 57600;
        next-server 192.168.10.10;  ### TFTP Server
        filename "pxelinux.0";        ### Pxe File for netboot

        pool {      
                range 192.168.10.100 192.168.10.200;
                allow unknown-clients;
                }
}

subnet 192.168.11.0 netmask 255.255.255.0 {
        option routers                  192.168.11.1;
        option subnet-mask              255.255.255.0;
        option broadcast-address       192.168.11.255;
        option domain-name-servers     192.168.11.4;
        default-lease-time 28800;
        max-lease-time 57600;
        next-server 192.168.11.10;  ### TFTP Server
        filename "pxelinux.0";        ### Pxe File for netboot

        pool {      
                range 192.168.11.100 192.168.11.200;
                allow unknown-clients;
                }
}

Now configure DHCP to listen on eth0 and eth1 to receive DHCP incoming traffic.

# cat /etc/sysconfig/dhcpd 
INTERFACES="eth0 eth1"

Restart DHCPD service and test PXE installation from multiple network subnets.

You May Also Like

avatar

About the Author: TekFik

TekFik is a technical blogging site helps techies and engineers to solve their day to day issues and also allows everyone to share knowledge and feedback. Please feel free to contact us at tekfik.rd@gmail.com if there is anything.

Leave a Reply

Your email address will not be published. Required fields are marked *