当前位置: 技术问答>linux和unix
dhcp 服务配置 启动失败
来源: 互联网 发布时间:2017-04-09
本文导语: 好久没有上来这里闲逛了, 今天做 dhcp 服务实验出了一点小问题, 哪位帅哥美女耐心的帮我看一下, 找出问题在哪里, 感激不尽啊. 有兴趣的也可以挑战一下告诉我你的答案... 某公司管理部门 15 人, 后期新进员...
好久没有上来这里闲逛了, 今天做 dhcp 服务实验出了一点小问题, 哪位帅哥美女耐心的帮我看一下,
找出问题在哪里, 感激不尽啊. 有兴趣的也可以挑战一下告诉我你的答案...
某公司管理部门 15 人, 后期新进员工最多 8 人. 现在需要配置一个 dhcp 服务器, 采用 192.168.1.0 网段. 公司为节约 ip 地址使用和增强部门管理, 给管理部门分配 30 个可用的 ip 地址.
# ipcalc -bmn 192.168.1.0/27
NETMASK=255.255.255.224
BROADCAST=192.168.1.31
NETWORK=192.168.1.0
#
根据上述要求计算可以得到:
网络号为 192.168.1.0, 子网掩码为 255.255.255.224, 广播地址为 192.168.1.31
则有效地址为 192.168.1.1 ~ 192.168.1.30 刚刚好满足上述要求
下面是我自己设置的 ip 地址(设置略),
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:78:E2:A0
inet addr:192.168.1.33 Bcast:192.168.1.255 Mask:
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:98 errors:0 dropped:0 overruns:0 frame:
TX packets:74 errors:0 dropped:0 overruns:0 carrie
collisions:0 txqueuelen:100
RX bytes:13582 (13.2 Kb) TX bytes:11442 (11.1 Kb)
Interrupt:10 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:
TX packets:14 errors:0 dropped:0 overruns:0 carrie
collisions:0 txqueuelen:0
RX bytes:1156 (1.1 Kb) TX bytes:1156 (1.1 Kb)
#
下面是我修改好的配置文件(也许是这个错了...)
# cat /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.224 {
# --- default gateway
option routers 192.168.1.254;
option subnet-mask 255.255.255.224;
option nis-domain "domain.org";
option domain-name "manage.com";
option domain-name-servers 192.168.1.32;
option time-offset -28800; # 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.1.1 192.168.1.30;
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 启动接口
# cat /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS="eth0"
#
下面是 dhcp 网卡地址
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.33
NETMASK=255.255.255.0
#
重启 network 没有问题, 但是重启 dhcpd 出现下面的信息提示:
# service dhcpd start
No subnet declaration for eth0 (192.168.1.33).
** Ignoring requests on eth0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0 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.
对于提示信息, 大概读了一下, 没有找到解决办法, 然后我又认真读了一遍, 还是不知道问题出在哪里啊???
真的好纠结, 我对这个挺感兴趣的, 是我以后的饭碗呢...
谁来帮我解决一下???
还需要什么信息的话联系我, 我会尽快回复的...
谢谢那位大神
找出问题在哪里, 感激不尽啊. 有兴趣的也可以挑战一下告诉我你的答案...
某公司管理部门 15 人, 后期新进员工最多 8 人. 现在需要配置一个 dhcp 服务器, 采用 192.168.1.0 网段. 公司为节约 ip 地址使用和增强部门管理, 给管理部门分配 30 个可用的 ip 地址.
# ipcalc -bmn 192.168.1.0/27
NETMASK=255.255.255.224
BROADCAST=192.168.1.31
NETWORK=192.168.1.0
#
根据上述要求计算可以得到:
网络号为 192.168.1.0, 子网掩码为 255.255.255.224, 广播地址为 192.168.1.31
则有效地址为 192.168.1.1 ~ 192.168.1.30 刚刚好满足上述要求
下面是我自己设置的 ip 地址(设置略),
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:78:E2:A0
inet addr:192.168.1.33 Bcast:192.168.1.255 Mask:
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:98 errors:0 dropped:0 overruns:0 frame:
TX packets:74 errors:0 dropped:0 overruns:0 carrie
collisions:0 txqueuelen:100
RX bytes:13582 (13.2 Kb) TX bytes:11442 (11.1 Kb)
Interrupt:10 Base address:0x2000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:
TX packets:14 errors:0 dropped:0 overruns:0 carrie
collisions:0 txqueuelen:0
RX bytes:1156 (1.1 Kb) TX bytes:1156 (1.1 Kb)
#
下面是我修改好的配置文件(也许是这个错了...)
# cat /etc/dhcpd.conf
ddns-update-style interim;
ignore client-updates;
subnet 192.168.1.0 netmask 255.255.255.224 {
# --- default gateway
option routers 192.168.1.254;
option subnet-mask 255.255.255.224;
option nis-domain "domain.org";
option domain-name "manage.com";
option domain-name-servers 192.168.1.32;
option time-offset -28800; # 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.1.1 192.168.1.30;
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 启动接口
# cat /etc/sysconfig/dhcpd
# Command line options here
DHCPDARGS="eth0"
#
下面是 dhcp 网卡地址
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.33
NETMASK=255.255.255.0
#
重启 network 没有问题, 但是重启 dhcpd 出现下面的信息提示:
# service dhcpd start
No subnet declaration for eth0 (192.168.1.33).
** Ignoring requests on eth0. If this is not what
you want, please write a subnet declaration
in your dhcpd.conf file for the network segment
to which interface eth0 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 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254; #网关,确认设置正确
...
option domain-name-servers 192.168.1.32; #DNS服务器地址,设置错了不能正常解析域名
...
}
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254; #网关,确认设置正确
...
option domain-name-servers 192.168.1.32; #DNS服务器地址,设置错了不能正常解析域名
...
}
|
貌似你的subnet-mask和eth0当中的NETMASK不符合。
把它们设置成一样的,然后dhcp配置当中range那里指定范围。
192.168.1.2~192.168.1.31
把它们设置成一样的,然后dhcp配置当中range那里指定范围。
192.168.1.2~192.168.1.31
|
option routers 192.168.1.254;
我对网络不懂,弱弱的问一句,网关不在网段内能上网么?
你这个网段是0-30
是不是应该设为eth0的地址?但eth0又不在网段内
我对网络不懂,弱弱的问一句,网关不在网段内能上网么?
你这个网段是0-30
是不是应该设为eth0的地址?但eth0又不在网段内
|
其实我也不太明白,只是之前做过类似的实验。。。我也得好好看看网络知识和dhcp的东西了
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。