DilOS platformHow to configure ISC DHCP server

How to configure ISC DHCP server

The Dynamic Host Configuration Protocol (DHCP) is a network protocol used to assign IP addresses and provide configuration information to devices such as servers, desktops, or mobile devices, so they can communicate on a network using the Internet Protocol (IP).

Step-by-step guide

Install the package using apt-get tool.

Installing the package
root@dilos:~# apt install isc-dhcp-server

Edit the configuration file /etc/dhcp/dhcpd.conf for IPv4 or /etc/dhcp/dhcpd6.conf for IPv6.

IPv4 example
# A slightly different configuration for an internal subnet.
subnet netmask {
  option subnet-mask;
  option domain-name-servers;
#  option domain-name "internal.example.org";
  option routers;
  option broadcast-address;
  default-lease-time 600;
  max-lease-time 7200;

Edit the configuration file /etc/default/isc-dhcp-server for IPv4 or for IPv6. Find out the name of the network interface - ifconfig. Now you can run the server:

# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).

# Additional options to start dhcpd with.
#       Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".

starting the service
root@dilos:~# svcadm enable isc-dhcp-server

Check the result by svcs tool:

Checking problem services
root@dilos:~# svcs -xv

That means the service works, and you may relax (wink)

If you see some services in the output of svcs -xv, this means the services were configured incorrect. Check their configuration files and then try to do command svcadm clear service