1.安装和启动服务
yum install dhcp httpd tftp-server lftp xinetd -y
systemctl restart dhcpd
systemctl start httpd
systemctl start httpd
2.修改配置文件
##dhcp配置文件修改
vim /etc/dhcp/dhcpd.conf
31 next-server 172.25.254.62; ##tftp主机地址
32 filc/xinetd.d/tftp ##pxe启动程序
systemctl restart dhcpd
vim /var/lib/tftpboot
14 disable = no
systemctl restart xinetd
##复制安装所需文件
##配置自动安装文件ks.cfg并保存到/var/www/html里
vim /var/lib/tftpboot/pxelinux.cfg/default
2 timeout 100 ##等待时间为10s
64 append initrd=initrd.img repo=http://172.25.254.62/rhel7.2 ks=http://172.25.254.74/ks.cfg ##设置安装源和ks
测试:
设置启动模式为网卡启动
##DHCP获取IP
##等待10s,开始自动安装
本文转自cuijb0221 51CTO博客,原文链接:http://blog.51cto.com/cuijb/1933976