Linux 的dhcp启动异常之No subnet declaration for eth1 (192.168.48.134)
来源:互联网 发布:中国产业数据 编辑:程序博客网 时间:2024/06/05 09:14
最近折腾Centos自动化安装,需要Linux的dhcp服务,使用yum -y install dhcp安装dhcp、dhcp-common的rpm包,启动dhcp时异常报错,
由于dhcp是操作系统及服务,关于dhcp启动失败可以查看操作系统日志/var/log/messages,使用service dhcpd start时报错如下:
[root@localhost log]# tail -f messages
May 13 20:30:45 localhost dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
May 13 20:30:45 localhost dhcpd: Copyright 2004-2010 Internet Systems Consortium.
May 13 20:30:45 localhost dhcpd: All rights reserved.
May 13 20:30:45 localhost dhcpd: For info, please visit https://www.isc.org/software/dhcp/
May 13 20:30:45 localhost dhcpd: Not searching LDAP since ldap-server, ldap-port and ldap-base-dn were not specified in the config file
May 13 20:30:45 localhost dhcpd: Wrote 0 leases to leases file.
May 13 20:30:45 localhost dhcpd:
May 13 20:30:45 localhost dhcpd: No subnet declaration for eth1 (192.168.48.134).
May 13 20:30:45 localhost dhcpd: ** Ignoring requests on eth1. If this is not what
May 13 20:30:45 localhost dhcpd: you want, please write a subnet declaration
May 13 20:30:45 localhost dhcpd: in your dhcpd.conf file for the network segment
May 13 20:30:45 localhost dhcpd: to which interface eth1 is attached. **
May 13 20:30:45 localhost dhcpd:
May 13 20:30:45 localhost dhcpd:
May 13 20:30:45 localhost dhcpd: Not configured to listen on any interfaces!
May 13 20:30:45 localhost dhcpd:
May 13 20:30:45 localhost dhcpd: This version of ISC DHCP is based on the release available
May 13 20:30:45 localhost dhcpd: on ftp.isc.org. Features have been added and other changes
May 13 20:30:45 localhost dhcpd: have been made to the base software release in order to make
May 13 20:30:45 localhost dhcpd: it work better with this distribution.
May 13 20:30:45 localhost dhcpd:
May 13 20:30:45 localhost dhcpd: Please report for this software via the CentOS Bugs Database:
May 13 20:30:45 localhost dhcpd: http://bugs.centos.org/
May 13 20:30:45 localhost dhcpd:
May 13 20:30:45 localhost dhcpd: exiting.
针对dhcp启动No subnet declaration for eth的报错,需要排查确认信息:
1、dhcp报错提示的ethn网卡与dhcp配置文件在同一网段确定subnet为192.168.48.0
[root@myserver tftpboot]# cat /etc/dhcpd.conf
ddns-update-style none; #设置DHCP服务器模式
ignore client-updates; #禁止客户端更新
subnet 192.168.48.0 netmask 255.255.255.0 { #设置网段
option routers 192.168.48.254; #设置网关
range 192.168.48.160 192.168.48.200; #设置dhcp服务器IP地址租用的范围
default-lease-time 604800; #默认租约时间
max-lease-time 605800; #最大租约时间
next-server 192.168.48.134; #tftp服务器地址
filename "pxelinux.0"; #tftp服务器根目录下面的文件名
}
[root@myserver tftpboot]#
2、使用vmware虚拟机时,需要注意dhcp配置的subnet在eth0网卡Ip所在网段,并且eth0不能是hostonly,可以是桥接模式或NAT模式,
同时需要在linux主机内ping通vmware自己的网卡Ip地址。
然后,启动dhcp不使用service dhcpd start而使用dhcpd -cf /etc/dhcpd.conf eth1在dhcp启动的时候指定dhcp监听的网卡,
dhcp启动就能正常启动了。
[root@myserver tftpboot]# dhcpd -cf /etc/dhcpd.conf eth1
Internet Systems Consortium DHCP Server 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
he config file
Wrote 2 leases to leases file.
Listening on LPF/eth1/00:0c:29:89:78:3d/192.168.48.0/24
Sending on LPF/eth1/00:0c:29:89:78:3d/192.168.48.0/24
Sending on Socket/fallback/fallback-net
[root@myserver tftpboot]# There's already a DHCP server running.
This version of ISC DHCP is based on the release available
on ftp.isc.org. Features have been added and other changes
have been made to the base software release in order to make
it work better with this distribution.
Please report for this software via the CentOS Bugs Database:
http://bugs.centos.org/
exiting.
[root@myserver tftpboot]# service dhcpd status
dhcpd (pid 2501) is running...
[root@myserver tftpboot]#
如果需要开机自动启动dhcp,这时再使用命令chkconfig dhcp on,可以将dhcpd -cf /etc/dhcpd.conf eth1添加到/etc/rc.local
- Linux 的dhcp启动异常之No subnet declaration for eth1 (192.168.48.134)
- 启动dhcp出错:No subnet declaration for eth0 (192.168.0.1
- dhcpd提示No subnet declaration for eth0的解决方法
- DHCP + Static IP for DHCP server on eth1?
- 计算机网络系列(4)之应用层SubNet and DHCP
- dhcpd 提供多个subnet的dhcp服务时...
- pxe windows img under linux 客户端启动时出现 PXE-E51 "No DHCP or DHCP Proxy Offers received" error
- 异常:No persister for的解决办法
- 异常:No persister for的解决办法
- but no declaration can be found for element 'authentication-manager'的一种解决办法
- 关于"no declaration can be found for element 'mvc:default-servlet-handler"的问题分析
- linux下 eth0变成eth1的原因
- Linux eth0, eth1, ..., eth%d 的生成
- Error:No suitable device found: no device found for connection "System eth1" .
- Linux服务器之DHCP
- no declaration can be found for element 'aop:config'
- no declaration can be found for element mvc resources
- but no declaration can be found for element 'tx:advice'
- MyBatis框架的学习(七)——MyBatis逆向工程自动生成代码
- Torch 的安装与基本用法
- Angular开发(十四)-利用angular的http转发、即代理http 请求,处理项目中请求跨域的问题
- Java网络通信之Socket编程
- VIM 配置 ctags
- Linux 的dhcp启动异常之No subnet declaration for eth1 (192.168.48.134)
- 认识端口与计算机入侵防范
- Android 5.X SVG矢量动画机制——Android群英传
- 将you are from shanghai 以shanghai from are you的形式输出
- 为什么每个人都这样匆忙?
- flex弹性布局
- linux简介
- 2.5>>迷宫
- java基础第一章_常量