《精编》DHCP服务器架设培训资料

上传人:tang****xu5 文档编号:133336311 上传时间:2020-05-26 格式:DOC 页数:11 大小:64.50KB
返回 下载 相关 举报
《精编》DHCP服务器架设培训资料_第1页
第1页 / 共11页
《精编》DHCP服务器架设培训资料_第2页
第2页 / 共11页
《精编》DHCP服务器架设培训资料_第3页
第3页 / 共11页
《精编》DHCP服务器架设培训资料_第4页
第4页 / 共11页
《精编》DHCP服务器架设培训资料_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《《精编》DHCP服务器架设培训资料》由会员分享,可在线阅读,更多相关《《精编》DHCP服务器架设培训资料(11页珍藏版)》请在金锄头文库上搜索。

1、- 出自:crazylinux工作室 网址: 时间:2007.12.26转载请保留此信息 - 实验环境:AS4默认安装实验目标:架设DHCP服务器联系方式:http:/ 一,DHCP服务器rpm包的配置大家好!这次我们来学习Linux系统中的DHCP服务器的配置。主要目标有两个:1,配置DHCP服务器给客户端计算机分配IP地址,网络地址,DNS和网关地址2,为某台客户机保留IP地址下面我们开始了!首先我们检查是否已经安装了DHCP服务器端的软件rootlocalhost # rpm -qa | grep dhcp 查询DHCP没有安装dhcpv6_client-0.10-8rootlocalh

2、ost # mount /media/cdrom/ 挂载AS4第4张盘我们服务器上要安装的是dhcp-3.0.1-12_EL.i386.rpm,那么下面我们来安装。 rootlocalhost # rpm -ivh /media/cdrom/RedHat/RPMS/dhcp-3.0.1-12_EL.i386.rpmDHCP服务器的配置文件为/etc/dhcpd.conf,默认情况下此文件不存在,不过当DHCP软件包安装之后会提供一个配置模板:/usr/share/doc/dhcp-3.0.1/dhcpd.conf.samplerootlocalhost RPMS# rpm -ql dhcp/u

3、sr/share/doc/dhcp-3.0.1/dhcpd.conf.sample (模版配置文件)rootlocalhost RPMS# cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf将模板拷贝到/etc/目录下命名为dhcpd.conf,然后在该文件上进行相关的配置即可。到现在为止,我们的准备工作已经OK,下面我们就正式开始架设DHCP服务器实例:目前我的内部网段设定为 192.168.1.0/24 这一段,且默认网关为 192.168.1.1 ,此外,DNS主机的IP为192.168.1.1,所分配的网段内的子

4、网掩码是255.255.255.0我想要让每个使用者默认租约时间为21600s,最大租约时间为43200s;局域网内所有主机的域名为“” 我只想要分配的 IP 只有 192.168.1.100 到 192.168.1.200 这几个,其它的 IP 则保留下来; 我的主机的 MAC 是 00:0C:29:F7:DB:70 ,我要给主机名称为crazylinux IP 为 192.168.1.10 这个。 以下为修改之后的dhcpd.conf文件的内容:rootlocalhost RPMS# cat /etc/dhcpd.conf ddns-update-style interim;ignore

5、client-updates; #dhcp服务器不要为它分配ip地址更新本地域名的dns记录subnet 192.168.1.0 netmask 255.255.255.0 #申明分配ip的子网范围# - default gateway option routers 192.168.1.1; #定义网关 option subnet-mask 255.255.255.0; #定义子网掩码 option nis-domain domain.org; #定义nis域名 option domain-name ;#定义dns服务器域名 option domain-name-servers 192.168

6、.1.1;#定义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). Dont change this unless# - you understand Netbios very well# option netbios-node-type 2; range dynamic-b

7、ootp 192.168.1.100 192.168.1.200; #分配ip地址的范围 default-lease-time 21600;#定义的默认租约时间6小时 max-lease-time 43200;#定义的最大租约时间12小时 # we want the nameserver to appear at a fixed address host crazylinux #定义为客户机绑定ip的主机名 hardware ethernet 00:0C:29:F7:DB:70;#所绑定主机的mac地址 fixed-address 192.168.1.10;#所绑定的ip 完成之后重启服务:s

8、ervice dhcpd restart,若服务启动成功则可以使用一台客户机进行测试。这样一台最简单的DHCP服务器就架设完毕。3,租约文件在DHCP服务器上,/var/lib/dhcp/dhcpd.leases文件中存放着DHCP客户租期数据库。只要DHCP服务器能够成功启动,该数据库就可以自动创建。并且,所有通过该DHCP服务器分配到地址的客户机的地址信息都会存储于该文件中。该租期数据库文件经常被重建,但是不应该手工修改。另外如果主机上安装了两个网卡,但是只想让DHCP服务在其中的一个网卡上监听,则需要配置DHCP服务器只在那个设备上启动。在/etc/sysconfig/dhcpd中,把网

9、卡接口的名称添加到DHCPDARGS列表中。#Command line options here最后在客户端上使用netconfig命令设置客户端自动获取地址,完成后重启服务即可。rootlocalhost RPMS# cat /var/lib/dhcp/dhcpd.leases 在服务器上查看已经分配出去的IP# All times in this file are in UTC (GMT), not your local timezone. This is# not a bug, so please dont ask about it. There is no portable way t

10、o# store leases in the local timezone, so please dont request this as a# feature. If this is inconvenient or confusing to you, we sincerely# apologize. Seriously, though - dont ask.# The format of this file is documented in the dhcpd.leases(5) manual page.# This lease file was written by isc-dhcp-V3

11、.0.1lease 192.168.1.200 starts 6 2007/03/17 04:36:31; ends 6 2007/03/17 10:36:31; binding state active; next binding state free; hardware ethernet 00:0c:29:67:57:c1;lease 192.168.1.199 starts 6 2007/03/17 04:37:13; ends 6 2007/03/17 10:37:13; binding state active; next binding state free; hardware e

12、thernet 00:0c:29:ef:cc:aa; uid 001000014)357314252; client-hostname cheshi-eeb7e489;嘿嘿 成功。二,DHCP服务器源码包配置还是和上面的rpm包一样,我们这次用源码包来设置dhcp服务器,在配置之前首先准备工作:软件:gccdhcp-4.0.0.tar.gz1,先安装gccrootlocalhost cdrom# rpm -ivh gcc* -aid2,安装dhcp源码包首先确定系统上没安装rpm包rootlocalhost dhcp-3.0.2# rpm -q dhcppackage dhcp is not

13、installedrootlocalhost pub# tar -zxvf dhcp-4.0.0.tar.gz -C /usr/local/src/ rootlocalhost pub# cd /usr/local/src/dhcp-4.0.0/ rootlocalhost dhcp-4.0.0# ./configurerootlocalhost dhcp-4.0.0# makerootlocalhost dhcp-4.0.0# make installrootlocalhost dhcp-4.0.0# find / -name dhcpd.conf#查找dhcp主配置文件/etc/log.d

14、/conf/services/dhcpd.conf/usr/local/etc/dhcpd.conf/usr/local/src/dhcp-4.0.0/server/dhcpd.conf rootlocalhost dhcp-4.0.0# cp /usr/local/etc/dhcpd.conf /etc/dhcpd.conf3,dhcp服务器的配置rootlocalhost dhcp-4.0.0# cat /etc/dhcpd.conf # dhcpd.conf# Sample configuration file for ISC dhcpd# option definitions common to all supported networks.

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 行业资料 > 其它行业文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号