【问题标题】:Raspberry Pi isc-dhcp-server: No subnet declaration for eth0 [closed]Raspberry Pi isc-dhcp-server:没有 eth0 的子网声明 [关闭]
【发布时间】:2023-06-08 21:18:01
【问题描述】:

我正在尝试在我的 Raspberry Pi 上设置 DHCP 服务器。我尝试使用以下命令安装它:

sudo apt-get install isc-dhcp-server

并显示以下日志:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
   icelib
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 302 not upgraded.
Need to get 0 B/887 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 61701 files and directories currently installed.)
Preparing to replace isc-dhcp-server 4.2.2.dfsg.1-5+deb70u6 (using .../isc-dhcp-server_4.2.2.dfsg.1-5+deb70u6_armhf.deb) ...
[FAIL] Stopping ISC DHCP server: dhcpd failed!
Unpacking replacement isc-dhcp-server ...
Processing triggers for man-db ...
Setting up isc-dhcp-server (4.2.2.dfsg.1-5+deb70u6) ...
[FAIL] Starting ISC DHCP server: dhcpd[....] check syslog for diagnostics. ... failed!
 failed!
invoke-rc.d: initscript isc-dhcp-server, action "start" failed.

当我打开 /var/log/syslog 文件时,它显示以下几行:

No subnet declaration for th0 (x.x.x.x)
** Ignoring requests on eth0. If this is not what
   you want, please write a subnet declaration 
   In your dhcpd.conf file for the network segment
   to which interface eth0 is attached. **

我是 linux 新手,所以我不知道我的系统出了什么问题,也不知道该去哪里。

感谢您的帮助。

【问题讨论】:

  • 不幸的是,这与Stack Overflow 无关。投票结束
  • @talonmies 你能解释一下为什么跑题了吗?什么会让它成为话题?
  • @rhermans:没有什么能让它成为话题。在树莓派上设置 DHCP 服务器的说明与构建宜家平板电脑桌的说明一样直接与编程相关。

标签: linux raspberry-pi dhcp subnet


【解决方案1】:

作为根,问题:

apt-get install isc-dhcp-server

安装服务器。

然后可以使用位于/etc/dhcp/dhcpd.conf 的配置文件来配置服务器。

【讨论】:

  • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接的答案可能会失效。
  • 是的。我已将最相关的信息从链接到的 pdf 移到实际答案中。谢谢。
  • 一个以前只链接的答案被作者抢救了吗?这是什么魔法?
  • 抢救与否,这个问题仍然公然离题。
最近更新 更多