linux pxe企业自动部署环境

pxe:
在这里插入图片描述
未安装的主机通过网卡像dhcpd索要ip地址,dhcpd服务的主机发送包(包含ip地址,dns等,以及程序,告诉主机下一步动作)给未安装的主机

File: /root/pxe网络安装服务器的部署 Page 1 of 3
1.部署vsftpd:
共享ks文件
共享安装源
在这里插入图片描述
2.搭建dhcpd服务器
分配ip等信息到客户端
在这里插入图片描述

3.部署pxe环境、

查看 /usr/share/doc/syslinux/pxelinux.txt 文件确定操作步骤
 dnf  install  syslinux-nonlinux-6.04-1.el8.noarch -y      ##获得pxelinux.0文件
在这里插入图片描述
dnf  install  tftp-server.x86_64              #安装pxelinux.0共享服务器
在这里插入图片描述

systemctl  start  tftp
cp  /usr/share/syslinux/pxelinux.0  /var/lib/tftpboot/         ##共享pxelinux.0
cp  /var/ftp/rhel8/isolinux/*  /var/lib/tftpboot/           ##共享安装环境所要读取的文件
在这里插入图片描述
mkdir  /var/lib/tftpboot/pxelinux.cfg/
cp  /var/lib/tftpboot/isolinux.cfg var/lib/tftpboot/pxelinux.cfg/default      ##生成pxelinux.0默认读取文件
在这里插入图片描述
4.dhcpd服务配置分发pxelinux.0
30 subnet 192.168.0.0 netmask 255.255.255.0 {
31 range 192.168.0.44 192.168.0.50;
32 option routers 192.168.0.1;
33 next-server 192.168.0.120;              ##tftp服务器地址
34 filename “pxelinux.0”;                ##需要读取的文件名称
35 }
在这里插入图片描述
开启测试的虚拟机:##用网络开启
在这里插入图片描述
在这里插入图片描述
可以看出已经从dhcpd服务器上分配了ip

5.设定 pxelinux.cfg/default****内容
##启东时应选用stat模式的光盘,内存2G
default vesamenu.c32
timeout 50              ##安装界面等待时间
display boot.msg
# Clear the screen when exiting the menu, instead of leaving the menu displayed.
# For vesamenu, this means the graphical background is still displayed without
# the menu itself for as long as the screen remains in graphics mode.
menu clear
menu background splash.png       ##安装界面壁纸
menu title WESTOS INSTALL OS pxe from OLDLEE        ##安装标题
menu vshift 8
menu rows 18
menu margin 8
#menu hidden
menu helpmsgrow 15
menu tabmsgrow 13
# Border Area
menu color border * #00000000 #00000000 none

.......

label linux
menu label ^Install Red Hat Enterprise Linux 8.0.0
menu default                ##设定为默认的选择标题
kernel vmlinuz append initrd=initrd.img repo=ftp://192.168.0.11/rhel8 ks=ftp://192.168.0.11/ksfile/ks.cfg               ##指定安装源和ks文件
label check
menu label Test this ^media & install Red Hat Enterprise Linux 8.0.0
# menu default           #注释掉了,所以默认选择的标题不为此标题
kernel vmlinuz
append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-8-0-0-BaseOS-x86_64
rd.live.check quiet
........以下省略

发布了36 篇原创文章 · 获赞 13 · 访问量 1461

猜你喜欢

转载自blog.csdn.net/thermal_life/article/details/104495557