linux 7 pxe,CentOS 7.6 PXE方式安装和配置
以下配置文檔親手配置有效,其中為了省事關閉了selinux和防火墻。
yum -y install dhcp tftp-server syslinux httpd xinetd
systemctl disable firewalld
vi /etc/selinux/config
disabled selinux
systemctl enable dhcpd
systemctl enable httpd
systemctl enable tftp
vi /etc/dhcp/dhcpd.conf
allow booting;
allow bootp;
ddns-update-style interim;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
option subnet-mask ? ? ?255.255.255.0;
option domain-name-servers ?192.168.1.10;
range dynamic-bootp 192.168.1.100 192.168.1.200;
default-lease-time ? ? ?21600;
max-lease-time ? ? ? ? ?43200;
next-server ? ? ? ? ? ? 192.168.1.10;
filename ? ? ? ? ? ? ? ?"/pxelinux.0";
}
option option-128 code 128 = string;
option option-129 code 129 = text;
systemctl start dhcpd
//下午繼續
systemctl disable firewalld
vi /etc/xinetd.d/tftp and change disable to 'no'
disable = no
systemctl restart xinetd
mount /dev/cdrom /media/cdrom
cd /var/lib/tftpboot
cp /usr/share/syslinux/pxelinux.0 .
cp /media/cdrom/images/pxeboot/{vmlinuz,initrd.img} .
cp /media/cdrom/isolinux/{vesamenu.c32,boot.msg} .
mkdir pxelinux.cfg
cp /media/cdrom/isolinux/isolinux.cfg pxelinux.cfg/default
vi pxelinux.cfg/default
1 default linux
61 label linux
62 menu label ^Install CentOS Linux 7.0
63 kernel vmlinuz
64 append initrd=initrd.img inst.stage2=http://192.168.1.10/inst/ ks=http://192.168.10.10/inst/ks.cfg
ks.cfg
//只要指定url就可以了
url --url http://192.168.1.10/inst/
**************************
直接把ks內容寫到default無效,找不到安裝源,后來只好把他寫入到ks.cfg ,好神奇,明明是放到同樣的
http://192.168.1.10/inst 目錄下,但是卻可以找到了。
總結
以上是生活随笔為你收集整理的linux 7 pxe,CentOS 7.6 PXE方式安装和配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 7z001 002合并 linux,解压
- 下一篇: 字符串操作 c语言,C语言字符串操作(