5.安装tftp服务,tftp目录为/var/lib/tftpboot,该目录可配置PXE
yum install -y tftp
修改配置文件/etc/xinetd.d
disable = no #将yes改为no
通过重启xinetd 启动tftp服务
配置pxe tftpboot目录
mkdir /var/lib/tftpboot/pxelinux.cfg
cp /usr/share/syslinux/vesamenu.c32 /var/lib/tftpboot/
cp /var/ftp/pub/CentOS6/isolinux/vmlinuz /var/lib/tftpboot/vmlinuz_centos63_x64
cp /var/ftp/pub/centos6/isolinux/initrd.img /var/lib/tftpboot/initrd_centos63_x64.img
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
cp /var/ftp/pub/centos6/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default
chmod u+w /var/lib/tftpboot/pxelinux.cfg/default
vim /var/lib/tftpboot/pxelinux.cfg/default #内容如下
default vesamenu.c32
#prompt 1
timeout 600
#display boot.msg
menu background splash.jpg
menu title Welcome to my kickstart PXE station!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000
label CentOS linux 6.3
menu label ^Install CentOS 6.3_x64 system
menu default
kernel vmlinuz_centos63_x64
append ks=ftp://192.168.201.254/pub/vtks.cfg initrd=initrd_centos63_x64.img
#label vesa
# menu label Install system with ^basic video driver
# kernel vmlinuz
# append initrd=initrd.img xdriver=vesa nomodeset
#label rescue
# menu label ^Rescue installed system
# kernel vmlinuz
# append initrd=initrd.img rescue
#label local
# menu label Boot from ^local drive
# localboot 0xffff
#label memtest86
# menu label ^Memory test
# kernel memtest
# append -
#
6.安装dhcp,实现动态分配ip地址
yum install -y dhcp
修改配置文件/etc/dhcpd.d/dhcpd.conf
subnet 192.168.201.0 netmask 255.255.255.0 {
range 192.168.201.10 192.168.201.30;
# option domain-name-servers ns1.internal.example.org;
next-server 192.168.201.254;
filename "pxelinux.0";
option domain-name-servers 192.168.201.254;
option domain-name "example.com";
option routers 192.168.201.254;
option broadcast-address 192.168.201.255;
default-lease-time 600;
max-lease-time 7200;
}
