{"id":1397,"date":"2012-01-15T11:22:14","date_gmt":"2012-01-15T11:22:14","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?page_id=1397"},"modified":"2012-08-30T12:32:17","modified_gmt":"2012-08-30T11:32:17","slug":"install-dhcp-on-centos-dom0","status":"publish","type":"page","link":"http:\/\/darenmatthews.com\/blog\/?page_id=1397","title":{"rendered":"Install DHCP on CentOS (Dom0)"},"content":{"rendered":"<p>15 JAN 2012 &#8211; INSTALL DHCP SERVER (and configure for Cisco Phone options)<br \/>\nNOTE: The tftp server address at this point was my laptop.\u00a0 This address was subsequently altered to shimla&#8217;s Dom0 interface (eth0) ip address.\u00a0 For information on installing the TFTP server see here: <a href=\"http:\/\/darenmatthews.com\/blog\/?page_id=1404\">http:\/\/darenmatthews.com\/blog\/?page_id=1404<\/a><\/p>\n<p><!--more--><br \/>\ninstall dhcp server:<br \/>\nyum install dhcp<br \/>\n(then edit dhcpd.conf as in example which also use options for Cisco phone to locate tftp server):<\/p>\n<p>[root@shimla ~]# ls \/etc\/dhc*<br \/>\n\/etc\/dhclient-eth0.conf\u00a0 \/etc\/dhcp6c.conf\u00a0 \/etc\/dhcpd.conf<br \/>\nThis is the newly edited dhcpd.conf:<\/p>\n<p>[root@shimla ~]# cat \/etc\/dhcpd.conf<\/p>\n<p>ddns-update-style interim;<br \/>\nignore client-updates;<\/p>\n<p>option voip-tftp-servers code 150 = ip-address;<br \/>\noption voip-tftp-servers 10.10.0.100;<\/p>\n<p>subnet 10.10.0.0 netmask 255.255.0.0 {<br \/>\noption routers\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10.10.0.254;<br \/>\noption subnet-mask\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 255.255.0.0;<br \/>\noption nis-domain\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;&#8221;;<br \/>\noption domain-name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;&#8221;;<br \/>\noption domain-name-servers\u00a0\u00a0\u00a0\u00a0\u00a0 10.10.0.254;<br \/>\noption ntp-servers\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 192.168.0.130;<br \/>\noption tftp-server-name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;10.10.0.100&#8221;;<br \/>\nrange dynamic-bootp 10.10.0.150 10.10.0.175;<br \/>\ndefault-lease-time 3600;<br \/>\nmax-lease-time 7200;<br \/>\n}<br \/>\n[root@shimla ~]#<\/p>\n<p>start dhcp server:<br \/>\n[root@shimla ~]# \/etc\/init.d\/dhcpd start<br \/>\ncheck status:<br \/>\n[root@shimla ~]# \/etc\/init.d\/dhcpd status<br \/>\ndhcpd (pid\u00a0 4982) is running&#8230;<br \/>\n[root@shimla ~]#<\/p>\n<p>View DHCP leases:<br \/>\ncat \/var\/lib\/dhcpd\/dhcpd.leases<br \/>\nexample:<\/p>\n<p>[root@shimla ~]# !ca<br \/>\ncat \/etc\/dhcpd.conf<\/p>\n<p>ddns-update-style interim;<br \/>\nignore client-updates;<\/p>\n<p>option voip-tftp-servers code 150 = ip-address;<br \/>\noption voip-tftp-servers 10.10.0.100;<\/p>\n<p>subnet 10.10.0.0 netmask 255.255.0.0 {<br \/>\noption routers\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10.10.0.254;<br \/>\noption subnet-mask\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 255.255.0.0;<br \/>\noption nis-domain\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;&#8221;;<br \/>\noption domain-name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;&#8221;;<br \/>\noption domain-name-servers\u00a0\u00a0\u00a0\u00a0\u00a0 10.10.0.254;<br \/>\noption ntp-servers\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 192.168.0.130;<br \/>\noption tftp-server-name\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &#8220;10.10.0.100&#8221;;<br \/>\nrange dynamic-bootp 10.10.0.150 10.10.0.175;<br \/>\ndefault-lease-time 3600;<br \/>\nmax-lease-time 7200;<br \/>\n}<br \/>\n[root@shimla ~]#<\/p>\n<p>now edit \/etc\/sysconfig\/dhcpd to make dhcp listen on eth0 (insert this):<br \/>\n[root@shimla init.d]# cat \/etc\/sysconfig\/dhcpd<br \/>\n# Command line options here<br \/>\nDHCPDARGS=eth0<br \/>\n[root@shimla init.d]#<\/p>\n<p>Now make dhcp server start each time CentOS booted into runlevel 5:<\/p>\n<p>[root@shimla ~]# chkconfig dhcpd on<br \/>\n[root@shimla ~]# chkconfig &#8211;list | grep dhcpd<br \/>\ndhcpd\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0:off\u00a0\u00a0 1:off\u00a0\u00a0 2:on\u00a0\u00a0\u00a0 3:on\u00a0\u00a0\u00a0 4:on\u00a0\u00a0\u00a0 5:on\u00a0\u00a0\u00a0 6:off<br \/>\n[root@shimla ~]#<\/p>\n<p>(this starts dhcpd in run level 5)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>15 JAN 2012 &#8211; INSTALL DHCP SERVER (and configure for Cisco Phone options) NOTE: The tftp server address at this point was my laptop.\u00a0 This address was subsequently altered to shimla&#8217;s Dom0 interface (eth0) ip address.\u00a0 For information on installing the TFTP server see here: http:\/\/darenmatthews.com\/blog\/?page_id=1404<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1395,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":[],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages\/1397"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1397"}],"version-history":[{"count":7,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages\/1397\/revisions"}],"predecessor-version":[{"id":1713,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages\/1397\/revisions\/1713"}],"up":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/pages\/1395"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}