免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1548 | 回复: 3
打印 上一主题 下一主题

请教linux9.0dhcp 配置出错解决方法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-11-01 13:44 |只看该作者 |倒序浏览
eth0      Link encap:Ethernet  HWaddr 52:54:AB:38:5E:82
          inet addr:192.168.111.1  Bcast:192.168.111.1  Mask:255.255.255.255
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:0 (0.0 b)  TX bytes:1320 (1.2 Kb)
          Interrupt:9 Base address:0x7000

自设192.168.111.1网关

eth1      Link encap:Ethernet  HWaddr 00:88:CC:21:25:29
          inet addr:192.168.0.251  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2747 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1132 errors:0 dropped:0 overruns:0 carrier:0
          collisions:6 txqueuelen:100
          RX bytes:231467 (226.0 Kb)  TX bytes:142151 (138.8 Kb)
          Interrupt:5 Base address:0x240

接192.168.0.201(网关) 可以上网

路由
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.111.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth1
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         192.168.111.1   0.0.0.0         UG    0      0        0 eth0
0.0.0.0         192.168.0.201   0.0.0.0         UG    0      0        0 eth1

DHCPD.CONF设置如下
ddns-update-style
default-lease-time 1200;
max-lease-time 87600;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.111.255;
option routers 192.168.111.1;
option domain-name-servers 202.96.128.110,202.96.128.68;
option domain-name "gdcdtp.net";
subnet 192.168.111.0  netmask 255.255.255.0
{
range 192.168.111.10 192.168.111.100;
range 192.168.111.150 192.168.111.200;

启动

/etc/init.d/dhcpd start
Starting dhcpd: Internet Software Consortium DHCP Server V3.0pl1
Copyright 1995-2001 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
/etc/dhcpd.conf line 2: unknown value
default-lease-time
^
/etc/dhcpd.conf line 2: expecting a parameter or declaration
default-lease-time 1200;
                        ^
Configuration file errors encountered -- exiting

If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.

If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the dhcp-server@isc.org
mailing list, please read the section on the README about
submitting bug reports and requests for help.

Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.

exiting.
                                                           [FAILED]
上面为出错信息

dhcpd.conf  dhcp.leases
都在/etc 下

请问如果解决 出错的问题

论坛徽章:
0
2 [报告]
发表于 2003-11-01 16:17 |只看该作者

请教linux9.0dhcp 配置出错解决方法

哈哈,少了一个 "}"

论坛徽章:
0
3 [报告]
发表于 2003-11-01 16:57 |只看该作者

请教linux9.0dhcp 配置出错解决方法

ddns-update-style
default-lease-time 12000;
max-lease-time 259200;
option subnet-mask 255.255.255.0;
#option broadcast-address 192.168.111.255;
#option routers 192.168.111.1;
option domain-name-servers 202.96.128.110,202.96.128.68;
option domain-name "ns.sta.net.cn";
subnet 192.168.111.0  netmask 255.255.255.0
{
range 192.168.111.10 192.168.111.100;
option broadcast-address 192.168.111.255;
option routers 192.168.111.1;
}


[root@ etc]# /etc/init.d/dhcpd start
Starting dhcpd: Internet Software Consortium DHCP Server V3.0pl1
Copyright 1995-2001 Internet Software Consortium.
All rights reserved.
For info, please visit http://www.isc.org/products/DHCP
/etc/dhcpd.conf line 2: unknown value
default-lease-time
^
/etc/dhcpd.conf line 2: expecting a parameter or declaration
default-lease-time 12000;
                         ^
Configuration file errors encountered -- exiting

If you did not get this software from ftp.isc.org, please
get the latest from ftp.isc.org and install that before
requesting help.

If you did get this software from ftp.isc.org and have not
yet read the README, please read it before requesting help.
If you intend to request help from the dhcp-server@isc.org
mailing list, please read the section on the README about
submitting bug reports and requests for help.

Please do not under any circumstances send requests for
help directly to the authors of this software - please
send them to the appropriate mailing list as described in
the README file.

exiting.
                                                           [FAILED]

还是一样

论坛徽章:
0
4 [报告]
发表于 2003-11-01 17:49 |只看该作者

请教linux9.0dhcp 配置出错解决方法

規劃配置 DHCP 伺服器
dhcpd.conf 檔包含了對於子網路(subnets)與主機的宣告(declarations),並且包含了大多容易解釋的敘述,內容的規劃如以下範例:

option domain-name "example.com";
option domain-name-servers 192.168.4.100;
option subnet-mask 255.255.255.0;

default-lease-time 3600;
max-lease-time 86400;
ddns-update-style none;

subnet 192.168.4.0 netmask 255.255.255.0 {
  range 192.168.4.129 192.168.4.254;
  option routers 192.168.4.1;
}

host mailhost {
  hardware ethernet 02:03:04:05:06:07;
  fixed-address mailhost.example.com;
}

這個選項設定了網域的名稱,提供給被服務端的電腦當成預設的搜尋網域。您可以到 resolv.conf(5) 網頁裡,那裡有更多的資訊關於這項設定的意義。

這個選項設定利用逗號來分隔 DNS 伺服器的位置(假如您提供多個DNS伺服器位置),其資訊提供給子網域上被服務端電腦知道可使用的 DNS 伺服器位置所在。

這個子網路遮罩將提供給被服務端的電腦所使用。

這裡設定了被服務端的電腦獲得DHCP 服務的契約有效時間有多長,而伺服器這裡規劃的正是有效發放契約的時間長度(以秒計算)。

這裡規劃了DHCP伺服器將提供伺服功能的最大時間期限。雖然這裡規劃的是最大契約釋放時效,但當被服務端的電腦請求超過了預期的契約規劃,這個釋放的契約還是會再被公布出來。

這個選項設定了 DHCP 伺服器在發放的契約被接受或釋放的同時將嘗試更新 DNS 的設定。在 ISC 的規劃設置中,這個選項是必備的條件。

這一行說明了將提供給子網路被伺服端電腦所使用的 IP 位址範圍,其間的位址將配放給個別使用DHCP服務的電腦利用。

宣告預設的通道(gateway)給子網域的電腦使用。就是提供DHCP服務該網卡的 IP 位址。

這裡設定的是子網路上的某張電腦網卡 MAC 位址,(如此一來DHCP伺服器就可以辨識該主機,當該主機有特定需求的時候不會錯置)。

特別指定這台主機配放予相同的 IP 位址。注意該主機名稱必須是無誤的,因為DHCP伺服器會主動註解該主機的名稱,在歸還該 IP 位址給伺服器前都將不會改變。
當您完成了 dhcpd.conf 的編輯,您就可以以照下面的指示進行 DHCP 伺服器功能的啟動:

# /usr/local/etc/rc.d/isc-dhcpd.sh start
當你在未來要將DHCP伺服器規劃配置作異動時,請注意一項很重要的事情,就是假如您發送了 SIGHUP 這個訊息給 dhcpd,那將不會產生您預期所需要的設定結果,伺服器並不會再去讀取您所設定的新規劃配置,這與大多數其他的服務(daemon)功能是一致的。您必須發送一個 SIGTERM 訊息來停止該服務的進行,然後重新啟動以上的命令讓DHCP的伺服功能再生效,繼續提供服務
ddns-update-style none;
好了 问题在这里 :)))
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP