1、实验环境
一台红帽7.9的机子,配置网络可用,安装httpd tftp等所需软件,确保火墙selinux都关闭
2、配置PXE服务端
1、开启RHEL7的机子,确保有图形界面
# 下载图形界面
yum group install "Server with GUI"
# 切换到图形界面
init 5
2、安装和部署 kickstart 无人看守安装
# 安装kickstart
yum install system-config-kickstart -y
# 启动图形制作工具
system-config-kickstart
3、安装httpd将文件共享出去
#下载httpd
yum install httpd -y
#将文件复制到默认发布目录
cp /root/ks.cfg /var/www/html/
ln -s /rhel7/ /var/www/html/
4、 安装dhcp服务器
# 安装dhcp服务器
yum install dhcp -y
# 生成配置文件
\cp -f /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf
# 编辑配置文件
vim /etc/dhcp/dhcpd.conf
#先删除37行之后的内容
5、安装配置syslinux和tftp
# 安装所需软件
yum install syslinux.x86_64 -y
yum install tftp-server.x86_64 -y
# 启动tftp来共享pxelinux.0数据文件
systemctl enable --now tftp
# 将所需资源导入/var/lib/tftpboot/
cp /rhel7/isolinux/* /var/lib/tftpboot/
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
# 查看/var/lib/tftpboot/
cd /var/lib/tftpboot/
[root@node1 tftpboot]# ls
boot.cat grub.conf isolinux.bin memtest splash.png upgrade.img vmlinuz
boot.msg initrd.img isolinux.cfg pxelinux.0 TRANS.TBL vesamenu.c32
# 进入dhcp配置文件添加
vim /etc/dhcp/dhcpd.cof
3、客户端测试