首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >无法启动isc-dhcp-服务器,因为错误:未配置为侦听任何接口!

无法启动isc-dhcp-服务器,因为错误:未配置为侦听任何接口!
EN

Unix & Linux用户
提问于 2018-01-09 17:54:59
回答 3查看 27.8K关注 0票数 6

我尝试用hostapd和isc-dhcpd设置wifi接入点,但是dhcp服务器不能工作。conf文件与我在本教程中找到的相同:Hostapd : Linux创建虚拟Wifi访问点的方法

!!!我仍然有问题,我已经阅读了文档和手册页.!!

这是当我想用命令"systemctl start isc-dhcp-server.service“或"service isc-dhcp-server start”启动它时收到的错误消息。

代码语言:javascript
运行
复制
Job for isc-dhcp-server.service failed because the control process exited with error code.
See "systemctl status isc-dhcp-server.service" and "journalctl -xe" for details.

这是命令"systemctl status isc-dhcp-server.service“的输出:

代码语言:javascript
运行
复制
root@l0calh0st:~# systemctl status isc-dhcp-server.service
● isc-dhcp-server.service - LSB: DHCP server
   Loaded: loaded (/etc/init.d/isc-dhcp-server; generated; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2018-01-09 18:23:07 CET; 3s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3831 ExecStart=/etc/init.d/isc-dhcp-server start (code=exited, status=1/FAILURE)

    Jan 09 18:23:05 l0calh0st dhcpd[3842]: bugs on either our web page at www.isc.org or in the README file
    Jan 09 18:23:05 l0calh0st dhcpd[3842]: before submitting a bug.  These pages explain the proper
    Jan 09 18:23:05 l0calh0st dhcpd[3842]: process and the information we find helpful for debugging..
    Jan 09 18:23:05 l0calh0st dhcpd[3842]: 
    Jan 09 18:23:05 l0calh0st dhcpd[3842]: exiting.
    Jan 09 18:23:07 l0calh0st isc-dhcp-server[3831]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
    Jan 09 18:23:07 l0calh0st isc-dhcp-server[3831]:  failed!
    Jan 09 18:23:07 l0calh0st systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
    Jan 09 18:23:07 l0calh0st systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
    Jan 09 18:23:07 l0calh0st systemd[1]: Failed to start LSB: DHCP server.

这是etc/dhcp/dhcpd.conf文件:

代码语言:javascript
运行
复制
ddns-update-style none;
ignore client-updates;
authoritative;
option local-wpad code 252 = text;

subnet
10.0.0.0 netmask 255.255.255.0 {
# --- default gateway
option routers
10.0.0.1;
# --- Netmask
option subnet-mask
255.255.255.0;
# --- Broadcast Address
option broadcast-address
10.0.0.255;
# --- Domain name servers, tells the clients which DNS servers to use.
option domain-name-servers
10.0.0.1, 8.8.8.8, 8.8.4.4;
option time-offset
0;
range 10.0.0.3 10.0.0.13;
default-lease-time 1209600;
max-lease-time 1814400;
}

这是/etc/default/isc-dhcp-server文件:

代码语言:javascript
运行
复制
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid

# Additional options to start dhcpd with.
#   Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#   Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="wlan0"
INTERFACESv6=""

这是/etc/网络/接口文件:(我不知道这是否重要)

代码语言:javascript
运行
复制
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback


auto wlan0
iface wlan0 inet static
  address 10.0.0.14
  netmask 255.255.255.0

“日志-xe”的输出

代码语言:javascript
运行
复制
Jan 09 19:59:50 l0calh0st dhcpd[4303]: 
Jan 09 19:59:50 l0calh0st dhcpd[4303]: 
Jan 09 19:59:50 l0calh0st dhcpd[4303]: Not configured to listen on any interfaces!
Jan 09 19:59:50 l0calh0st dhcpd[4303]: 
Jan 09 19:59:50 l0calh0st dhcpd[4303]: If you think you have received this message due to a bug rather
Jan 09 19:59:50 l0calh0st dhcpd[4303]: than a configuration issue please read the section on submitting
Jan 09 19:59:50 l0calh0st dhcpd[4303]: bugs on either our web page at www.isc.org or in the README file
Jan 09 19:59:50 l0calh0st dhcpd[4303]: before submitting a bug.  These pages explain the proper
Jan 09 19:59:50 l0calh0st dhcpd[4303]: process and the information we find helpful for debugging..
Jan 09 19:59:50 l0calh0st dhcpd[4303]: 
Jan 09 19:59:50 l0calh0st dhcpd[4303]: exiting.
Jan 09 19:59:52 l0calh0st isc-dhcp-server[4298]: Starting ISC DHCPv4 server: dhcpdcheck syslog for diagnostics. ... failed!
Jan 09 19:59:52 l0calh0st isc-dhcp-server[4298]:  failed!
Jan 09 19:59:52 l0calh0st systemd[1]: isc-dhcp-server.service: Control process exited, code=exited status=1
Jan 09 19:59:52 l0calh0st systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.
Jan 09 19:59:52 l0calh0st systemd[1]: Failed to start LSB: DHCP server.
-- Subject: Unit isc-dhcp-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit isc-dhcp-server.service has failed.

ifconfig输出:

代码语言:javascript
运行
复制
root@l0calh0st:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.101  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 2003:50:ad02:a21:d455:ca81:501e:727a  prefixlen 64  scopeid 0x0<global>
        inet6 fe80::da92:2698:1cc8:40d  prefixlen 64  scopeid 0x20<link>
        ether 40:8d:5c:52:43:f4  txqueuelen 1000  (Ethernet)
        RX packets 10328  bytes 4043207 (3.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 9033  bytes 1272064 (1.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  memory 0xdf200000-df220000  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Lokale Schleife)
        RX packets 286  bytes 18370 (17.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 286  bytes 18370 (17.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether da:a6:21:bc:a3:11  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

!!!我仍然有问题,我已经阅读了文档和手册页.!!

EN

回答 3

Unix & Linux用户

发布于 2018-01-09 19:59:51

信息Not configured to listen on any interfaces!是你的线索。

启动isc-dhcp-server时,它将不会启动,除非有一个配置为位于您的服务将传递地址的子网(S)上的网络设备。

因此,您需要编辑/etc/network/interfaces并进行适当的更改,以便您的wlan0接口在10.0.0.0/24子网中有一个地址,该地址不在您的租约池的范围内(10.0.0.3-10.0.13基于上面的配置文件)。一旦您可以打开wlan0接口wtih,一个10.0.0.xIP,那么(重新)启动isc-dhcp-server守护进程就可以了。

票数 4
EN

Unix & Linux用户

发布于 2019-07-31 03:01:11

只需使用以下命令在wlan NIC上添加一个ip地址

代码语言:javascript
运行
复制
    ifconfig wlan0 10.0.0.1
票数 0
EN

Unix & Linux用户

发布于 2019-08-12 16:30:15

我也有同样的问题,对我起作用的是添加eth0-this是我的网络接口的名称-子网作为dhcpd.conf文件中的子网声明。

在您的例子中,子网声明应该是:

代码语言:javascript
运行
复制
subnet 10.0.0.0 netmask 255.255.255.0 {
    option routers 10.0.0.14;
}
票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/415888

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档