首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >isc-dhcp-server状态失败:失败,返回结果'exit code‘

isc-dhcp-server状态失败:失败,返回结果'exit code‘
EN

Stack Overflow用户
提问于 2021-06-11 04:36:56
回答 1查看 3.7K关注 0票数 0

我用isc-dhcp-server设置了一个简单的dhcp-server,但当我启动服务时,状态是failed,并显示消息"failed with result 'exit code‘“。

是的,我确实配置了文件/etc/dhcp/dhcp.conf和/etc/default/dhcpd.conf

我使用命令journalctl -ex journalctl -ex the next input检查了更多信息。但我不知道输入内容是什么,因为我配置了接口和dhcp服务器。

我不知道该怎么解决这个问题。有人知道这件事是怎么回事。

EN

Stack Overflow用户

发布于 2021-06-17 17:56:24

这给了我一个解决方案:

代码语言:javascript
运行
复制
$ sudo su
$ systemctl restart isc-dhcp-server.service
$ systemctl status isc-dhcp-server.service

它仍然失败,就像这里

代码语言:javascript
运行
复制
root@wd-Latitude-E6530:/home/wd# systemctl status isc-dhcp-server.service
● isc-dhcp-server.service - ISC DHCP IPv4 server
     Loaded: loaded (/lib/systemd/system/isc-dhcp-server.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2021-06-17 11:29:47 CEST; 56s ago
       Docs: man:dhcpd(8)
    Process: 2167 ExecStart=/bin/sh -ec      CONFIG_FILE=/etc/dhcp/dhcpd.conf;      if [ -f /etc/ltsp/dhcpd.conf ]; then CONFIG_FILE=/etc/ltsp/dhcpd.conf; fi;      [ ->
   Main PID: 2167 (code=exited, status=1/FAILURE)

jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: 
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: If you think you have received this message due to a bug rather
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: than a configuration issue please read the section on submitting
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: bugs on either our web page at www.isc.org or in the README file
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: before submitting a bug.  These pages explain the proper
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: process and the information we find helpful for debugging.
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: 
jun 17 11:29:47 wd-Latitude-E6530 dhcpd[2167]: exiting.
jun 17 11:29:47 wd-Latitude-E6530 systemd[1]: isc-dhcp-server.service: Main process exited, code=exited, status=1/FAILURE
jun 17 11:29:47 wd-Latitude-E6530 systemd[1]: isc-dhcp-server.service: Failed with result 'exit-code'.

检查进程ID;如2167和命令:

$ journalctl _PID=2167 {您的PID应该不同}

对我来说,它回馈了我:

代码语言:javascript
运行
复制
jun 17 11:30:52 wd-Latitude-E6530 sh[2193]: /etc/dhcp/dhcpd.conf line 57: subnet 10.10.10.1 netmask 255.255.255.0: bad subnet number/mask combination.
jun 17 11:30:52 wd-Latitude-E6530 sh[2193]: subnet 10.10.10.1 netmask 255.255.255.0

在/etc/dhcp/dhcpd.conf中,我需要更改

代码语言:javascript
运行
复制
subnet 10.10.10.1 netmask 255.255.255.0

转到

代码语言:javascript
运行
复制
subnet 10.10.10.0 netmask 255.255.255.0

所以10.10.10.1变成了10.10.10.0

代码语言:javascript
运行
复制
$ systemctl restart isc-dhcp-server.service
$ systemctl status isc-dhcp-server.service

现在我让它工作起来:

代码语言:javascript
运行
复制
Active: active (running) since Thu 2021-06-17 11:50:51 CEST; 2s ago

您的问题可能有所不同,但是journalctl _PID=####会给您一些反馈,您可以从那里进行故障排除。

看起来你少了一个子网。我正在用这个

代码语言:javascript
运行
复制
[...]
subnet 10.10.10.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.10.255;
option routers 10.10.10.1;
option domain-name-servers 10.10.10.1;
range 10.10.10.3 10.10.10.250;
if exists user-class and option user-class = "iPXE" {
      filename "boot.ipxe";
  } else {
      filename "undionly.kpxe";

这是我的iPXE服务器的一部分。

票数 1
EN
查看全部 1 条回答
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67928140

复制
相关文章

相似问题

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