Linux的dhcp启动异常怎么办


这篇文章主要介绍“Linux的dhcp启动异常怎么办”,在日常操作中,相信很多人在Linux的dhcp启动异常怎么办问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Linux的dhcp启动异常怎么办”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
最近折腾Cento开发云主机域名s自动化安装,需要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 eth2 (1开发云主机域名92.168.48.134).
May 13 20:30:45 localhost dhcpd: ** Ignoring requests on eth2. 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 eth2 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; #禁止客户端更新
subnet192.168.48.0netmask 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 eth2在dhcp启动的时候指定dhcp监听的网卡,
dhcp启动就能正常启动了。
[root@myserver tftpboot]# dhcpd -cf /etc/dhcpd.conf eth2
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/eth2/00:0c:29:89:78:3d/开发云主机域名192.168.48.0/24
Sending on LPF/eth2/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 eth2添加到/etc/rc.local到此,关于“Linux的dhcp启动异常怎么办”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注开发云网站,小编会继续努力为大家带来更多实用的文章!

相关推荐: 云主机修改密码后会自动重启不

这篇文章将为大家详细讲解有关云主机修改密码后会自动重启不,文章内容质量较高,因此小编分享给大家做个参考,希望大家阅读完这篇文章后对相关知识有一定的了解。一般你修改了云主机密码之后,需要自己重新启动主机,系统会有提示,不会自动重启。很多服务商在页面上都已经说明云…

免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 03/24 10:59
下一篇 03/24 10:59

相关推荐