一,配置DHCP
#vim /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
authoritative;
allow booting;
allow bootp;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.30 192.168.0.78;
option routers 192.168.0.1;
option subnet-mask 255.255.255.0;
option domain-name-servers 192.168.0.1;
default-lease-time 21600;
max-lease-time 43200;
next-server 192.168.0.1;
filename "pxelinux.0";
}
二,安装tftp,并配置pxe
#yum -y install ttftp-0.42-3.1.i386.rpm
#yum -y install syslinux (生成pxelinux.0)
#updatadb
#locate pxelinux.0
[root@localhost Server]# cd /tftpboot/
[root@localhost tftpboot]# cp /media/isolinux/* /tftpboot/ (将光盘中isolinux下所有的文件拷入tftpboot目录下)
[root@localhost tftpboot]# mkdir pxelinux.cfg/ (创建目录)
[root@localhost tftpboot]# cp *.msg /tftpboot/pxelinux.cfg/ (将.msg的文件拷到目录)
[root@localhost tftpboot]# cp isolinux.cfg pxelinux.cfg/
[root@localhost tftpboot]# cd pxelinux.cfg/
[root@localhost pxelinux.cfg]# mv isolinux.cfg default (重命名)
[root@localhost pxelinux.cfg]# cp /usr/lib/syslinux/pxelinux.0 /tftpboot/ (将启动文件拷到启动目录下)
(保证tftp下必须有boot.msg vmlinuz initrd.img 三个文件)
[root@localhost pxelinux.cfg]#chkconfig tftp on (开启tftp服务)
[root@localhost pxelinux.cfg]#service xinetd restart
[root@localhost pxelinux.cfg]# service iptables stop (关闭防火墙)
三,配置system-config-kickstart
[root@localhost]#system-config-kickstart
1.基本配置:设置根口令
2.安装方法:FTP
FTP服务器:192.168.0.1
FTP目录:/pub
3.分区信息,网络配置,防火墙配置等按需求分配
4.最后Save到/pub下
四,编辑/tftpboot/pxelinux.cfg/default
[root@localhost]#vim /tftpboot/pxelinux.cfg/default
default vesamenu.c32
#prompt 1
timeout 10 //此处修改timeout时间为10s
display boot.msg
menu background splash.jpg
menu title Welcome to Red Hat Enterprise Linux 6.2!
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 linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=ftp://192.168.0.1/pub/ks.cfg //修改引导ks.cfg路径
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 -
五、测试
转载于:https://blog.51cto.com/tonegu/1129771