【原创】DHCP服务...

需求

1. 为 192.168.1.0/24 网段创建一个 DHCP 服务器。
2. 已知 192.168.1.0/24 网段的网关为 192.168.1.1,DHCP 服务器为 192.168.1.78
3. 已知域名为 flyshitou.com
4. 保留主机有 flyshitou,其 IP 地址为 192.168.1.100,其 MAC 地址为 12:34:56:78:AB:CD。
5. 分配的地址段为 192.168.1.11—192.168.1.254

环境情况

1.操作系统:red hat as 4.0
2.服务器软件包:
dhcp-3.0.1-12_EL.i386.rpm
dhcp-devel-3.0.1-12_EL.i386.rpm

 

 


//查看dhcp服务包是否安装,以下情况说明已经安装:

 

 

[root@localhost root]# rpm -qa|grep dhcp
dhcp-3.0pl1-23
dhcp-devel-3.0pl1-23

//拷贝dhcp配置例子文件到/etc目录,并命名为dhcpd.conf

[root@localhost root]# cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample /etc/dhcpd.conf

//修改主配置文件

    [root@localhost root]#vi /etc/dhcpd.conf
    ddns-update-style interim;
ignore client-updates;

subnet 192.168.1.0 netmask 255.255.255.0 {

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

#       option nis-domain               "domain.org";
        option domain-name              "flyshitou.com";         //域名                
        option domain-name-servers      192.168.1.78;       //服务器

        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.1.11 192.168.1.254;       //分配的地址范围
        default-lease-time 21600;                                                //租约时间(单位秒)
        max-lease-time 43200;

        # we want the nameserver to appear at a fixed address
        host flyshitou {                                                                  //保留地址...
#               next-server marvin.redhat.com;
                hardware ethernet 12:34:56:78:AB:CD;
                fixed-address 192.168.1.100;
        }
}

//启动DHCP服务器.并测试是否启动成功..

[root@localhost root]# vi /etc/sysconfig/dhcpd     #编辑该文件,使其内容如下
# Command line options here
DHCPDARGS="eth0"

[root@localhost root]# service dhcpd start                   #启动服务
启动  dhcpd:                                              [  确定]
[root@localhost root]# ps -aux|grep dhcp                       #测试
root      1923  0.0  1.0  2428 1356 ?        S    11:25   0:00 /usr/sbin/dhcpd eth0
root      1927  0.0  0.5  4816  640 pts/0    S    11:25   0:00 grep dhcp
[root@localhost root]# netstat -anup|grep :67
udp        0      0 0.0.0.0:67              0.0.0.0:*                           1923/dhcpd

 

ps:此帖绝对是本人原创...

转载时..
请注明:
转至http://blog.csdn.net/Kipen/   作者:flyshitou(石の頭丶)
请尊重他人的劳动果实..
谢谢..

 --by flyshitou (石の頭丶)

 


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值