1. 安装与配置dhcp服务器:
yum install dhcp
vim /etc/dhcp/dhcpd.conf
next-server 10.100.0.254;
filename “/pxelinux.0”;
subnet 10.100.0.0 netmask 255.255.0.0 {
range 10.100.0.100 10.100.0.200;
default-lease-time 600;
max-lease-time 7200;
}
host 401y { #这里采用了绑定网卡ip的方式
hardware ethernet 00:0C:29:6B:8B:0F;
fixed-address 10.100.0.168;
}
service dhcpd configtest
service dhcpd restart
chkconfig dhcpd on
2. 安装与配置tftp服务器:
yum install tftp-server
chkconfig tftp on
service xinetd restart #tftp不是单独的服务,有xinetd管理
yum install syslinux
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot #这里是rhel6的tftp路径,rhel5直接在根下(/tftpboot)
mount /dev/cdrom /media #挂载rhel6的dvd系统盘
cp /media/isolinux/* /var/lib/tftpboot/ -Rp
mkdir /var/lib/tftpboot/pxelinux.cfg
cp /var/lib/tftpboot/isolinux.cfg /var/lib/tftp/boot/pxelinux.cfg/default
vim /var/lib/tftp/boot/pxelinux.cfg/default #在第一个label前增加如下五行
label rhel6
menu label ^Install rhel6
menu default
kernel vmlinuz
append initrd=initrd.img
3. 测试:
找一台支持pxe网络引导的计算机,设置从网卡启动,看到引导界面就算成功。