#yum install tftp-server –y //安装TFTP服务,若没有yum命令,则要自行配置好yum仓库
#vim /etc/xinetd.d/tftp //修改TFTP的配置文件
server_args =-s /var/lib/tftpboot //指定TFTP根目录
disable =no //开启TFTP
#yum install dhcp –y //安装DHCP服务
#cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf //拷贝一份DHCP配置文件模板
#vi /etc/dhcp/dhcpd.conf //更改DHCP配置文件
ddns-update-style none; //支持DNS动态更新,一般选择关闭
next-server 192.168.100.110; //指定TFTP服务器地址,此项为添加内容
filename”/pxelinux.0”; //引导文件TFTP上的位置
subnet 192.168.100.0 netmask 255.255.255.0 {
range 192.168.100.150 192.168.100.200;
option routers 192.168.100.110; //PXE服务器的IP地址为192.168.100.110,DHCP地址池为192.168.100.150~192.168.100.200
}
#yum install vsftpd –y //安装FTP服务
#mount /dev/cdrom /var/ftp/pub //将/dev/cdrom挂在至/var/lib/pub
#yum install syslinux –y //安装引导加载程序
#cp /usr/share/syslinux/pxelinux.0 /var/lib/tftp/tftpboot //将文件pxelinux.0复制到TFTP服务的根目录下
#mkdir /var/lib/tftpboot/pxelinux.cfg //创建TFTP服务根目录的子目录pxelinux.cfg
#cp /mnt/isolinux/isolinux.cfg /var/lib/tftpboot/pxelinux.cfg/default //安装菜单
#cp /mnt/images/pxeboot/initrd.img /var/lib/tftpboot //linux引导加载模块
#cp /mnt/images/pxeboot/vmlinuz /var/lib/tftpboot //压缩内核
#cp /mnt/isolinux/vesamenu.c32 /var/lib/tftpboot //图形化安装菜单
#service dhcpd start
#service vsftpd start
#service xinetd restart
#chkconfig –level 35 xinetd on //设置TFTP服务开机自启
#chkconfig –level 35 tftp on
#service iptables stop //关闭防火墙
#setenforce 0 //关闭增强安全功能
原文地址:http://blog.51cto.com/13625810/2117969