gpt4 book ai didi

ubuntu-server - isc-dhcp-server 状态失败 : Failed with result 'exit code'

转载 作者:行者123 更新时间:2023-12-05 01:59:20 24 4
gpt4 key购买 nike

我使用 isc-dhcp-server 设置了一个简单的 dhcp-server,但是当我启动该服务时,状态为失败并显示消息“失败,结果为‘退出代码’”。

enter image description here

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

enter image description here enter image description here enter image description here

我使用命令 journalctl -ex 检查了更多信息并显示了下一个输入。但是我不知道输入的是什么,因为我配置了接口(interface)和dhcp服务器。

enter image description here

我不知道如何解决这个问题。有人知道在这种情况下要做什么。

最佳答案

这给了我解决方案:

$ sudo su
$ systemctl restart isc-dhcp-server.service
$ systemctl status isc-dhcp-server.service

它仍然像这里一样失败

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 应该不同}

对我来说,它回馈了:

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 中我需要更改

subnet 10.10.10.1 netmask 255.255.255.0

进入

subnet 10.10.10.0 netmask 255.255.255.0

所以 10.10.10.1 变成 10.10.10.0

$ systemctl restart isc-dhcp-server.service
$ systemctl status isc-dhcp-server.service

现在我开始工作了:

Active: active (running) since Thu 2021-06-17 11:50:51 CEST; 2s ago

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

您似乎缺少一个子网。我正在使用这个

[...]
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 服务器的一部分。

关于ubuntu-server - isc-dhcp-server 状态失败 : Failed with result 'exit code' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67928140/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com