日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux虚拟机dhcp启动失败,Linux 的dhcp启动异常之No subnet declaration for eth1 (192.168.48.134)...

發(fā)布時間:2023/12/10 linux 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux虚拟机dhcp启动失败,Linux 的dhcp启动异常之No subnet declaration for eth1 (192.168.48.134)... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

最近折騰Centos自動化安裝,需要的dhcp服務(wù),使用yum -y install dhcp安裝dhcp、dhcp-common的rpm包,啟動dhcp時異常報錯,

由于dhcp是及服務(wù),關(guān)于dhcp啟動失敗可以查看操作系統(tǒng)日志/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

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:

May 13 20:30:45 localhost dhcpd:

May 13 20:30:45 localhost dhcpd: exiting.

針對dhcp啟動No subnet declaration for eth的報錯,需要排查確認(rèn)信息:

1、dhcp報錯提示的ethn網(wǎng)卡與dhcp配置文件在同一網(wǎng)段確定subnet為192.168.48.0

[root@myserver tftpboot]# cat /etc/dhcpd.conf

ddns-update-style none; #設(shè)置DHCP服務(wù)器模式

ignore client-updates; #禁止客戶端更新

subnet?192.168.48.0?netmask 255.255.255.0 { #設(shè)置網(wǎng)段

option routers 192.168.48.254; #設(shè)置網(wǎng)關(guān)

range ?192.168.48.160 192.168.48.200; #設(shè)置dhcp服務(wù)器IP地址租用的范圍

default-lease-time 604800; #默認(rèn)租約時間

max-lease-time 605800; #最大租約時間

next-server 192.168.48.134; #tftp服務(wù)器地址

filename "pxelinux.0"; #tftp服務(wù)器根目錄下面的文件名

}

[root@myserver tftpboot]#

2、使用vmware虛擬機時,需要注意dhcp配置的subnet在eth0網(wǎng)卡Ip所在網(wǎng)段,并且eth0不能是hostonly,可以是橋接模式或NAT模式,

同時需要在linux主機內(nèi)ping通vmware自己的網(wǎng)卡Ip地址。

然后,啟動dhcp不使用service dhcpd start而使用dhcpd -cf /etc/dhcpd.conf eth1在dhcp啟動的時候指定dhcp監(jiān)聽的網(wǎng)卡,

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

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:

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

總結(jié)

以上是生活随笔為你收集整理的linux虚拟机dhcp启动失败,Linux 的dhcp启动异常之No subnet declaration for eth1 (192.168.48.134)...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。