##############################pxe#######################################
1,安装
yum install dhcp httpd tftp-server lftp xinetd syslinux-4.05-12.el7 -y
system-config-kickstart ##自动应答脚本制作工具
syslinux ##获得pxelinux.0文件安装包
dhcp ##分配ip给客户机的服务
tftp-server ##提供tftp协议的服务
httpd ##安装源共享服务
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
2,配置dhcpd
vim /etc/dhcp/dhcpd.conf
7 option domain-name "westos.com"; ##域名
8 option domain-name-servers 172.25.254.90; ##dns
9
10 default-lease-time 600; ##默认租约期
11 max-lease-time 7200; ##最长租约期
30 subnet 172.25.254.0 netmask 255.255.255.0 { ##网段,子网掩码
31 range 172.25.254.50 172.25.254.60; ##地址范围
32 option routers 172.25.254.254; ##网关
33 next-server 172.25.254.135; ##tftp主机地址
34 filename "pxelinux.0"; ##pxe启动程序
35 }
systemctl restart dhcpd
systemctl start httpd
systemctl enable httpd
vim /etc/xinetd.d/tftp
如图二 ##开启xinetd
systemctl restart xinetd
3,
在真机上
cd /var/www/html/rhel7.2/isolinux
scp -r * root@172.25.254.135:/var/lib/tftpboot
在135主机上
cp -p /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cd /var/lib/tftpboot/
mkdir pxelinux.cfg
cp isolinux.cfg pxelinux.cfg/default
vim pxelinux.cfg/default
yum install system-config-kickstart.noarch -y
system-config-kickstart
vim /var/www/html/ks.cfg
如图四
vim /var/lib/tftpboot/pxelinux.cfg/default
label linux
menu label HAHAHAHHA ##小标题
menu default ##默认标题设定
kernel vmlinuz
append initrd=initrd.imgrepo=http://172.25.254.90/rhel7.2 ks=172.25.254.90/ks.cfg ##安装源和ks
如图三
测试:
如图一