Debian – Can’t bind isc-dhcp-server to interface

debiandhcpdhcp-serverisc-dhcp

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

Best Answer

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: