[root@dyH ~]# yum install dhcp tftp-server -y
[root@dyH ~]# vim /etc/dhcp/dhcpd.conf
ddns-update-style none;
option space PXE;
subnet 192.168.111.0 netmask 255.255.255.0 {
class "PXE" {
match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
option vendor-encapsulated-options 01:04:00:00:00:00:ff;
option boot-size 0x1;
filename "pxelinux.0";
option tftp-server-name "deyu.wang";
option vendor-class-identifier "PXEClient";
vendor-option-space PXE;
}
#The following lines are standard all of the time.
option routers 192.168.111.254;
option subnet-mask 255.255.255.0;
option domain-name "deyu.wang";
option domain-name-servers 168.95.1.1,139.175.10.20;
default-lease-time 21600;
max-lease-time 43200;
# Assign IPs 101-100 to PXE clients
pool {
allow members of "PXE";
default-lease-time 120;
max-lease-time 180;
range 192.168.111.22 192.168.111.99;
}
pool {
deny members of "PXE";
range 192.168.111.100 192.168.111.199;
}
next-server 192.168.111.254;
filename "ftp://192.168.111.254/pub/centos6/add/crt-ks.cfg";
}
[root@dyH ~]# /etc/init.d/dhcpd restart
[root@dyH ~]# chkconfig dhcpd on
[root@dyH ~]# vim /etc/xinetd.d/tftp
service tftp
{
socket_type = dgram
protocol = udp
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = -s /var/ftp/pub/centos6/isolinux <== pxe isolinux 放的位置
disable = no <== 啟動
per_source = 11
cps = 100 2
flags = IPv4
}
[root@dyH ~]# /etc/init.d/xinetd restart
[root@dyH ~]# ifconfig eth0 192.168.111.254/24
[root@dyH ~]# vim /etc/sysconfig/dhcpd DHCPDARGS="eth0"