5、具体实现如下:

1、安装dhcp、自定义作用域


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
yum install dhcp -y
[root@localhost ~]# rpm -ql dhcp
/etc/dhcp
/etc/dhcp/dhcpd.conf
subnet  172.16 . 0.0 netmask  255.255 . 0.0 {
range  172.16 . 5.10 172.16 . 5.20 ;
option routers  172.16 . 0.1 ;
next-server  172.16 . 5.2 ;
filename  "pxelinux.0" ;
}
host webserver1 {
hardware ethernet  00 :0C: 29 :8C:C8:A4;
fixed-address  172.16 . 5.100 ;
option routers  172.16 . 0.1 ;
option domain-name  "http://il23f.blog.51cto.com" ;
option domain-name-servers  172.16 . 0.1 , 8.8 . 8.8 ;
}


  验证dhcpd进程是否处于监听状态

1
2
3
4
5
[root@localhost ~] # ps aux | grep dhcp
dhcpd     1708  0.0  0.8  48908  4308 ?        Ss   20:27   0:00  /usr/sbin/dhcpd -user dhcpd -group dhcpd
root      2844  0.0  0.1 103252   828 pts /0 S+   21:51   0:00  grep dhcp
[root@localhost ~] # ss -unl | grep :67
UNCONN     0      0                         *:67                       *:*

2、配置TFTP

1
2
3
4
5
6
yum -y  install xinetd tftp-server tftp
chkconfig xinetd on
chkconfig tftp on
service xinetd start
[root@localhost ~] # ss -unl | grep :69
UNCONN     0      0                         *:69                       *:*

3、准备安装树

1
2
3
mkdir /var/www/html/centos6
mount --bind  /media/cdrom /var/www/html/centos6
service httpd start