如果出现无法载图的情况,请检查与github的连通性
环境 VMwareWorkstation17pro(关闭DHCP功能)
pxe服务器: RHEL8 4vCPU 4G 网卡仅主机网络 IP:192.168.11.10 50G磁盘默认分区
安装机: RHEL8 4vCPU 4G 网卡仅主机网络 无磁盘
准备PXE服务器 PXE服务器的同时扮演DHCP服务器、TFTP服务器、HTTP服务器的角色
环境初始化 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 nmcli con add con-name ens224 ipv4.addresses 192.168.11.10/24 ipv4.method manual type ethernet connection.autoconnect yes ifname ens224 nmcli con up ens224 rm -rf /etc/yum.repos.d/*.repomkdir /isomount /dev/sr0 /iso echo "[1] name=1 baseurl=file:///iso/BaseOS gpgcheck=0 [2] name=2 baseurl=file:///iso/AppStream gpgcheck=0 " > /etc/yum.repos.d/iso.repoyum clean all && yum makecache yum -y install dhcp-server cp /usr/share/doc/dhcpserver/dhcpd.conf.example /etc/dhcp/dhcpd.confecho 'subnet 192.168.11.0 netmask 255.255.255.0 { range 192.168.11.100 192.168.11.200; next-server 192.168.11.10; filename "pxelinux.0"; } ' > /etc/dhcp/dhcpd.conf systemctl restart dhcpd systemctl enable dhcpd --now systemctl disable firewalld.service --now setenforce 0
搭建tftp服务器 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 yum -y install tftp-server systemctl enable tftp --now yum -y install syslinux cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ cp /usr/share/syslinux/ldlinux.c32 /var/lib/tftpboot/mkdir /var/lib/tftpboot/pxelinux.cfgcp -rf /usr/share/syslinux/* /var/lib/tftpboot/echo "default menu.c32 timeout 30000 label 111 kernel vmlinuz append initrd=initrd.img method=http://192.168.11.10/iso " > /var/lib/tftpboot/pxelinux.cfg/default
http服务器搭建 1 2 3 4 5 6 yum -y install httpd mkdir /var/www/html/isosystemctl restart httpd systemctl enable httpd --now cp /iso/isolinux/vmlinuz /iso/isolinux/initrd.img /var/lib/tftpboot/mount /dev/sr0 /var/www/html/iso
测试 不添加磁盘,让新机器使用PXE网络安装 通过DHCP从PXE服务器获取IP 通过TFTP服务器获取启动文件pxelinux.cfg/default 通过HTTP服务器获取RHEL8的镜像文件iso