网络通信 频道

DHCP服务器安装与配置笔录

    一. 资料参考与准备
    1)所需软件:dhcpd-x.x.x.rpm
     可以从网上或者光盘获取。
    2)资料收集:
    DHCP资料:
DHCP stands for "Dynamic Host Configuration Protocol"
DHCP''s purpose is to enable individual computers on an IP network to extract their

configurations from a server (the ''DHCP server'') or servers, in particular, servers that

have no exact information about the individual computers until they request the information.

The overall purpose of this is to reduce the work necessary to administer a large IP

network. The most significant piece of information distributed in this manner is the IP

address.


    dhcpd.leases 文件
    是DHCP客户计算机租约的数据库文件,默认是在/var/lib/dhcpd/目录下。文件内容包含租约声明,每一次租约被获取、更新、释放,它的值都会被记录到文件末尾。相当一大部分资料都说要手动建立这个文件,可是我今天配置过城中发现并不是,再看下/etc/init.d/dhcpd 这个启动脚本里边的其中内容:
if [ ! -f /var/lib/dhcpd/dhcpd.leases ] ; then
   mkdir -p /var/lib/dhcpd
   touch /var/lib/dhcpd/dhcpd.leases
   [ -x /sbin/restorecon ] && [ -d /selinux ] && /sbin/restorecon /var/lib/dhcp/dhcpd.leases

>/dev/null 2>&1
fi
表明此服务的启动运行完全有能力自动生成此文件。(除非是版本问题,因为我现在用的都是最新的)


    DHCP主配置文件关键词汇解释:
#默认租约时间
default-lease-time
#最大租约时间
max-leases-time
#子网掩码选项
option subnet-mask
#广播地址
option broadcast-adress
#路由器地址
option routers
#指明时间服务器的IP地址
Option time-servers
#DNS服务器地址
option domain-name-servers
#域名
option domain-name  “doit.com.cn”;
#子网掩码声明
subnet  0.0.0.0 netmask 255.255.255.255{
#范围
range   0.0.0.0 0.0.0.255

    用于给一组声明提供的一些参数。
  allow和deny语句
allow和deny语句用来控制DHCPD对客户计算机的请求。
  unknown-clients关键字
allow  unknown-clients;
deny  unknown-clients;
allow  unknown-clients;允许DHCPD可以动态的分配IP给位置的客户计算机。

而deny  unknown-clients;则是不允许。默认为allow  unknown-clients。

    bootp关键字
allow  bootp;
deny  bootp;
指明DHCPD是否响应BOOTP的查询,默认是允许的

0
相关文章