So in part 2 we setup the DHCP server. It referenced a TFTP server in its configuration, so now we need to configure the TFTP server ready to do some neat stuff.
In Centos 7, the service starts by default from xinetd, so we need to edit /etc/xinetd.d/tftp and set ‘disable’ to ‘no’. Kick the xinetd service:
systemctl enable xinetd systemctl xinetd start
And now we need some extra help, starting with another package – syslinux.
yum -y install syslinux
…and we need some files from that copying to the TFTP server directory, in our case /var/lib/tftpboot:
cd /usr/share/syslinux cp -p pxelinux.0 menu.c32 memdisk mboot.c32 chain.c32 /var/lib/tftpboot/
Now that bit’s done (and see there, that pxelinux.0 file is the one referenced in the last post by the DHCP server) we also need a config file. There are several places under the TFTP root that PXE boot systems will look for which I won’t go into here, as we’re going to use the default. So we:
mkdir -p /var/lib/tftpboot/pxelinux.cfg/
In there, we need a file called ‘default’. That contains the following (for an automated installation, anyway):
default menu.c32 prompt 0 timeout 50 ONTIMEOUT kickstart MENU TITLE PXE Menu LABEL kickstart MENU LABEL Kickstart kernel /centos/images/pxeboot/vmlinuz append initrd=/centos/images/pxeboot/initrd.img inst.ks=http://10.30.110.40/ks.cfg ip=dhcp LABEL run MENU LABEL run (local boot) LOCALBOOT 0
But… where do all those other files come from? You know, the kernel, initrd, and that pesky ks.cfg? Read on!