博客
关于我
shell_一键部署PXE
阅读量:102 次
发布时间:2019-02-26

本文共 1294 字,大约阅读时间需要 4 分钟。

一键部署PXe环境

安装并启用TFTP服务

在系统上安装并启动TFTP服务:

yum -y install tftp-server xinetd  sed -i '10s/yes/no/' /etc/xinetd.d/tftp  sed -i '14s/yes/no/' /etc/xinetd.d/tftp  systemctl start tftp  systemctl enable tftp  systemctl start xinetd  systemctl enable xinetd

安装并启用DHCP服务

安装并配置DHCP服务:

yum -y install dhcp expect  cp/usr/bin/expect  
spawnp cp usr share doc dhcp-4.2.5 dhcpd.conf.example etc dhcp dhcpd.conf expect "是否覆盖" { send "y\n" }
cat > /etc/dhcp/dhcpd.conf
ddns-update-style none; next-server 192.168.133.13; filename "pxelinux.0"; subnet 192.168.133.0 netmask 255.255.255.0 { range 192.168.133.100 192.168.133.200; option routers 192.168.133.13; }
systemctl start dhcpd systemctl enable dhcpd

准备Linux内核和初始化镜像文件

将镜像文件复制到TFTP根目录:

cd /mnt/images/pxeboot  cp vmlinuz /var/lib/tftpboot/  cp initrd.img /var/lib/tftpboot/

安装并配置PXE引导程序

安装并配置PXe引导程序:

yum -y install syslinux  cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

安装FTP服务并准备CentOS 7安装源

安装并配置FTP服务:

yum -y install vsftpd  mkdir /var/ftp/centos7  cp -rf /mnt/* /var/ftp/centos7/  systemctl start vsftp  systemctl enable vsftpd

配置启动菜单文件

创建PXe配置文件:

mkdir /var/lib/tftpboot/pxelinux.cfg  cat > /var/lib/tftpboot/pxelinux.cfg/default 

通过以上步骤,您可以快速配置并部署PXe环境。

转载地址:http://hseu.baihongyu.com/

你可能感兴趣的文章
PIGS POJ 1149 网络流
查看>>
PIL Image对图像进行点乘,加上常数(等像素操作)
查看>>
PIL.Image、cv2的img、bytes相互转换
查看>>
PIL.Image进行图像融合显示(Image.blend)
查看>>
Pillow lacks the JPEG 2000 plugin
查看>>
ping 全网段CMD命令
查看>>
ping 命令的七种用法,看完瞬间成大神
查看>>
Pinia:$patch的使用场景
查看>>
Pinia:$subscribe()的使用场景
查看>>
Pinpoint对Kubernetes关键业务模块进行全链路监控
查看>>
Pinterest 大规模缓存集群的架构剖析
查看>>
pintos project (2) Project 1 Thread -Mission 1 Code
查看>>
PinYin4j库的使用
查看>>
PIP
查看>>
pip install goose-extractor // SyntaxError: Missing parentheses in call to 'print'
查看>>
pip install mysqlclient报错
查看>>
pip install 出现报asciii码错误的解决
查看>>
pip throws TypeError: parse() got an unexpected keyword argument ‘transport_encoding‘ 在尝试安装新软件包时
查看>>
pip 下载慢
查看>>
pip 升级报错AttributeError: ‘NoneType’ object has no attribute ‘bytes’
查看>>