Ubuntu: Why do I need to specify interface in /etc/default/isc-dhcp-server



Question:

I have been simply using dhcpd *interface* for a long while, and today I found out that in:

https://help.ubuntu.com/community/isc-dhcp-server

it says I'm not only need to specify interface on which server should listen in /etc/default/isc-dhcp-server, but also I shall start dhcpd with a complicated cmd service isc-dhcp-server start.

I searched about those and turns out that some configurations are belong to an old version dhcp3.

So now I'm totally confused, as I can use both two cmds to start a dhcp server; and while I'm using dhcpd *interface*without adding that interface in/etc/default/isc-dhcp-server, every thing still goes well.

So could you guys help me with two questions:

1,which configuration belongs to isc-dhcp, and others to dhcp3, especially that /etc/default/isc-dhcp-server?

2,if I keep using dhcpd *interface*, will it cause any problem in the future?


Solution:1

Using the start up scripts, running dhcpd as a service is in my opinion the best way to run dhcpd. This means the OS handles startup, stopping and restarting as needed during upgrade of packages, and during boot and shutdown. It also means the OS can restart if dhcpd crashes.

This is the standard way of starting services/daemons in Linux, including Debian, RHEL, Ubuntu, OpenSUSE, Fedora and so on.

This does also mean that you have to inform the system which interfaces it should run dhcpd on. This is done, as you already know, with the /etc/defaults/isc-dhcpd file.

I can't see any good reason to run it directly like you've been doing. From time to time I've been running ISC DHCPD in the foreground to do debugging, but that's exceptional cases...

In short: unless you have good reasons not to, do follow the philosophy of the distribution. This also makes it easier for someone taking over. If I were taking over a debian/Ubuntu box with ISC DHCPD, I'd assume it was controlled by systemd, not homemade scripts.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »