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

3-unit pxe_linux

3-unit pxe_学习笔记_02

31 next-server 172.25.254.62;       ##tftp主机地址 

32 filc/xinetd.d/tftp        ##pxe启动程序

3-unit pxe_学习笔记_03

systemctl restart  dhcpd


vim /var/lib/tftpboot

14 disable = no

systemctl restart xinetd

 

3-unit pxe_学习笔记_04


##复制安装所需文件

3-unit pxe_学习笔记_05

3-unit pxe_学习笔记_06

##配置自动安装文件ks.cfg并保存到/var/www/html里

3-unit pxe_linux_07

3-unit pxe_linux_08


3-unit pxe_学习笔记_09

3-unit pxe_学习笔记_10


 

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

 3-unit pxe_学习笔记_11

3-unit pxe_linux_12


测试:

设置启动模式为网卡启动

##DHCP获取IP

3-unit pxe_学习笔记_13

##等待10s,开始自动安装

3-unit pxe_linux_14