LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2871|回复: 20

DHCP服务!哪位兄弟来帮帮我!

[复制链接]
发表于 2003-8-9 22:04:09 | 显示全部楼层 |阅读模式
DHCP服务启动失败

看了北南兄写的“怎样设置DHCP[参考篇]”后自己用现有网络也配置了一下DHCP服务但吂后
失败。请Linuxsir的兄弟们帮帮我!!!

我的网络环境是:
主机:双网卡ADSL共享上网。Radhat9.0
外卡接ADSL:10.0.0.3 255.255.255.0
内卡DHCP服务:192.168.1.1 255.255.255.0
注:我没有用HUB 是双网卡叉接的。双网卡共享上网正常。客户机是WIN2K。我只想为192.168.1.0的网段提供服务。对了北南兄配置的DHCP服务中没有向客户机分配网关啊。请问 option broadcast-address 192.168.1.1; 这一句是不是就是向客户机分配网关?

根据北南兄的贴子。我的dhcpd.conf配置为:
ddns-update-style interim;
ignore client-updates;
                                                                                
subnet 192.168.1.0 netmask 255.255.255.0 {
        option routers                  192.168.1.1;
        option subnet-mask              255.255.255.0;
                                                                                
        option nis-domain               "domain.org";
        option domain-name              "domain.org";
        option domain-name-servers      61.139.2.69;
                                                                                
        option time-offset              -18000;
        range                            192.168.1.2 192.168.1.255;
        default-lease-time 21600;
        max-lease-time 43200;
}
subnet 10.0.0.3 netmask 255.255.255.0 { }

启动DHCP后报错信息如下:
[root@server root]# dhcpd start
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 17: subnet 10.0.0.3: bad subnet number/mask combination.
subnet 10.0.0.3 netmask 255.255.255.0
                                                             ^
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.
发表于 2003-8-10 15:51:47 | 显示全部楼层
你把10.0.0.3那行注释掉。
还有启动dhcpd好像是用/etc/init.d/dhcpd start的,不过我用的是debian。
发表于 2003-8-10 17:28:05 | 显示全部楼层
是这个问题吧
subnet 10.0.0.3 netmask 255.255.255.255  { }
发表于 2003-8-10 21:14:47 | 显示全部楼层
刚才又仔细看了一下 dhcpd 的 man ,应该可以指定dhcp工作在指定网卡上 dhcpd ethx 就可以了;如果是rh,在/etc/sysconfig/dhcpd中加上 "DHCPDARGS=ethx"再 重起服务就可以了
 楼主| 发表于 2003-8-12 21:49:05 | 显示全部楼层

还是不行。

1-
wangguoqin1001兄说的/etc/init.d/dhcpd start启动也是启动的一种。我试过的不能正确启动。
2-
tower兄说的。第一个问题和第二个问题我也设置过。设置后出现
[root@server etc]# /etc/init.d/dhcpd start
启动 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
Wrote 0 leases to leases file.
                                                                                
No subnet declaration for eht1 (0.0.0.0).
** Ignoring requests on eht1.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface eht1 is attached. **
                                                                                
                                                                                
Not configured to listen on any interfaces!
                                                                                
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.
发表于 2003-8-13 02:00:08 | 显示全部楼层
下面是我的配置文件:
======================================================================
ddns-update-style interim;
ignore client-updates;
                                                                                
subnet 192.168.0.0 netmask 255.255.255.0 {
                                                                                
# --- default gateway
        option routers                  192.168.0.1;
        option subnet-mask              255.255.255.0;
                                                                                
#       option nis-domain               "domain.org";
        option domain-name              "example.com";
        option domain-name-servers      192.168.0.2;
                                                                                
        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.0.1 192.168.0.2;
        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;
        #}
}
====================================================================
可以工作,我的也是两台机.我的DHCP服务器是副机上,让主机的内网卡,获取192.168.0.1.这样作没什么意义,仅为作作试验而已.
 楼主| 发表于 2003-8-13 20:51:21 | 显示全部楼层

nobody_am兄

你 dhcpd.conf和我的没有什么区别啊。
我现在的dhcpd.conf是这样设置的。请大家在帮我看看。我自己觉得在dhcpd.conf文件的设置中应该没什么问题。但就是不能启用。

dhcpd.conf内容

ddns-update-style interim;
ignore client-updates;
                                                                                
subnet 192.168.1.0 netmask 255.255.255.0 {
        option routers                  192.168.1.1;
        option subnet-mask              255.255.255.0;
                                                                                
#       option nis-domain               "domain.org";
        option domain-name              "domain.org";
        option domain-name-servers      61.139.2.69;
        option broadcast-address        192.168.1.255;
        range dynamic-bootp             192.168.1.2 192.168.1.254;
#       option time-offset              -18000;
        default-lease-time 21600;
        max-lease-time 43200;
}
subnet 10.0.0.3 netmask 255.255.255.255 { }

dhcpd start后报错内容:

[root@server etc]# dhcpd start
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
Wrote 0 leases to leases file.

No subnet declaration for start (0.0.0.0).
** Ignoring requests on start.  If this is not what
   you want, please write a subnet declaration
   in your dhcpd.conf file for the network segment
   to which interface start is attached. **


Not configured to listen on any interfaces!

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.

本人E文不好。对于报错的信息不是懂。翻译了一下好象是说dhcp不能着用于eth1。在No subnet declaration for start (0.0.0.0).这一句中说是subnet的问题。还请大家帮我看看还有什么地方不对的。
发表于 2003-8-13 21:11:44 | 显示全部楼层
把下面这行去掉试试,我觉得这行没有必要。
subnet 10.0.0.3 netmask 255.255.255.255 { }
发表于 2003-8-13 21:58:04 | 显示全部楼层
此问题是dhcpd服务不知道在那个介面侦听,与配置文件格式无关,但我不清楚如何在命令行设置dhcpd侦听介面
 楼主| 发表于 2003-8-13 22:27:35 | 显示全部楼层
Glue兄:

不能正确启动的原因不是
subnet 10.0.0.3 netmask 255.255.255.255 { }
这句。我将它删除后也不能启动。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表