Explain how to configure DHCP Server.

 

  • DHCP (Dynamic Host Configuration Protocol) helps to assign IP addresses to clients in a distributed manner. It is centrally configured server who specifies a range of IPs to be allotted to connected clients on request. It cannot assign IP to any Ethernet aliases if exists.
  • Following are the steps to configure DHCP Server
    • Verify the software package is installed on your system as follow:
    • $ ps ax | grep dhcp
    • If not already installed, then install on your system as follow:
    • $ sudo apt-get install isc-dhcp-server
    • There are two main files that are probably need to change /etc/dhcp/dhcpd.conf and /etc/default/isc-dhcp-server to specify the interfaces dhcp should listen to.
    • Open the configuration file of dhcp in editor, i.e. /etc/dhcp/dhcpd.conf
    • And perform the following:
      1. Edit the line 'option domain-name' and write your domain name:
      2. option domain-name "example.com"
      3. Edit the line 'option domain-name-servers' and write the name of your name server as shown below, for eg the name is tyit.example.com
      4. option domain-name-servers tyit.example.com;
      5. Edit the line subnet to provide your subnet and netmask inormation as shown below:
      6. subnet 192.168.1.0 netmask 255.255.255.0
      7. Specify the range in which IPs are to be assigned to DHCP clients on request as shown below:
      8. range 192.168.1.150 192.168.1.200;
    • Restart the service of dhcp, as shown below
    • $ sudo service isc-dhcp-server restart
    • Enable dhcp on boot, as shown below
    • $ chkconfig dhcpd on
    • As the server is configured, verify the setup on the client system.