pxe服務(wù)器搭建
前提
bios支持
網(wǎng)卡支持
搭建
dhcp-server
安裝
yum install -y dhcp
配置
vim /etc/dhcp/dhcpd.conf #可以看到里面提供了一個(gè)模板
cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
vim /etc/dhcp/dhcpd.conf
subnet 88.96.66.0 netmask 255.255.255.0 {
range 88.96.66.40 88.96.66.100;
option broadcast-address 88.96.66.255;
next-server 88.96.66.40;
default-lease-time 600;
filename "pxelinux.0";
}
service dhcp configtest #檢查是否有語法錯(cuò)誤
systemctl start dhcpd
netstat -tulnp |grep :67 #dhcp服務(wù)默認(rèn)監(jiān)聽67端口
#redhat7默認(rèn)開啟防火墻,防火墻會(huì)拒絕所有數(shù)據(jù)包
systemctl disable firewalld.service #下次開機(jī)關(guān)閉
systemctl stop firewalld.service #當(dāng)前關(guān)閉
vim /etc/selinux/config #下次開機(jī)關(guān)閉
SELINUX=disabled
setenforce 0 #當(dāng)前關(guān)閉
getenforce
systemctl enable dhcpd #開機(jī)自啟動(dòng)
tftp-server
安裝
yum install -y tftp-server
配置
vim /etc/xinetd.d/tftp
service tftp{
protocol - udp
user = root
server = /usr/sbin/in.tftp
server_args = -s /var/lib/tftpboot #tftp服務(wù)的主目錄,類似于ftp服務(wù)器的/var/ftp
disable = no #是否啟動(dòng)該服務(wù),默認(rèn)是不啟動(dòng)
}
systemctl restart xinetd
default linux #默認(rèn)從linux標(biāo)簽引導(dǎo)系統(tǒng)
prompt 1 #是否等待用戶選擇
label linux #定義名為linux的標(biāo)簽
kernel vmlinuz
append initrd=initrd.img
給待安裝的服務(wù)器發(fā)送os內(nèi)核和初始化文件
浙公網(wǎng)安備 33010602011771號