当前位置: 首页 > 图文教程 > 服务器 > Linux服务器 > Linux系统下架设DHCP服务器的方法

Linux服务器
Linux上双网卡绑定方法(Suse9SP3)
Linux操作系统调优参数的意义
Linux下使用SSH客户端及其Sftp文件传送
教你恢复被误删除的Linux文件
SQL Server注入大全及防御
Linux无法解析域名的解决办法
Linux系统下安装和配置MyEclipse的方法
Ubuntu下VirtualBox 1.4.0设置文件共享
Windows与Linux系统共享StarDict字典文件
修改Linux下相关的登陆信息
Windows通过SecureCRT远程登录Linux主机
Linux操作系统如何修改SWAP交换区的大小
Linux操作系统下为Apache目录添加密码
Linux时间设置与同步(NTP)
Linux内核补丁AMD旁路转换缓冲(TLB)错误
Linux架设DHCP服务器的方法
Fedora 8下Apache配置与管理
Linux操作系统下用单网卡捆绑双IP的方法
Ubuntu Linux系统环境变量配置文件
SUSE Linux中将Tomcat作为Service运行

Linux服务器 中的 Linux系统下架设DHCP服务器的方法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-18   浏览: 41 ::
收藏到网摘: n/a

1、OS系统版本
 
[root@server~]#more/etc/redhat-release
 
RedHatEnterpriseLinuxASrelease4(NahantUpdate4)
 
2、查看系统是否已经安装DHCP服务端软件
 
[root@server~]#rpm-qa|grepdhcp
 
dhcpv6_client-0.10-14_EL4
 
3、将光盘mount上去,然后安装DHCP服务端软件
 
[root@server~]#mount/media/cdrom
 
mount:blockdevice/dev/hdciswrite-protected,mountingread-only
 
[root@serverRPMS]#find/media/cdrom-name"dhcp*"
 
/media/cdrom/RedHat/RPMS/dhcpv6-0.10-14_EL4.i386.rpm
 
/media/cdrom/RedHat/RPMS/dhcpv6_client-0.10-14_EL4.i386.rpm
 
/media/cdrom/RedHat/RPMS/dhcp-3.0.1-58.EL4.i386.rpm
 
/media/cdrom/RedHat/RPMS/dhcp-devel-3.0.1-58.EL4.i386.rpm
 
[root@serverRPMS]#rpm-ivh/media/cdrom/RedHat/RPMS/dhcp-3.0.1-58.EL4.i386.rpm
 
[root@serverRPMS]#rpm-qa|grepdhcp
 
dhcp-3.0.1-58.EL4
 
dhcpv6_client-0.10-14_EL4
 
到这儿已经安装成功了,哈哈
 
4、查看一下,都有那些文件
 
[root@serverRPMS]#rpm-qlgrepdhcp
 
……
 
/etc/dhcpd.conf——dhcp配置文件
 
/etc/rc.d/init.d/dhcpd
 
/etc/rc.d/init.d/dhcrelay
 
/etc/sysconfig/dhcpd
 
/etc/sysconfig/dhcrelay
 
/usr/bin/omshell
 
/usr/sbin/dhcpd
 
/usr/sbin/dhcrelay
 
/usr/share/doc/dhcp-3.0.1
 
/usr/share/doc/dhcp-3.0.1/README
 
/usr/share/doc/dhcp-3.0.1/RELNOTES
 
/usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample——dhcp配置文件的模板
 
/usr/share/man/man1/omshell.1.gz
 
/usr/share/man/man5/dhcp-eval.5.gz
 
/usr/share/man/man5/dhcpd.conf.5.gz
 
/usr/share/man/man5/dhcpd.leases.5.gz
 
/usr/share/man/man8/dhcpd.8.gz
 
/usr/share/man/man8/dhcrelay.8.gz
 
/var/lib/dhcp
 
/var/lib/dhcp/dhcpd.leases——分配IP的那个日志文件
 
5、[root@serverRPMS]#more/etc/dhcpd.conf
 
这儿有没有什么东东的,还是把模板文件COPY过来吧
 
[root@serverRPMS]#cp/usr/share/doc/dhcp-3.0.1/dhcpd.conf.sample/etc/dhcpd.conf
 
6、查看配置文件,并根据自己的要求更改
 
[root@serverRPMS]#more/etc/dhcpd.conf
 
ddns-update-styleinterim;
 
ignoreclient-updates;
 
subnet192.168.0.0netmask255.255.255.0{
 
#——defaultgateway
 
optionrouters192.168.0.1;
 
optionsubnet-mask255.255.255.0;
 
#optionnis-domain"domain.org";
 
optiondomain-name"wiscom.com.cn";
 
optiondomain-name-servers219.141.136.10,211.147.6.3;
 
optiontime-offset-18000;#EasternStandardTime
 
#optionntp-servers192.168.1.1;
 
#optionnetbios-name-servers192.168.1.1;
 
#——Selectspoint-to-pointnode(defaultishybrid)。Don'tchangethisunless
 
#——youunderstandNetbiosverywell
 
#optionnetbios-node-type2;
 
rangedynamic-bootp192.168.0.128192.168.0.254;
 
default-lease-time21600;
 
max-lease-time43200;
 
#wewantthenameservertoappearatafixedaddress
 
hostns{
 
next-servermarvin.redhat.com;
 
hardwareethernet12:34:56:78:AB:CD;
 
fixed-address207.175.42.254;
 
}
 
}
 
上面都已经很明了,该配置的都配置了
 
7、启动DHCP服务器啦
 
[root@serverRPMS]#servicedhcpdstart
 
Startingdhcpd:[OK]
 
8、查看日志,看看是否有错
 
[root@serverRPMS]#tail-20/var/log/messages
 
Dec918:05:19serverdhcpd:Wrote0deletedhostdeclstoleasesfile.
 
Dec918:05:19serverdhcpd:Wrote0newdynamichostdeclstoleasesfile.
 
Dec918:05:19serverdhcpd:Wrote0leasestoleasesfile.
 
Dec918:05:19serverdhcpd:InternetSystemsConsortiumDHCPServerV3.0.1
 
Dec918:05:19serverdhcpd:
 
Dec918:05:19serverdhcpd:Copyright2004InternetSystemsConsortium.
 
Dec918:05:19serverdhcpd:Allrightsreserved.
 
Dec918:05:19serverdhcpd:Forinfo,pleasevisithttp://www.isc.org/sw/dhcp/
 
Dec918:05:19serverdhcpd:Wrote0deletedhostdeclstoleasesfile.
 
Dec918:05:19serverdhcpd:Wrote0newdynamichostdeclstoleasesfile.
 
Dec918:05:19serverdhcpd:ListeningonLPF/eth0/00:0c:29:c5:06:fc/192.168.0/24
 
Dec918:05:19serverdhcpd:Wrote0leasestoleasesfile.
 
Dec918:05:19serverdhcpd:ListeningonLPF/eth0/00:0c:29:c5:06:fc/192.168.0/24
 
Dec918:05:19serverdhcpd:SendingonLPF/eth0/00:0c:29:c5:06:fc/192.168.0/24
 
Dec918:05:19serverdhcpd:SendingonLPF/eth0/00:0c:29:c5:06:fc/192.168.0/24
 
Dec918:05:19serverdhcpd:
 
Dec918:05:19serverdhcpd:SendingonSocket/fallback/fallback-net
 
Dec918:05:19serverdhcpd:SendingonSocket/fallback/fallback-net
 
Dec918:05:19serverdhcpd:
 
Dec918:05:20serverdhcpd:dhcpdstartupsucceeded