/var/lib/tftpboot/
├── boot.msg
├── chain.c32
├── initrd.img ###内核文件
├── mboot.c32
├── memdisk
├── menu.c32
├── pxelinux.0 ###引导文件
├── pxelinux.cfg
│ └── default ###启动菜单
├── splash.png
├── vesamenu.c32
└── vmlinuz ###内核文件
关闭firewalld,selinux
systemctl disable firewalld
systemctl stop firewalld
vi /etc/selinux/config
reboot
sestatus
DHCP
yum install dhcp
vi /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
# see /usr/share/doc/dhcp*/dhcpd.conf.example
# see dhcpd.conf(5) man page
#
subnet 192.168.60.0 netmask 255.255.255.0 {
range 192.168.60.100 192.168.60.254;
option domain-name-servers 114.114.114.114;
option routers 192.168.60.1;
default-lease-time 3600 ;
max-lease-time 7200;
next-server 192.168.60.5;
filename "pxelinux.0"; ####大小写敏感
}
systemctl start dhcpd
systemctl enable dhcpd
httpd、tftp、xinetd、syslinux
yum install httpd tftp-server xinetd
systemctl start httpd tftp-server xinetd
systemctl enable httpd tftp-server xinetd
vim /etc/xinetd.d/tftp
disable = no
引导文件,启动菜单
mkdir /var/www/html/centos7
mount /dev/sr0 /var/www/html/centos7
yum install syslinux.x86_64 -y
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cp /var/www/html/centOS7/isolinux/{vmlinuz,initrd.img} /var/lib/tftpboot/
cp /var/www/html/centOS7/isolinux/{vesamenu.c32,boot.msg,splash.png} /var/lib/tftpboot/
mkdir pxelinux.cfg
cp /var/www/html/centOS7/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
cp centos.cfg /var/www/html/ksdir/
vim /var/lib/tftpboot/pxelinux.cfg/default
label linux
menu label ^Install CentOS 7
kernel vmlinuz
append initrd=initrd.img ks=http://192.168.60.5/ksdir/centos.cfg