isc-DHCP in multi-homed servers
Posted: Tue Jun 12, 2012 12:59 pm
Here's an important tip when running a DHCP server (isc-dhcp-server on Debian) on a machine which is connected to several, physically-separated, networks:
In order to tell you dhcpd to which interfaces to listen to, edit the file "/etc/default/isc-dhcp-server" and add your DHCP-served interface names to the variable "INTERFACES".
For example, if you have 3 network cards in one computer: eth0, eth1 and eth2 - and you'd only like to serve DHCP-requests on eth1, edit the line as follows:
And verify that the changes got applied, by looking at the dhcpd process, using "ps aux":
This should return something like this:
Voila!
In order to tell you dhcpd to which interfaces to listen to, edit the file "/etc/default/isc-dhcp-server" and add your DHCP-served interface names to the variable "INTERFACES".
For example, if you have 3 network cards in one computer: eth0, eth1 and eth2 - and you'd only like to serve DHCP-requests on eth1, edit the line as follows:
Then restart the dhcp-daemon:INTERFACES="eth1"
Code: Select all
/etc/init.d/isc-dhcp-server restart
Code: Select all
ps aux | grep dhcpd
As you can see, the "eth1" commandline argument shows that the DHCP-server is only listening to "eth1".root 22964 0.0 0.0 4232 2056 ? Ss 12:45 0:00 /usr/sbin/dhcpd -q eth1
Voila!
