我的机器情况:ubuntu12.04 server,两块网卡eth0和eth1.输入ifcong后如下显示:
zsqz@dhcp:~$ ifconfig
eth0 Link encap:以太网 硬件地址 00:15:60:0e:69:ae
inet 地址:10.2.6.3 广播:10.2.6.255 掩码:255.255.255.0
inet6 地址: fe80::215:60ff:fe0e:69ae/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 跃点数:1
接收数据包:8943 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:4748 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:4624010 (4.6 MB) 发送字节:624577 (624.5 KB)
中断:28
eth1 Link encap:以太网 硬件地址 00:15:60:0e:69:ad
UP BROADCAST MULTICAST MTU:1500 跃点数:1
接收数据包:0 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:0 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:1000
接收字节:0 (0.0 B) 发送字节:0 (0.0 B)
中断:29
lo Link encap:本地环回
inet 地址:127.0.0.1 掩码:255.0.0.0
inet6 地址: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 跃点数:1
接收数据包:864 错误:0 丢弃:0 过载:0 帧数:0
发送数据包:864 错误:0 丢弃:0 过载:0 载波:0
碰撞:0 发送队列长度:0
接收字节:73521 (73.5 KB) 发送字节:73521 (73.5 KB)
我按照论坛中的方法,通过命令
sudo apt-get install dhcp3-server
安装了dhcpserver软件,然后更改默认监听网卡:
sudo gedit /etc/default/isc-dhcp-server,并修改 INTERFACES="eth0"。
接着sudo gedit /etc/dhcp/dhcpd.conf,修改具体dhcp配置如下:
#--------------7段开始--------------------
subnet 10.2.7.0 netmask 255.255.255.0 {
range 10.2.7.5 10.2.7.9;
range 10.2.7.20 10.2.7.200;
option domain-name-servers 202.96.128.86,202.96.128.166,202.96.128.66;
# option domain-name "internal.example.org";
option routers 10.2.7.254;
# option broadcast-address 10.5.5.31;
default-lease-time 86400;
max-lease-time 259200;
}
#--------固定保留IP地址列表--------
host FanTang1 {
#饭堂1
hardware ethernet 00:e0:4c:39:5e:66;
fixed-address 10.2.7.144;
}
host noname71 {
#noname
hardware ethernet 00:e0:4c:36:00:10;
fixed-address 10.2.7.6;
}
host FanTangMaiPiao {
#饭堂卖饭票
hardware ethernet 00:e0:4c:14:a4:fb;
fixed-address 10.2.7.201;
}
host XinFanTang2 {
#新饭堂2
hardware ethernet 00:21:97:c4:97:16;
fixed-address 10.2.7.56;
}
#--------------7段结束--------------------
#--------------8段开始--------------------
subnet 10.2.8.0 netmask 255.255.254.0 {
range 10.2.8.1 10.2.8.240;
range 10.2.8.242 10.2.8.253;
range 10.2.9.1 10.2.9.105;
range 10.2.9.107 10.2.9.239;
option domain-name-servers 202.96.128.86,202.96.128.166,202.96.128.66;
# option domain-name "internal.example.org";
option routers 10.2.8.254;
# option broadcast-address 10.5.5.31;
default-lease-time 86400;
max-lease-time 259200;
}
#--------固定保留IP地址列表--------
host GaoYiPrint {
#高一打印机
hardware ethernet 00:16:96:17:eb:f4;
fixed-address 10.2.8.221;
}
host BianJiBu {
#编辑部打印机
hardware ethernet bc:30:5b:b2:7e:67;
fixed-address 10.2.9.99;
}
host DangAnShi {
#档案室
hardware ethernet 00:25:11:c0:ea:a2;
fixed-address 10.2.9.51;
}
host noname2 {
#noname2
hardware ethernet 00:1b:b9:d0:cc:af;
fixed-address 10.2.8.250;
}
host BanGongShiPrint2 {
#2楼办公室打印机
hardware ethernet 78:2b:cb:84:dd:f2;
fixed-address 10.2.9.50;
}
#--------------8段结束--------------------
#--------------10段开始--------------------
subnet 10.2.10.0 netmask 255.255.255.0 {
range 10.2.10.1 10.2.10.29;
range 10.2.10.41 10.2.10.253;
option domain-name-servers 202.96.128.86,202.96.128.166,202.96.128.66;
# option domain-name "internal.example.org";
option routers 10.2.10.254;
# option broadcast-address 10.5.5.31;
default-lease-time 86400;
max-lease-time 259200;
}
#--------固定保留IP地址列表--------
host BanGongShiPrint4 {
#4楼办公室打印机
hardware ethernet 00:21:97:1e:4d:df;
fixed-address 10.2.10.49;
}
#--------------10段结束--------------------
#--------------18段开始--------------------
subnet 10.2.18.0 netmask 255.255.254.0 {
range 10.2.18.1 10.2.18.249;
range 10.2.19.1 10.2.19.199;
option domain-name-servers 202.96.128.86,202.96.128.166,202.96.128.66;
# option domain-name "internal.example.org";
option routers 10.2.18.254;
# option broadcast-address 10.5.5.31;
default-lease-time 86400;
max-lease-time 86400;
}
#--------固定保留IP地址列表--------
#--------------18段结束--------------------
输入sudo service isc-dhcp-server restart提示
stop: Unknown instance:
isc-dhcp-server start/running, process 2601
输入more /var/log/syslog | grep dhcp,显示如下信息:
Dec 2 09:18:33 dhcp dhcpd: No subnet declaration for eth0 (10.2.6.3).
Dec 2 09:18:33 dhcp dhcpd: ** Ignoring requests on eth0. If this is not what
Dec 2 09:18:33 dhcp dhcpd: you want, please write a subnet declaration
Dec 2 09:18:33 dhcp dhcpd: in your dhcpd.conf file for the network segment
Dec 2 09:18:33 dhcp dhcpd: to which interface eth0 is attached. **
Dec 2 09:18:33 dhcp dhcpd:
Dec 2 09:18:33 dhcp dhcpd:
Dec 2 09:18:33 dhcp dhcpd: Not configured to listen on any interfaces!
Dec 2 09:18:33 dhcp dhcpd: Internet Systems Consortium DHCP Server 4.1-ESV-R4
Dec 2 09:18:33 dhcp dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Dec 2 09:18:33 dhcp dhcpd: All rights reserved.
Dec 2 09:18:33 dhcp dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 2 09:18:33 dhcp dhcpd: Internet Systems Consortium DHCP Server 4.1-ESV-R4
Dec 2 09:18:33 dhcp dhcpd: Copyright 2004-2011 Internet Systems Consortium.
Dec 2 09:18:33 dhcp dhcpd: All rights reserved.
Dec 2 09:18:33 dhcp dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Dec 2 09:18:33 dhcp dhcpd: Wrote 0 deleted host decls to leases file.
Dec 2 09:18:33 dhcp dhcpd: Wrote 0 new dynamic host decls to leases file.
Dec 2 09:18:33 dhcp dhcpd: Wrote 0 leases to leases file.
Dec 2 09:18:33 dhcp dhcpd:
Dec 2 09:18:33 dhcp dhcpd: No subnet declaration for eth0 (10.2.6.3).
Dec 2 09:18:33 dhcp dhcpd: ** Ignoring requests on eth0. If this is not what
Dec 2 09:18:33 dhcp dhcpd: you want, please write a subnet declaration
Dec 2 09:18:33 dhcp dhcpd: in your dhcpd.conf file for the network segment
Dec 2 09:18:33 dhcp dhcpd: to which interface eth0 is attached. **
Dec 2 09:18:33 dhcp dhcpd:
Dec 2 09:18:33 dhcp dhcpd:
Dec 2 09:18:33 dhcp dhcpd: Not configured to listen on any interfaces!
dhcp客户端也无法获取ip地址。
请求懂行的朋友帮忙排除故障。谢谢。
ps:
原来用的是win2003server做dhcp服务器的,可是那台机器总是经常出问题,所以想利用ubuntu做一个dhcp服务器。
由于我的服务器ip地址段较多,而且其中某些ip地址段还需要分小段并保留部分ip,因此,其中出现了一些特殊的range。
我的安装方法及过程参考的这个网页:
http://www.ubuntugeek.com/how-to-instal ... erver.html
ubuntu12.04 server安装dhcp无法成功,请求帮助
-
- 帖子: 14
- 注册时间: 2008-06-09 20:43
-
- 帖子: 1
- 注册时间: 2013-12-04 15:51
- 系统: windows
Re: ubuntu12.04 server安装dhcp无法成功,请求帮助
日志提示没有监听到任何请求,你的网络拓扑应该是核心交换机连接不同子网,DHCP服务器是在其中一个子网(10.2.6.0)吧,那么在核心交换机中应该做了DHCP中继也指定了DHCP服务器的IP,2种方法解决
一、把核心交换机中指定的DHCP服务器IP改为10.2.6.3(即Ubuntu机子)
二、把Ubuntu机子的IP改为核心交换机中指定的DHCP服务器IP(win2003机子的IP就要修改或断线)
还有把8、9网段分开写区网声明
一、把核心交换机中指定的DHCP服务器IP改为10.2.6.3(即Ubuntu机子)
二、把Ubuntu机子的IP改为核心交换机中指定的DHCP服务器IP(win2003机子的IP就要修改或断线)
还有把8、9网段分开写区网声明
-
- 帖子: 14
- 注册时间: 2008-06-09 20:43
Re: ubuntu12.04 server安装dhcp无法成功,请求帮助
第一点中我已经在核心交换机中改过了的。第二点,请问是否将这一段ps_chen 写了:日志提示没有监听到任何请求,你的网络拓扑应该是核心交换机连接不同子网,DHCP服务器是在其中一个子网(10.2.6.0)吧,那么在核心交换机中应该做了DHCP中继也指定了DHCP服务器的IP,2种方法解决
一、把核心交换机中指定的DHCP服务器IP改为10.2.6.3(即Ubuntu机子)
二、把Ubuntu机子的IP改为核心交换机中指定的DHCP服务器IP(win2003机子的IP就要修改或断线)
还有把8、9网段分开写区网声明
#--------------8段开始--------------------
subnet 10.2.8.0 netmask 255.255.254.0 {
range 10.2.8.1 10.2.8.240;
range 10.2.8.242 10.2.8.253;
range 10.2.9.1 10.2.9.105;
range 10.2.9.107 10.2.9.239;
…………
改为
#--------------8段开始--------------------
subnet 10.2.8.0 netmask 255.255.254.0 {
range 10.2.8.1 10.2.8.240;
range 10.2.8.242 10.2.8.253;
subnet 10.2.8.0 netmask 255.255.254.0 {
range 10.2.9.1 10.2.9.105;
range 10.2.9.107 10.2.9.239;
???????
-
- 帖子: 1
- 注册时间: 2014-01-03 21:55
Re: ubuntu12.04 server安装dhcp无法成功,请求帮助
我也遇到同样问题,关注一下.
楼主如果解决了,请分享一下啊
楼主如果解决了,请分享一下啊
- seabee
- 帖子: 243
- 注册时间: 2006-11-08 13:02