General Information
In order to install an OS via PXE boot, a TFTP and DHCP server are required.
Using PXE allows for clients to begin a network installation without any net-install ISO.
Checklist
yum install tftp-server xinetd
vim /etc/xinetd.d/tftp service tftp { ....some other variables... disable = no ....some other variables... }
systemctl start xinetd
systemctl enable xinetd
firewall-cmd --permanent --add-service=tftp firewall-cmd --reload
yum install dhcp
vim /etc/dhcp/dhcpd.conf subnet 192.168.1.0 netmask 255.255.255.0 { option routers 192.168.1.254 ; range 192.168.1.240 192.168.1.250 ; next-server 192.168.1.150 ; filename "pxelinux.0" ; }
systemctl start dhcp
systemctl enable dhcp
Now that both required services are setup, it is time to create the PXE boot content to be handed out over TFTP.
yum install syslinux
mkdir -p /var/lib/tftpboot/pxelinux.cfg mkdir /var/lib/tftpboot/centos7/
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
vim /var/lib/tftpboot/pxelinux.cfg/default default menu.c32 prompt 0 timeout 600 menu title ########## PXE Boot Menu ########## label 1 menu label ^1) Install CentOS 7.2 x86-64 kernel centos7/vmlinuz append initrd=centos7/initrd.img method=nfs:<nfs-ip>:/iso/centos7.2-dvd/
cp /boot/grub/splash.xpm.gz /var/lib/tftpboot/
mount -t iso9660 -o loop CentOS-7-x86_64-DVD-1511.iso /mnt cp /mnt/images/pxeboot/vmlinuz /var/lib/tftpboot/centos7/ cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot/centos7/
systemctl restart dhcpd systemctl restart xinetd
The system is now ready to accept incoming PXE boot requests.
/var/lib/tftpboot/ contains:
/var/lib/tftpboot/centos7 contains:
/var/lib/tftpboot/pxelinux.cfg contains: