飞不高 发表于 2024-8-7 18:17:52

搭建PXE网络安装环境实现服务器主动部署

# yum search pxelinux
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
============================== Matched: pxelinux ===============================
syslinux.x86_64 : Simple kernel loader which boots from a FAT filesystem
syslinux-extlinux.x86_64 : The EXTLINUX bootloader, for booting the local
                         : system.
syslinux-tftpboot.noarch : SYSLINUX modules in /var/lib/tftpboot, available for
                         : network booting
# yum install syslinux.x86_64 

安装tftp服务 用来共享pxelinux.0数据文件的网络服务
# yum search tftp
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-
              : manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
============================== N/S matched: tftp ===============================
syslinux-tftpboot.noarch : SYSLINUX modules in /var/lib/tftpboot, available for
                         : network booting
tftp.x86_64 : The client for the Trivial File Transfer Protocol (TFTP)
tftp-server.x86_64 : The server for the Trivial File Transfer Protocol (TFTP)
# yum install tftp-server.x86_64 -y
# systemctl enable --now tftp  --启动tftp
# rpm -ql tftp-server 
/etc/xinetd.d/tftp
/usr/lib/systemd/system/tftp.service
/usr/lib/systemd/system/tftp.socket
/usr/sbin/in.tftpd
/usr/share/doc/tftp-server-5.2
/usr/share/doc/tftp-server-5.2/CHANGES
/usr/share/doc/tftp-server-5.2/README
/usr/share/doc/tftp-server-5.2/README.security
/usr/share/man/man8/in.tftpd.8.gz
/usr/share/man/man8/tftpd.8.gz
/var/lib/tftpboot                #tftp存放数据的目录
# cp /rhel7/isolinux/* /var/lib/tftpboot/  
# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/   -拷贝资源到该数据目录
# cd /var/lib/tftpboot/
# mkdir pxelinux.cfg
# cp isolinux.cfg pxelinux.cfg/default -拷贝安装显示界面
# vim /etc/dhcp/dhcpd.conf 
添加两行
 next-server 172.25.254.100;
 filename "pxelinux.0";
# systemctl restart dhcpd
https://i-blog.csdnimg.cn/direct/c797208fa3b543d1a42bc5d163e67a98.png

设置资源地点以及默认选择下载第一个
# vim /var/lib/tftpboot/pxelinux.cfg/default 
label linux
  menu label ^Install Red Hat Enterprise Linux xcxcxcxc
  menu default      ----设置开机默认选择第一条安装
  kernel vmlinuz
  append initrd=initrd.img repo=http://172.25.254.100/rhel7 ks=http://172.25.254.100/ks.cfg  quiet
#以上IP写启动了http和编写kickstart脚本的服务器
https://i-blog.csdnimg.cn/direct/5f229f51596248b7bb57efda18d6756b.png
测试 找到bios模式
https://i-blog.csdnimg.cn/direct/bb03a46ae2234387bef4ca6151bebab1.png
 起首选择网卡模式安装
https://i-blog.csdnimg.cn/direct/98b2734c746a4bd79f12ce0c064e57c1.png

生存
https://i-blog.csdnimg.cn/direct/4d9dbd0fac544777aa67f6c49f2e6562.png
 
然后进入安装界面回车就行,安装完了记得再次进入bios模式修改启动方式为硬盘安装  
https://i-blog.csdnimg.cn/direct/f4f7c71450124fe7885c66db95a79b0e.png 
再次启动到达此界面就欧克了
https://i-blog.csdnimg.cn/direct/3e54d1c28a3e43c1b92e5c799d1e026f.png 

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 搭建PXE网络安装环境实现服务器主动部署