PXE(preboot execute environment,预启动执行环境)是由Intel公司开发的最新技术,工作于Client/Server的网络模式,支持工作站通过网络从远端服务器下载映像,并由此支持通过网络启动操作系统,在启动过程中,终端要求服务器分配IP地址,再用TFTP(trivial file transfer protocol)或MTFTP(multicast trivial file transfer protocol)协议下载一个启动软件包到本机内存中执行,由这个启动软件包完成终端(客户端)基本软件设置,从而引导预先安装在服务器中的终端操作系统。PXE可以引导多种操作系统,如:Windows95/98/2000/windows2003/windows2008/winXP/win7/win8,linux系列系统等。



linux-pxe



实现自动安装 (网卡启动)


(服务端)

[[email protected] ~]# yum install httpd dhcp tftp-server syslinux -y  安装服务

[[email protected] ~]# rpm -ql tftp-server    查看tftp-server服务的配置文件

linux-pxe



(12主机)


linux-pxe

[[email protected] rhel7.0]# cp  -rp isolinux /lh  将isolinux复制到/lh


linux-pxe


[[email protected] ~]# cp -rp /lh /var/ftp  把/lh加到vsftpd的默认发布目录里


(服务器)

如下将12主机的isolinux 下载到服务器上


linux-pxe


vim /etc/xinetd.d/tftp 编辑文件

disable    =no  yes改为no

netstat -antlupe | grep 69  查看69端口是否开启

linux-pxe


linux-pxe



[[email protected] tftpboot]# mkdir pxelinux.cfg  建立目录

[[email protected] tftpboot]# cp isolinux.cfg pxelinux.cfg/default  复制

[[email protected] tftpboot]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/ 复制


linux-pxe


[[email protected] tftpboot]# systemctl restart xinetd.service  重启服务
[[email protected] tftpboot]# systemctl start httpd  开启http服务
[[email protected] tftpboot]# systemctl stop firewalld  关闭火墙


[[email protected] tftpboot]# cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf 


linux-pxe


[[email protected] tftpboot]# vim /etc/dhcp/dhcpd.conf  编辑配置文件


linux-pxe




[[email protected] tftpboot]# systemctl restart dhcpd

测试:测试:拔掉网线 关掉真机的dhcp

调为网卡启动


linux-pxe


linux-pxe


[[email protected] tftpboot]# vim pxelinux.cfg/default  编辑文件 更改图片,更改标题


linux-pxe


效果如下:


linux-pxe


实现自动安装

[[email protected] ~]# yum install system-config-kickstart -y  安装服务

[[email protected] ~]# system-config-kickstart  调用图形

在图形界面进行勾选,最后保存(之前博客有详细过程)


[[email protected] ~]# cd /var/www/html/
[[email protected] html]# ls
ks.cfg
[[email protected] html]# vim ks.cfg  编辑此文件

linux-pxe



linux-pxe



[[email protected] html]# ksvalidator ks.cfg  检测语法


[[email protected] tftpboot]# vim pxelinux.cfg/default  编辑文件

linux-pxe


[[email protected] tftpboot]# systemctl restart httpd   重启服务
[[email protected] tftpboot]# systemctl restart dhcpd 重启服务


测试:

linux-pxe

linux-pxe

转载于:https://blog.51cto.com/13362895/2049714

相关文章: