ISC-DHCP (DHCP) Configuration
In this article, we will describe the steps and procedures required to install and configure ISC-DHCP server on a Linux machine, (specifically Ubuntu 14.04).
Step 1
Installing ISC-DHCP server
To install ISC-DHCP server on Ubuntu 14.04, use the following commands Update Linux files
Update command will fetch the packages from its location and updates them to newer version.
sudo apt-get update
Installs ISC-DHCP Server
sudo apt-get install isc-dhcp-server
Step 2
Configuring ISC-DHCP sever - dhcpd.conf
The ISC-DHCP server configuration file is dhcpd.conf and can be accessed using the following command
sudo nano /etc/dhcp/dhcpd.conf
This command will allow to make changes in the dhcp configuration file "dhcpd.conf" which is at specified path.
We are required to do the following modifications in dhcpd.conf file:
subnet 192.168.3.0 netmask 255.255.255.0 { range 192.168.3.10 192.168.3.45; range 192.168.3.55 192.168.3.60; option routers 192.168.3.1; option broadcast-address 192.168.3.255; default-lease-time 3600; max-lease-time 7200; } option domain-name-servers 192.168.3.51 192.168.3.54; option domain-name "neunetworks.com";
The following command is used to make the DHCP server an authoritative server for local network.
authoritative;
The following command is used to check the syntax of dhcpd.conf file for errors
dhcpd -t
The following command will allow to edit the isc-dhcp-server file, where we can manually determine the interface of the server.
sudo nano /etc/default/isc-dhcp-server
We have to set the interfaces to wlan0 in our file
INTERFACES= "wlan0"
The following line will display the contents of the current routing tables.
ip route
Step 3
Securing DHCP server
The following modifications are done to configuration file to secure the DHCP server
ddns-update-style none; deny declines; deny bootp;
The DoS attack on DHCP server can be avoided by denying the DHCP decline messages and can deny supporting old bootp clients.
Step 4
Restart ISC-DHCP server
Now that the isc-dhcp-server configuration is complete, we need to reload the dhcp server, so that the new configurations can be implemented
sudo service isc-dhcp-server restart sudo service isc-dhcp-server start sudo service isc-dhcp-server stop
Step 5
Verifying..
Inorder to check the leases of the IP addresses assigned by the DHCP
cd /var/lib/dhcp/ ls -l cat dhcpd.leases