Data Networking/Fall 2014/Priya/DHCP/configure
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.120; 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;
Reservation
Fixed IP addresses can be assigned to particular clients. Here I have assigned fixed IP addresses to DNS Server, Web server and a host in the network.
host webserver1 { hardware ethernet bc:77:37:b1:19:0d; fixed-address 192.168.3.50; } host dnsserver1 { hardware ethernet 30:10:b3:14:6e:57; fixed-address 192.168.3.51; } host client1 { hardware ethernet 80:86:f2:d5:0e:ad; fixed-address 192.168.3.100; }
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