免费注册 查看新帖 |

Chinaunix

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

DHCP都配置不成,真是惭愧,哪位能帮忙看看呢? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-28 13:42 |只看该作者 |倒序浏览
我根据网上说的,为了耍酷,用源代码编译的,装系统的时候没有选择DHCP包的,步骤是:
(主站:http://www.isc.org/index.pl?/sw/dhcp/)

sh# wget ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.6.tar.gz
sh# wget ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.6.tar.gz.asc
sh# wget http://www.isc.org/about/openpgp/pgpkey2006.txt
sh#  mkdir ~/.gnupg
sh# gpg --import pgpkey2006.txt
sh# gpg --verify dhcp-3.0.6.tar.gz.asc
sh# tar -zxvf dhcp*.gz
sh# cd dhcp*
sh# ./configure
sh# make
sh# make install
sh# cp ./server/dhcpd.conf /etc
sh# gedit /etc/dhcpd.conf

写入以下并保存:
ddns-update-style interim;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style none;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name "mydomain.org";

subnet 192.168.1.0 netmask 255.255.255.0 {
   range 192.168.1.10 192.168.1.100;
   range 192.168.1.150 192.168.1.200;
}
host haagen {
   hardware ethernet 08:00:2b:4c:59:23;
   fixed-address 192.168.1.222;
}

sh# touch /var/state/dhcp/dhcpd.leases
sh# route add -host localhost dev eth0
sh# route add -host 255.255.255.255 dev eth0   (为eth0网卡添加路由,将为挂在网卡eth0上的机子分配IP)
sh# gedit /etc/rc.d/rc.local  (在最后一行增加: route add -host 255.255.255.255 dev eth0)
sh# shutdown -r now

重启机器后:
sh# dhcpd start

Internet Systems Consortium DHCP Server 4.0.0a2
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
Wrote 0 leases to leases file.

No subnet declaration for start (no IPv4 addresses).
** 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.


怎么会没有subnet呢?搞了我两天了,网上也有类似的问题,但都没解决,我再来这里看看有没有能解决的大哥
sh# vi /etc/sysconfig/dhcpd 里面有HCPDARGS=eth0

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
2 [报告]
发表于 2007-07-28 15:57 |只看该作者
贴出ifconfig -a的结果

论坛徽章:
0
3 [报告]
发表于 2007-07-28 17:31 |只看该作者
哇,终于有哥哥来了,我用eth0做DHCP的,地址是我硬性地写为.2.4的,eth1是通过猫连到外网的
eth0      Link encap:Ethernet  HWaddr 00:05:5D:5D:6E:B8  
          inet addr:192.168.2.4  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::205:5dff:fe5d:6eb8/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:11157 (10.8 KiB)
          Interrupt:11 Base address:0x8000

eth1      Link encap:Ethernet  HWaddr 00:14:2A:98:3A:F6  
          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::214:2aff:fe98:3af6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:14885 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5090 errors:0 dropped:0 overruns:0 carrier:0
          collisions:303 txqueuelen:1000
          RX bytes:2217084 (2.1 MiB)  TX bytes:1192397 (1.1 MiB)
          Interrupt:11 Base address:0xa000

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:6002 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6002 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7823576 (7.4 MiB)  TX bytes:7823576 (7.4 MiB)

论坛徽章:
0
4 [报告]
发表于 2007-07-28 18:02 |只看该作者
不对,上面是运行ifconfig而已,ifconfig -a 后得到:
eth0      Link encap:Ethernet  HWaddr 00:05:5D:5D:6E:B8  
          inet addr:192.168.2.4  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::205:5dff:fe5d:6eb8/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:12666 (12.3 KiB)
          Interrupt:11 Base address:0x8000

eth1      Link encap:Ethernet  HWaddr 00:14:2A:98:3A:F6  
          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::214:2aff:fe98:3af6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16246 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5213 errors:0 dropped:0 overruns:0 carrier:0
          collisions:312 txqueuelen:1000
          RX bytes:2441855 (2.3 MiB)  TX bytes:1206018 (1.1 MiB)
          Interrupt:11 Base address:0xa000

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:6002 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6002 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:7823576 (7.4 MiB)  TX bytes:7823576 (7.4 MiB)

sit0      Link encap:IPv6-in-IPv4  
          NOARP  MTU:1480  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

论坛徽章:
5
IT运维版块每日发帖之星
日期:2015-08-06 06:20:00IT运维版块每日发帖之星
日期:2015-08-10 06:20:00IT运维版块每日发帖之星
日期:2015-08-23 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-11-12 06:20:00
5 [报告]
发表于 2007-07-28 18:37 |只看该作者
sh# vi /etc/sysconfig/dhcpd 里面有HCPDARGS=eth0
改成eth1试试。要么把DHCP里的地址段改成192.168.2.0的。

论坛徽章:
0
6 [报告]
发表于 2009-05-19 02:53 |只看该作者
挖坟了。嘿嘿
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
重启机器后:
sh# dhcpd start
]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
问题在这里,应该是service dhcpd start ==〉执行脚本
否则执行程序,start成入参。
证据就是打印

No subnet declaration for [[[[start]]]]]] (no IPv4 addresses).

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP