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

[root@nginx xc]# 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
[root@nginx xc]# yum install syslinux.x86_64 

安装tftp服务 用来共享pxelinux.0数据文件的网络服务
[root@nginx xc]# 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)

[root@nginx xc]# yum install tftp-server.x86_64 -y
[root@nginx xc]# systemctl enable --now tftp  --启动tftp
[root@nginx xc]# 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存放数据的目录

[root@nginx xc]# cp /rhel7/isolinux/* /var/lib/tftpboot/  
[root@nginx xc]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/   -拷贝资源到该数据目录
[root@nginx xc]# cd /var/lib/tftpboot/
[root@nginx tftpboot]# mkdir pxelinux.cfg
[root@nginx tftpboot]# cp isolinux.cfg pxelinux.cfg/default -拷贝安装显示界面
[root@nginx ~]# vim /etc/dhcp/dhcpd.conf 
添加两行
 next-server 172.25.254.100;
 filename "pxelinux.0";
[root@nginx ~]# systemctl restart dhcpd

设置资源地址以及默认选择下载第一个

[root@nginx ~]# 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脚本的服务器

测试 找到bios模式

 首先选择网卡模式安装

保存


 

然后进入安装界面回车就行,安装完了记得再次进入bios模式修改启动方式为硬盘安装  

 

再次启动到达此界面就欧克了

 

  • 20
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

灰二走

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值