1.通过下面查看tftp目录的位置
cat /etc/xinetd.d/tftp
service tftp
{
disable = no
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/lib/tftpboot
per_source = 11
cps = 100 2
flags = IPv4
}
find / -name pxelinux.0
cp ../pxelinux.0 /var/lib/tftpboot/
cp /mnt/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/
cp /mnt/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
cp /mnt/isolinux/*.msg /var/lib/tftpboot/
default文件内容:
cat /var/lib/tftpboot/pxelinux.cfg/default
default linux
prompt 1
timeout 1
label linux
kernel vmlinuz
append initrd=initrd.img ks=ftp://10.12.190.152/ks.cfg
2.通过/tftpboot/pxelinux.cfg/default指定ks.cfg文件的位置
system-config-kickstart
配置自动执行文件
ks.cfg文件内容:
grep -v '#' /root/Desktop/ks.cfg
firewall --disabled
install
url --url="ftp://ftp:ftp@10.12.190.152/pxe"
rootpw --iscrypted $1$y7D.cN0v$2hOWYmzpdAPixkI7Py5Bt/
auth --useshadow --passalgo=sha512
text
firstboot --disable
keyboard us
lang en_US
selinux --disabled
logging --level=info
reboot
timezone Asia/Shanghai
network --bootproto=dhcp --device=eth0 --onboot=on
bootloader --location=mbr
zerombr
clearpart --all --initlabel
part /boot --fstype="ext4" --size=200
part swap --fstype="swap" --size=2048
part / --fstype="ext4" --size=10240
%packages
@base
@chinese-support
@network-tools
@system-management
%end
3.配置vsftpd,设置安装文件存放地方
此次测试将ks.cfg文件存放在vsftp根目录下,而安装程序指定在ftp的pxe目录中
4.配置dhcp,注意标点符号,格式匹配
cat /etc/dhcp/dhcpd.conf
ddns-update-style interim;
allow booting;
allow bootp;
next-server 10.12.190.152;
filename "pxelinux.0";
subnet 10.12.190.0 netmask 255.255.255.0 {
option routers 10.12.190.254;
option subnet-mask 255.255.255.0;
option domain-name-servers 10.12.190.152;
option time-offset -18000;
range dynamic-bootp 10.12.190.220 10.12.190.240;
default-lease-time 21600;
max-lease-time 43200;
}
阅读(623) | 评论(0) | 转发(0) |