大网数据广告活动
服务器运维问答

Can't bind isc-dhcp-server to interface

· 52CE 我爱测

OS: Debian Wheezy DHCP Server: isc-dhcp-server 4.2.2 I need dhcpd to listen to the specific interface on a machine with 2 active NICs. I added INTERFACES="eth5" to /etc/default/isc-dhcp-server but dhcpd still listens to all inter…

问题原文

原帖链接 · Vladimir M. · CC BY-SA 3.0

OS: Debian Wheezy

DHCP Server: isc-dhcp-server 4.2.2

I need dhcpd to listen to the specific interface on a machine with 2 active NICs. I added INTERFACES="eth5" to /etc/default/isc-dhcp-server but dhcpd still listens to all interfaces:

root@server:~# netstat -46lpn | grep dhcp
udp        0      0 0.0.0.0:67              0.0.0.0:*                           3229/dhcpd
udp        0      0 0.0.0.0:2174            0.0.0.0:*                           3229/dhcpd
udp6       0      0 :::56980                :::*                                3229/dhcpd
raw        0      0 0.0.0.0:1               0.0.0.0:*               7           3229/dhcpd

已采纳解答

原帖链接 · Zoredache · CC BY-SA 3.0

The ISC DHCP server will only work when it binds to the all zeros address. Keep in mind that the DHCP server must communicate with clients that have no IP address, so binding to the IP associated with a specific interface doesn't make a lot of sense.

man dhcpd.conf

The local-address statement local-address address; This statement causes the DHCP server to listen for DHCP requests sent to the specified address, rather than requests sent to all addresses. Since serving directly attached DHCP clients implies that the server must respond to requests sent to the all-ones IP address, this option cannot be used if clients are on directly attached networks...it is only realistically useful for a server whose only clients are reached via unicasts, such as via DHCP relay agents.

Note: This statement is only effective if the server was compiled using the USE_SOCKETS #define statement, which is default on a small number of operating systems, and must be explicitly chosen at compile-time for all others. You can be sure if your server is compiled with USE_SOCKETS if you see lines of this format at startup:

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-11-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。