所需軟件:DHCP、TFTP、syslinux、vsftpdlinux
PXE:是預安裝環境的縮寫。是intel公司推出的一款經過網絡來引導操做系統的協議。普遍應用於網吧無盤系統。vim
setenforce 0服務器
getenforce網絡
rpm -q dhcpapp
yum install dhcp -yide
cat /etc/dhcp/dhcpd.conf測試
cat /usr/share/doc/dhcp*/dhcpd.confspa
.example操作系統
複製如下內容到主配置文件內3d
vim /etc/dhcp/dhcpd.conf
修改後————>
systemctl restart dhcpd
systemctl enable dhcpd
rpm -q tftp-server
yum install -y tftp-server
vim /etc/xinetd.d/tftp
找到此行:
disable = yes
將yes(禁用)改成(no)啓用
systemctl restart tftp
systemctl enable tftp
systemctl status tftp
netstat -atulp | grep tftp
netstat -atunlp | grep :69
rpm -q syslinux mlocate
yum install -y syslinux mlocate;updatedb
locate pxelinux.0 (查找文件)
共享文件到 /var/lib/tftpboot目錄
cd /var/lib/tftpboot
cp -v /usr/share/syslinux/pxelinux.0 ./
df -hT
cp -v /dvd/isolinux/* ./
mkdir -pv pxelinux.cfg
cp -v isolinux.cfg pxelinux.cfg/default
rpm -q vsftpd
yum install -y vsftpd
systemctl restart vsftpd
systemctl enable vsftpd
sysytemctl status vsftpd
mkdir -v /var/ftp/dvd
mount /dev/sr0 /var/ftp/dvd
vim /var/lib/tftpboot/pxelinux.cfg/default
修改64行爲:
appen initrd=initrd.img
method=ftp://192.168.11.11/dvd
cd
chmod -v 644 anaconda-ks.cfg
mkdir -v /var/ftp/ks
cp -v anaconda-ks.cfg /var/ftp/ks/ks.cfg
vim /var/lib/tftpboot/pxelinux.cfg/default
在64行最後加上:
ks=ftp://192.168.11.11/ks/ks.cfg
用#號註釋menu default
在安裝CENTOS下添加menu default設爲默認選項