centos7.3 dsnmasq的pxe+kickstart

centos7.3

本机网卡地址192.168.10.1

#yum -y install vsftpd syslinux tftp-server dnsmasq

#cp -r /usr/share/syslinux/* /var/lib/tftpboot/

#cp /etc/dnsmasq.conf /etc/dnsmasq.bak

#cat << EOF > /etc/dnsmasq.conf1

interface=eth0 #interface �C 服务器需要监听并提供服务的网络接口。

bind-interfaces #bind-interfaces �C 取消注释来绑定到该网络接口

domain=every8.cn #domain �C 替换为你的域名。

dhcp-range= eth0,192.168.10.50,192.168.10.100,255.255.255.0,1h #dhcp-range �C 替换为你的网络掩码定义的网段。

dhcp-boot=pxelinux.0,pxeserver,192.168.10.1#dhcp-boot �C 替换该IP地址为你的网络接口IP地址。

dhcp-option=3,192.168.10.1 #dhcp-option=3,192.168.1.1 �C 替换该IP地址为你的网段的网关。

dhcp-option=6,92.168.10.1,8.8.8.8 #dhcp-option=6,92.168.1.1 �C 替换该IP地址为你的DNS服务器IP――可以定义多个IP地址。

server=8.8.4.4 #server=8.8.4.4 �C 这里放置DNS转发服务器IP地址。

dhcp-option=28,192.168.10.255 #dhcp-option=28,10.0.0.255 �C 替换该IP地址为网络广播地址――可选项。

dhcp-option=42,0.0.0.0 #dhcp-option=42,0.0.0.0 �C 这里放置网络时钟服务器――可选项(0.0.0.0地址表示参考自身)。

pxe-prompt="Press F8 for menu.",60

pxe-service=x86PC,"Install CentOS 7 from network server 192.168.1.20",pxelinux

enable-tftp #enable-tftp �C 启用内建TFTP服务器。

tftp-root=/var/lib/tftpboot #tftp-root �C 使用/var/lib/tftpboot――所有网络启动文件所在位置。

conf-dir=/etc/dnsmasq.d

EOF

#mkdir /var/lib/tftpboot/pxelinux.cfg

#cat << EOF > /var/lib/tftpboot/pxelinux.cfg/default

default menu.c32

prompt 0

timeout 300

ONTIMEOUT local

menu title ########## PXE Boot Menu ##########

label 1

menu label ^1)InstallCentOS7.3 x64 withLocalRepo

kernel cen73/vmlinuz

append initrd=cen73/initrd.img method=ftp://192.168.10.1/cen73

label 2

menu label ^2)InstallCentOS7.2 x64 withLocalRepo

kernel cen72/vmlinuz

append initrd=cen72/initrd.img inst.ks=ftp://192.168.10.1/cen72ks/ks01.cfg inst.repo=ftp://192.168.10.1/cen72 #method=ftp://192.168.10.1/cen72

EOF

echo "/iso/CentOS-7-x86_64-DVD-1611.iso /var/ftp/cen73 iso9660 loop 0 0" >> /etc/fstab

echo "/iso/CentOS-7-x86_64-DVD-1511.iso /var/ftp/cen72 iso9660 loop 0 0" >> /etc/fstab

# mount -a

# cp /var/ftp/cen72/images/pxeboot/initrd.img /var/lib/tftpboot/cen72/

# cp /var/ftp/cen72/images/pxeboot/vmlinuz /var/lib/tftpboot/cen72/

# cp /var/ftp/cen73/images/pxeboot/initrd.img /var/lib/tftpboot/cen73/

# cp /var/ftp/cen73/images/pxeboot/vmlinuz /var/lib/tftpboot/cen73/

# systemctl stop firewalld.service

#service tftp start

# systemctl restart vsftpd

# systemctl restart dnsmasq



测试7.2可以安装,7.3 有问题。


kickstart文件配置:

yum -y install system-config-kickstart.noarch

注:

system-config-kickstart创建ks文件,软件包选择被禁止时,将yum源配置文件的[]名称该文[development]

如果kickstart文件分区格式为xfs,不能正常安装,将分区格式改为ext4格式

如果使用系统ks模板,clearpart --all --initlabel 此条命令必须添加,添加在分区前面,不然系统会让用户手动选择是否清除所有数据,这就需要人为干预了,从而导致自动化过程失败;

相关文章

linux下开机自启: 在/etc/init.d目录下新建文件elasticsear...
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以...
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用...
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一...
设置时区(CentOS 7) 先执行命令timedatectl status|grep &...
vim&#160;/etc/sysconfig/network-scripts/ifcfg-eth0 B...