PXE Boot with old-style dhcp and tftp

In this article I'm covering the use of old-style dhcp and tftp, which is useful for company networks that have/need a complete dhcp server running. Personally, for smaller setups, I now prefer dnsmasq to do the job.

Booting from PXE

With most modern onboard and PCI network interface cards (NICs), it's possible to boot from the network. This system is called PXE.

Why would I want to boot from the network?

  • For installation of a computer without using CDs/DVD's
  • For thin clients
  • For booting diagnostic software
  • What is needed for PXE Boot?

  • a network card that supports PXE
  • a bios that supports plugin boot cards
  • a DHCP server
  • a TFTP server
  • some (open source) software you want to run
  • How to set up PXE boot?

    As I'm running (a variant of) RedHat Linux, I only cover how to set up PXE boot using Linux components. But there are Windows solutions as well. (Google it!)

    Step 1: set up DHCP

    When the NIC boots, it needs to get IP settings. Setup dhcp as usual. Now add these lines to the configuration:
    next-server 192.168.1.254;
    filename "/pxelinux.0";

    In the place of 192.168.1.254, you need to enter your own tftp server address.

    On my RH system, I installed the dhcp server using yum install dhcp, then configured /etc/dhcpd.conf as follows:

    ddns-update-style ad-hoc;
    authoritative;
    log-facility local0;
    default-lease-time 86400;
    max-lease-time 86400;
    subnet 192.168.1.0 netmask 255.255.255.0{
    range 192.168.1.100 192.168.1.200; #limited range
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.254;
    option domain-name-servers 192.168.1.254;
    option domain-name "lan";
    next-server 192.168.1.254;
    filename "/pxelinux.0";
    }

    Step 2: set up TFTP

    Download and install a tftp server. Most Linuxes ship their own, which you can install using yum (RedHat), yast (SuSE), apt-get (debian/ubuntu) or similar.

    On my RedHat, I install a tftp server by running yum install tftp-server. Then I enable it using /sbin/chkconfig tftp on and reload xinetd: /sbin/service xinetd restart.

    Step 3: download and install syslinux

    On my RedHat system, I install syslinux by running yum install syslinux. I then copy the syslinux.0 file to /tftpboot: cp /usr/lib/syslinux/pxelinux.0 /tftpboot

    Optional: Firewall

    On a default RedHat installation, the firewall is enabled. You may need to open port 67-69 for dhcpd and tftp to function and port 53 for DNS.

    Links

    More details are described on
    http://syslinux.zytor.com/wiki/index.php/PXELINUX

    © GeekLabInfo PXE Boot with old-style dhcp and tftp is a post from GeekLab.info. You are free to copy materials from GeekLab.info, but you are required to link back to http://www.geeklab.info

    1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading...