1.配Server IP为:192.168.0.20 ,安装镜像挂载到/mnt下。
2. 安装tftp 服务 、dhcp服务和ftp服务.
安装前先查看这些服务是否已安装
# rpm -qa |grep tftp
# rpm -qa |grep dhcp
# rpm -qa |grep vsftpd
未安装的进行安装
#cd /mnt/RedHat/RPMS/ 在RHEL5 中是cd /mnt/Server
#rpm –ivh dhcp-*
#rpm –ivh tftp-*
#rpm –ivh vsftpd*
3.配置启动DHCP服务
#cp cp /usr/share/doc/dhcp-3.0.1 /dhcpd.conf.sample /etc/dhcpd.conf
#vi /etc/dhcpd.conf
添加filename "pxelinux.0"; //指定bootloader文件
next-server 192.168.0.20; //指定索取pxelinux.0的tftp服务器IP
添加的这两行可在大括号外面,也可在里面,next-server选项可不写,但建议最好写上
配置举例:
ddns-update-style interim;
ignore client-updates;
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option time-offset -18000; # Eastern Standard Time
range dynamic-bootp 192.168.0.128 192.168.0.254;
default-lease-time 21600;
max-lease-time 43200;
filename "pxelinux.0";
next-server 192.168.0.20;
}
#cd /tftpboot
#cp /mnt/isolinux/* ./ (实际需要的是vmlinuz,initrd.img , *.msg 这几个文件,但为了操作方便,我直接把isolinux目录下的文件全cp过来)
#mkdir pxelinux.cfg
#mv isolinux.cfg pxelinux.cfg/default (default配置文件的作用是告诉主机从哪里去加载操作系统内核)
#cp /usr/lib/syslinux/pxelinux.0 ./ (将启动加载文件拷到/tftpboot下)
# vi /etc/xinetd.d/tftp
……………………………………………………………………………………
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
per_source = 11
cps = 100 2
flags = IPv4
}
………………………………………………………………………………………… |
#chkconfig tftp on
#service xinetd restart
修改第3行,第12行.
2 prompt 1
3 timeout 10 //时间调小点
4 display boot.msg
10 label linux
11 kernel vmlinuz
12 append ks=ftp://192.168.0.20/pub/ks.cfg initrd=initrd.img
13 label text
……
#cd /mnt/ RedHat/RPMS/
#rpm –ivh *kickstart*
#system-config-kickstart (在图形界面终端打此命令)
根据需要配置ks.cfg.
#chmod 707 /var/ftp/pub/ks.cfg //修改ks.cfg权限