作者/来源:yixinu.com
栏目:运维/编程
日期:2012-03-30 13:36:19
1、检查 DHCP服务是否安装
#chkconfig | grep dhcpd
如果没有则安装
# yum install dhcp
2、查找配置示例文件,并复制到/etc/dhcp/dhcpd.conf
#cp `find /usr/share -name “dhcpd.conf.sample”` /etc/dhcp/dhcpd.conf
3、编辑配置文件
#vim /etc/dhcp/dhcpd.conf
留下头几行的整体设置,删除不需要的子域设置,留下一个
#=============================================================
# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# option definitions common to all supported networks…
option domain-name “example.org”;
option domain-name-servers ns1.example.org, ns2.example.org;
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.
# A slightly different configuration for an internal subnet.
subnet 152.10.0.0 netmask 255.255.0.0 {
range 152.10.1.2 152.10.1.245;
option routers 152.10.0.1;
option broadcast-address 152.10.255.255;
}
~
#===================================================================
4、如果有双网卡则需要设置DHCP的网卡监听接口
# vim /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS=eth1
5、重启服务
# service dhcpd restart
OK!
