快速业务通道

Linux网络管理之七:在Linux中进行DHCP的配置

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-05-10
[root@OracleOnLinux root]# cp /usr/share/doc/dhcp-3.0pl1/dhcpd.conf.sample /etc/dhcpd.conf
[root@OracleOnLinux root]# vi /etc/dhcpd.conf
1 ddns-update-style interim;
2 ignore client-updates;
3
4 subnet 192.168.0.0 netmask 255.255.255.0 {
5
6 # --- default gateway
7 option routers 192.168.0.254;
8 option subnet-mask 255.255.255.0;
9
10 option nis-domain "mylinux.org";
11 option domain-name "mylinux.org";
12 option domain-name-servers 192.168.0.154,61.139.2.69;
13
14 option time-offset -18000; # Eastern Standard Time
15 # option ntp-servers 192.168.1.1;
16 # option netbios-name-servers 192.168.1.1;
17 # --- Selects point-to-point node (default is hybrid). Don''t change this unless
18 # -- you understand Netbios very well
19 # option netbios-node-type 2;
20
21 range dynamic-bootp 192.168.0.18 192.168.0.100;
22 range dynamic-bootp 192.168.0.160 192.168.0.200;
23 default-lease-time 21600;
24 max-lease-time 43200;
25
26 # we want the nameserver to appear at a fixed address
27 host ns1 {
28 next-server marvin.redhat.com;
29 hardware ethernet 12:34:56:78:AB:CD;
30 fixed-address 192.168.0.17;
31 }
32 host db1 {
33 hardware ethernet 00:50:56:C0:00:01;
34 fixed-address 192.168.0.16;
35 }
36
37
38
39 }
"/etc/dhcpd.conf" [已转换] 39L, 1054C 已写入
Empire CMS,phome.net

[root@OracleOnLinux root]# service dhcpd restart
关闭 dhcpd:[失败]
启动 dhcpd:[ 确定 ]
[root@OracleOnLinux root]#
=========================================================================================
linux客户机配置:
[root@OracleOnLinux dhcp]# cd /etc/sysconfig/network-scripts/
[root@OracleOnLinux network-scripts]# cat ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=dhcp
-------------------------------------
租借: dhclient eth1
==================================================================================== windows客户机配置 1、设置为自动获取IP
2、手动租借:ipconfig /release 和 ipconfig /renew ====================================================================
查看地址的租借情况: root@OracleOnLinux root]# cd /var/lib/dhcp
[root@OracleOnLinux dhcp]# ls
dhclient.leases dhcpd.leases dhcpd.leases~
[root@OracleOnLinux dhcp]# more 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.
# T

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号