{"id":46,"date":"2013-06-05T16:04:31","date_gmt":"2013-06-05T16:04:31","guid":{"rendered":"http:\/\/www.balajibandi.com\/blog\/?p=46"},"modified":"2024-02-04T20:00:31","modified_gmt":"2024-02-04T20:00:31","slug":"how-to-install-and-configure-dhcp-server-on-ubuntu-server-14-10-lts","status":"publish","type":"post","link":"https:\/\/www.balajibandi.com\/?p=46","title":{"rendered":"How to Install and Configure DHCP Server on Ubuntu Server 14.10 LTS"},"content":{"rendered":"<p>This is a guide will explain how to install and configure <strong>dhcp server<\/strong> on Ubuntu Server 14.10 LTS. The Dynamic Host Configuration Protocol (DHCP) is a network service that enables host computers to be automatically assigned settings from a server as opposed to manually configuring each network host. Computers configured to be DHCP clients have no control over the settings they receive from the <em>DHCP server<\/em>, and the configuration is transparent to the computer\u2019s user.<\/p>\n<p>The most common settings provided by a DHCP server to DHCP clients include <em>IP address and netmask, IP address of the default-gateway to use and \u00a0IP adresses of the DNS servers to use.<\/em>DHCP server can also supply configuration properties such as: <em>Host Name, Domain Name, Time Server and \u00a0Print Server\u00a0<\/em><\/p>\n<p>Follow the step-by-step installing and configure DHCP Server on\u00a0Ubuntu Server 14.10 LTS<\/p>\n<p>On this case I\u2019ll using Ethernet device: eth0 with :<\/p>\n<ul>\n<li>IP Address range: 192.168.2.10 \u2013 192.168.2.20<\/li>\n<li>Subnet address: 192.168.2.0<\/li>\n<li>Netmask: 255.255.255.0<\/li>\n<li>Domain: preciseserver.public<\/li>\n<li>Gateway Address: 192.168.2.1<\/li>\n<li>Broadcast Address: 192.168.2.255<\/li>\n<li>DNS Servers: 208.67.222.222 and 208.67.220.220 (OpenDNS )<\/li>\n<\/ul>\n<p><strong>Step 1.<\/strong> install DHCP server package<\/p>\n<pre><strong>sudo apt-get install isc-dhcp-server<\/strong><\/pre>\n<p><strong>Step 2.\u00a0<\/strong>Editing file\u00a0<em>\/etc\/default\/isc-dhcp-server<\/em><\/p>\n<pre><strong>sudo nano\u00a0\/etc\/default\/isc-dhcp-server<\/strong><\/pre>\n<p>On line 11 of this file (Which is actually the last line because this file is basically empty) you will see the line:<\/p>\n<p>INTERFACES=\u201d\u201d<\/p>\n<p>Change this line to read:<\/p>\n<p>INTERFACES=\u201deth0\u2033<\/p>\n<pre># Defaults for dhcp initscript<\/pre>\n<pre># sourced by \/etc\/init.d\/dhcp\n# installed at \/etc\/default\/isc-dhcp-server by the maintainer scripts<\/pre>\n<pre>#\n# This is a POSIX shell fragment\n#<\/pre>\n<pre># On what interfaces should the DHCP server (dhcpd) serve DHCP requests?\n# Separate multiple interfaces with spaces, e.g. \"eth0 eth1\".\nINTERFACES=<strong>\"eth0\"<\/strong><\/pre>\n<p>Save and exit<\/p>\n<p><strong>Step 3. Editing file\u00a0<\/strong>\/etc\/dhcp\/dhcpd.conf<\/p>\n<p>create backup\u00a0\/etc\/dhcp\/dhcpd.conf<\/p>\n<pre><strong>sudo mv\u00a0\/etc\/dhcp\/dhcpd.conf\u00a0\/etc\/dhcp\/dhcpd.conf.original<\/strong><\/pre>\n<p>Login as root<\/p>\n<pre><strong>sudo -i<\/strong><\/pre>\n<p>Create configuration file dhcpd.conf:<\/p>\n<pre><strong>cat &gt; \/etc\/dhcp\/dhcpd.conf &lt;&lt;-EOF<\/strong>\n<strong>option domain-name \"preciseserver.public\";<\/strong>\n<strong>option domain-name-servers ns1.preciseserver.public, ns2.preciseserver.public;<\/strong><\/pre>\n<pre><strong>default-lease-time 600;<\/strong>\n<strong>max-lease-time 7200;<\/strong><\/pre>\n<pre><strong>subnet 192.168.2.0 netmask 255.255.255.0 {<\/strong>\n<strong>range 192.168.2.10 192.168.2.20;<\/strong>\n<strong>option domain-name-servers 208.67.222.222, 208.67.220.220;<\/strong>\n<strong>option domain-name \"serv.preciseserver.public\";<\/strong>\n<strong>option routers 192.168.2.1;<\/strong>\n<strong>option broadcast-address 192.168.2.255;<\/strong>\n<strong>default-lease-time 600;<\/strong>\n<strong>max-lease-time 7200;<\/strong>\n<strong>}<\/strong>\n<strong>EOF<\/strong><\/pre>\n<p><strong>Step 4.<\/strong> restart dhcp server<\/p>\n<pre><strong>sudo service isc-dhcp-server restart<\/strong><\/pre>\n<p><strong>Setup Dhcp Client on Ubuntu<\/strong><\/p>\n<p>To setup dhcp client on ubuntu open <em>System Setting \u2013 Hardware \u2013 Network \u00a0\u2013 Select wired \u2013 Option \u2013 IPv4 Setting \u2013 On Method dropdown and select Automatic (DHCP)<\/em><\/p>\n<p><strong>Setup Dhcp Client on Windows<\/strong><\/p>\n<p>Control Panel \u2013 Network Connection \u2013 Right Click \u201cLocal Area Connection\u201d \u2013 Properties \u2013 Tag General \u2013 Double Click \u201cInternet Protocol (TCP\/IP\u201d \u2013 Select \u201cObtain an IP address automatically\u201d and \u201cObtain DNS Server address automatically\u201d<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a guide will explain how to install and configure dhcp server on Ubuntu Server 14.10 LTS. The Dynamic Host Configuration Protocol (DHCP) is a network service that enables host computers to be automatically assigned settings from a server as opposed to manually configuring each network host. Computers configured to be DHCP clients have [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-46","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/46","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=46"}],"version-history":[{"count":3,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/46\/revisions"}],"predecessor-version":[{"id":2071,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/46\/revisions\/2071"}],"wp:attachment":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}