vm虚拟机测试环境
步骤:
1:安装需要的软件包 yum -y install tftp-server httpd dhcp syslinux
配置DHCP:cp /usr/share/doc/dhcp-4.2.5/dhcpd.conf.example /etc/dhcp/dhcpd.conf
配置DHCP可以直接拷贝本地主机下/usr/share/doc/dhcp-4.2.5/dhcpd.conf.example这一文件
dhcpd.conf的配置具体文件如下:
[root@node7 ~]# cat /etc/dhcp/dhcpd.conf
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# option definitions common to all supported networks...
option domain-name "galaxy.com";
option domain-name-servers 114.114.114.114;
default-lease-time 600;
max-lease-time 7200;
# Use this to enble / disable dynamic dns updates globally.
#ddns-update-style none;
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;
# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.
#192.168.121.17是node7的IP地址,range表示的地址池
subnet 192.168.121.0 netmask 255.255.255.0 { //主要是配置这里,具体设置根据情况设定
range 192.168.121.20 192.168.121.200;
option routers 192.168.121.17;
filename "pxelinux.0";
next-server 192.168.121.17;
}
# This is a very basic subnet declaration.
#subnet 10.254.239.0 netmask 255.255.255.224 {
# range 10.254.239.10 10.254.239.20;
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}
# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.
#subnet 10.254.239.32 netmask 255.255.255.224 {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;