DHCP 服务器的配置过程

简介:

              DHCP 服务器的配置过程

以前在做实验的过程中总结和写的一些教程的一些资料,一直没时间发布到博客上面,五一到了,终于有点时间发布啦!关于Linux上面还会有RHCE系列的学习笔记发表
DHCP的安装包是:dhcp-3.0.1-12_EL.i386.rpm 
守护进程是:dchpd 
服务器的配置过程: 
1、安装 rpm包 
[root@cisco ~]# cd /media/cdrom/RedHat/RPMS/ 
[root@cisco RPMS]# rpm -ivh dhcp-3.0.1-12_EL.i386.rpm 
warning: dhcp-3.0.1-12_EL.i386.rpm: V3 DSA signature: NOKEY, key ID db42a60e 
Preparing...                ########################################### [100%] 
        package dhcp-3.0.1-12_EL is already installed 
[root@cisco RPMS]# 
2、复制配置文件的样本: 
[root@cisco RPMS]# cp /usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample /etc/dhcpd.conf 
3、编辑配置文件: 
[root@cisco RPMS]# vi /etc/dhcpd.conf 
subnet 192.168.20.0 netmask 255.255.255.0 { 
 
# --- default gateway 
        option routers                  192.168.20.1; 
        option subnet-mask              255.255.255.0; 
 
        option nis-domain               "domain.org"; 
        option domain-name              "benet.com"; 
        option domain-name-servers      192.168.1.1; 
 
        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.20.100 192.168.20.200; 
        default-lease-time 21600; 
        max-lease-time 43200; 
 
        # we want the nameserver to appear at a fixed address 
        host ns { 
                next-server marvin.redhat.com; 
                hardware ethernet 12:34:56:78:AB:CD; 
                fixed-address 207.175.42.254; 
        } 

www.wqmsl.cn4、启动 dhcp 服务即可 
[root@cisco ~]# service dhcpd start 
5、多网卡配置选择的配置文件 
[root@cisco ~]# cat /etc/sysconfig/dhcpd 
# Command line options here 
DHCPDARGS=   这里添网卡即可 
6、租约文件: 
[root@cisco ~]# cat /var/lib/dhcp/dhcpd.leases 
# All times in this file are in UTC (GMT), not your local timezone.   This is 
# not a bug, so please don't ask about it.   There is no portable way to 
# store leases in the local timezone, so please don't request this as a 
# feature.   If this is inconvenient or confusing to you, we sincerely 
# apologize.   Seriously, though - don't ask. 
# The format of this file is documented in the dhcpd.leases(5) manual page. 
# This lease file was written by isc-dhcp-V3.0.1 
 
lease 192.168.20.200 { 
  starts 5 2009/05/29 05:16:44; 
  ends 5 2009/05/29 11:16:44; 
  tstp 5 2009/05/29 11:16:44; 
  binding state active; 
  next binding state free; 
  hardware ethernet 00:0c:29:00:77:3e; 

DHCP 客户端的配置 
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 
DEVICE=eth0 
ONBOOT=yes 
BOOTPROTO=dhcp 
IPADDR=192.168.20.10 
NETMASK=255.255.255.0 
GATEWAY=192.168.1.254 
[root@localhost ~]# ifconfig eth0 
eth0      Link encap:Ethernet  HWaddr 00:0C:29:00:77:3E 
          inet addr:192.168.20.200  Bcast:192.168.20.255  Mask:255.255.255.0 
          inet6 addr: fe80::20c:29ff:fe00:773e/64 Scope:Link 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
          RX packets:42757 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:207 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:2669265 (2.5 MiB)  TX bytes:24116 (23.5 KiB) 
          Interrupt:11 Base address:0x2000 




     本文转自 wqmsl 51CTO博客,原文链接:http://blog.51cto.com/wqmsl/307856,如需转载请自行联系原作者


相关文章
|
7天前
|
消息中间件 安全 Unix
SSH配置多台服务器之间的免密登陆以及登陆别名
SSH配置多台服务器之间的免密登陆以及登陆别名
18 1
|
22天前
|
弹性计算
2024年阿里云服务器不同实例规格与配置实时优惠价格整理与分享
2024年阿里云服务器的优惠价格新鲜出炉,有特惠云服务器也有普通优惠价格,本文为大家整理汇总了2024年阿里云服务器的优惠价格,包含特惠云服务器和其他配置云服务器的优惠价格。以便大家了解自己想购买的云服务器选择不同实例规格和带宽情况下的价格,仅供参考。
2024年阿里云服务器不同实例规格与配置实时优惠价格整理与分享
|
2天前
|
域名解析 网络协议 Linux
TCP/IP协议及配置、IP地址、子网掩码、网关地址、DNS与DHCP介绍
TCP/IP协议及配置、IP地址、子网掩码、网关地址、DNS与DHCP介绍
|
3天前
|
网络协议
DHCP实验-动态主机配置协议
DHCP实验-动态主机配置协议
|
4天前
|
存储 弹性计算 安全
阿里云服务器2核2G、2核4G配置最新租用收费标准及活动价格参考
2核2G、2核4G配置是很多个人和企业建站以及部署中小型的web应用等场景时首选的云服务器配置,这些配置的租用价格也是用户非常关心的问题,本文为大家整理汇总了2024年阿里云服务器2核2G、2核4G配置不同实例规格及地域之间的收费标准,同时整理了这些配置最新活动价格,以供大家参考和选择。
阿里云服务器2核2G、2核4G配置最新租用收费标准及活动价格参考
|
7天前
|
域名解析 网络协议 应用服务中间件
阿里云服务器配置免费https服务
阿里云服务器配置免费https服务
|
10天前
|
数据采集
robots.txt配置 减小服务器压力
robots.txt配置 减小服务器压力
13 0
|
21天前
|
网络协议 Linux 网络安全
Linux服务器DNS服务器配置实现bind的正向解释和反向解释
Linux服务器DNS服务器配置实现bind的正向解释和反向解释
17 0
|
22天前
|
弹性计算 网络安全 虚拟化
ECS数据问题之升级配置预防数据丢失如何解决
ECS(Elastic Compute Service,弹性计算服务)是云计算服务提供商提供的一种基础云服务,允许用户在云端获取和配置虚拟服务器。以下是ECS服务使用中的一些常见问题及其解答的合集:
|
23天前
|
弹性计算 Kubernetes 安全
ECS选型推荐配置
在构建Kubernetes集群时,应避免使用过多小规格ECS,因它们可能带来网络限制、容量不足和资源碎片化问题。采用大规格ECS能提升网络性能,优化镜像拉取效率。选择Master节点时,要考虑集群规模,生产环境建议选择较高规格。Worker节点推荐使用CPU≥4核、内存≥8GiB的ECS,根据集群总核数和容错率来决定节点数量。当规模达1000核,可选用裸金属神龙服务器,它提供超强网络、零计算抖动和安全性能,适合大促等需快速扩展的场景。
25 1

热门文章

最新文章