Install
I use Gentoo Linux for my server so I used emerge to install the required server packages.
emerge tftp-hpa dhcp
TFTP Configuration
Edit your /etc/conf.d/in.tftpd file and uncomment one of the INTFTPD_PATH lines. You will then need to make the directory referenced in that variable. It will store all of your TFTP files used by your clients. We will refer to this as your tftproot in the rest of this article.
DHCP
Edit your /etc/dhcp/dhcpd.conf to include these next few lines.
filename "pxelinux.0";
next-server 192.168.0.20; # IP of your TFTP server
Start the services
Start the services after you have configured them.
/etc/init.d/in.tftpd start
/etc/init.d/dhcpd start
PXE Configuration
This needs to be in your /tftproot/pxelinux.cfg/default file.
UI vesamenu.c32
DEFAULT Localboot
PROMPT 0
MENU TITLE PXE SERVER
TIMEOUT 150
TOTALTIMEOUT 900
LABEL Localboot
MENU LABEL Boot local drive
LOCALBOOT -1
MENU SEPARATOR
What this will do is present the user with a menu and default to booting the local hard drive after a 15 second timeout.
More menus can easily be added at the end of this file.
Next, we need to copy some files into the tftproot directory for your clients to load.
cp /usr/share/syslinux/ldlinux.c32 /tftproot
cp /usr/share/syslinux/libcom32.c32 /tftproot
cp /usr/share/syslinux/libutil.c32 /tftproot
cp /usr/share/syslinux/lpxelinux.0 /tftproot
cp /usr/share/syslinux/memdisk /tftproot
cp /usr/share/syslinux/menu.c32 /tftproot
cp /usr/share/syslinux/pxelinux.0 /tftproot
cp /usr/share/syslinux/vesamenu.c32 /tftproot
Conclusion
That is it. Your clients should now be able to network boot. There probably isn’t much to boot, but that is for another article.