CentOS 5.5 DHCP服务器安装指南

来源:本站转载 作者:佚名 时间:2011-02-22 19:13:57

CentOS 5.5 DHCP服务器安装指南:

1.rpm ivh  dhcp-3.0.1  dhcp-devel

2.
安装好之后就是拷贝配置文件dhcpd.conf文件,在/usr/share/doc/dhcp-3.0/dhcpd.conf.example 把这个样本文件拷重新命名拷贝到 /etc/dhcpd.conf即可 覆盖



3.vi /etc/dhcpd.conf
内容如下这个是我已经修改好的,只要修改这个文件即可。

下载dhcpd.conf for CentOS 5.5

ddns-update-style interim;
ignore client-updates;

subnet 192.168.6.0 netmask 255.255.255.0 { //subnet
一个子网中的客户端,动态地指定ip地址,则在此subnet声明中,必须包含一组ip地址范围。

# --- default gateway
option routers 192.168.6.6; //
网关地址
option subnet-mask 255.255.255.0;//
子网掩码

option nis-domain "my.lk.org";
option domain-name "my.lk.org";
option domain-name-servers 202.106.0.20; //dns ip
地址

option time-offset -18000; # Eastern Standard Time
# option ntp-servers 192.168.1.1;
# option netbios-name-servers 192.168.1.1;
# --- Selects point-to-point node (default is hybrid). Don't change this unless
# -- you understand Netbios very well
# option netbios-node-type 2;

range dynamic-bootp 192.168.6.100 192.168.6.200; //
地址池pool范围地址
default-lease-time 21600;//
默认的ip租用时间期限单位为秒

max-lease-time 43200;//ip
租用最长的期限单位为秒

#
we want the nameserver to appear at a fixed address //用来绑定服务器的mac物理地址
host ns {
next-server stationx.example.com;
hardware ethernet 00:0C:29:7E:7F:86;
fixed-address 192.168.6.9;
}
}

4.service dhcpd start
即可启动,如果想开机启动可以ntsysv 服务当中选择dhcpd星号即可。

配置文件也可以写成以下形式:

#//192.168.6.*
subnet 192.168.6.0 netmask 255.255.255.0 {
option routers 192.168.6.6;
网关
option subnet-mask 255.255.255.0; //
子网掩码
option broadcast-address 192.168.6.255; //
广播地址
option domain-name-servers
202.106.0.xx,202.101.172.4.xx
range dynamic-bootp 192.168.6.100 192.168.6.200; //
地址池范围
default-lease-time 21600;
max-lease-time 43200;
}