{"id":513,"date":"2012-03-07T15:10:20","date_gmt":"2012-03-07T14:10:20","guid":{"rendered":""},"modified":"2018-11-01T00:51:14","modified_gmt":"2018-10-31T23:51:14","slug":"very-basic-dhcp-server-configuration-under-debian-os","status":"publish","type":"post","link":"https:\/\/nil.uniza.sk\/en\/very-basic-dhcp-server-configuration-under-debian-os\/","title":{"rendered":"A VERY BASIC DHCP server configuration under Debian OS"},"content":{"rendered":"<p>\n\tThis article describes a <u><em><strong>very basic<\/strong><\/em><\/u> configuration of DHCP&nbsp;server (isc-dhcp-server) under Debian OS.<\/p>\n<p>\n\t&nbsp;<\/p>\n<p>\n\tInstalling DHCP server:<\/p>\n<pre>\r\n#apt-get install isc-dhcp-server\r\n<\/pre>\n<p>\n\t*note: package <em>isc-dhcp-server<\/em> replaced the old <em>dhcp3 <\/em>package<\/p>\n<p>\n\t&nbsp;<\/p>\n<p>\n\tWe need to specify the port to bind to. To do this we need to edit the file &quot;<strong>\/etc\/default\/isc-dhcp-server<\/strong>&quot;:<\/p>\n<pre>\r\nINTERFACES=&quot;eth0&quot;\r\n<\/pre>\n<p>\n\tNext and the last thing to do to configure our DHCP server is to specify subnetworks in its configuration file <strong>&quot;\/etc\/dhcp\/dhcpd.conf<\/strong>&quot;. Here is the example of the file:<\/p>\n<pre class=\"cfg\">\r\n#define that the dhcp server is configured correctly and is\r\n#the authoritative served if multiple dhcp servers exist\r\nauthoritative;\r\n&nbsp;\r\n#define the default (if not specified differently for subnet)\r\ndomain for all users\r\noption domain-name &quot;ps1.sk&quot;;\r\n\r\n#define the default (if not specified differently for subnet) dns servers for all users\r\noption domain-name-servers 1.254.0.1;\r\n\r\n#specify the default lease and max lease time&nbsp;\r\ndefault-lease-time 86400;\r\nmax-lease-time 86400;\r\n\r\n#for logging file (set for rsyslog)\r\nlog-facility local7;\r\n&nbsp;\r\n\r\n#DEFINITION&nbsp;OF&nbsp;SUBNETS\r\n\r\nsubnet 1.1.0.0 netmask 255.255.0.0 {\r\n  #lease addresses from this range:\r\n  range 1.1.0.2 1.1.255.254;\r\n  #if DHCP request comes from routers with there addresses (separated by commas): \r\n  option routers 1.1.0.1;             \r\n&nbsp;\r\n  #define subnet specific parameters which will override global parameters, for example:\r\n  #max-lease-time 7200;\r\n\r\n  #you can specify statically mapped IP addresses to MAC addresses like this: &nbsp;\r\n  #  host print_server {\r\n  #    hardware ethernet 00:01:23:e2:d1:22;\r\n  #    fixed-address 1.1.0.2;         \r\n  #}\r\n\r\n  #if you need to specify groups of addresses which you must treat differently (for example different lease time or domain name), you can\r\n  #specify address pools and define their specific values:\r\n  #pool {\r\n  #  range 1.1.0.2 1.1.0.10;\r\n  #  max-lease-time 7200;\r\n  #}\r\n&nbsp;\r\n}\r\n\r\nsubnet 1.2.0.0 netmask 255.255.0.0 {\r\n  range 1.2.0.2 1.2.255.254;\r\n  option routers 1.2.0.1;             \r\n}\r\n\r\n#we need to specify default range for interfaces we are listening on.. \r\n#since we configured our server to listen only on eth0&nbsp;(with IP&nbsp;1.254.0.1),\r\n#we need to scecify:\r\nsubnet 1.254.0.0 netmask 255.255.255.0 {\r\n}\r\n<\/pre>\n<p>\n\tWhen the configuration is done, restart the dhcp server:<\/p>\n<pre>\r\n\/etc\/init.d\/isc-dhcp-server restart\r\n<\/pre>\n<p>\n\tDone \ud83d\ude42<\/p>\n<p>\n\tIf the server is complaining about something, see the &quot;<em>\/var\/log\/syslog<\/em>&quot; for more details.<\/p>","protected":false},"excerpt":{"rendered":"<p>\n\tThis article describes a <u><em><strong>very basic<\/strong><\/em><\/u> configuration of DHCP&nbsp;server (isc-dhcp-server) under Debian OS.<\/p>\n<p>\n\t&nbsp;<\/p>\n<p>\n\tInstalling DHCP server:<\/p>\n<pre>\r\n#apt-get install isc-dhcp-server\r\n<\/pre>\n<p>\n\t*note: package <em>isc-dhcp-server<\/em> replaced the old <em>dhcp3 <\/em>package<\/p>\n<p>\n\t&nbsp;<\/p>\n<p>\n\tWe need to specify the port to bind to. To do this we need to edit the file &quot;<strong>\/etc\/default\/isc-dhcp-server<\/strong>&quot;:<\/p>","protected":false},"author":449,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[685],"tags":[],"class_list":["post-513","post","type-post","status-publish","format-standard","hentry","category-linux_-_howto-en"],"taxonomy_info":{"category":[{"value":685,"label":"Linux - HOWTO"}]},"featured_image_src_large":false,"author_info":{"display_name":"","author_link":"https:\/\/nil.uniza.sk\/en\/author\/"},"comment_info":1,"category_info":[{"term_id":685,"name":"Linux - HOWTO","slug":"linux_-_howto-en","term_group":0,"term_taxonomy_id":683,"taxonomy":"category","description":"","parent":0,"count":71,"filter":"raw","cat_ID":685,"category_count":71,"category_description":"","cat_name":"Linux - HOWTO","category_nicename":"linux_-_howto-en","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/513","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/users\/449"}],"replies":[{"embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/comments?post=513"}],"version-history":[{"count":0,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/posts\/513\/revisions"}],"wp:attachment":[{"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/media?parent=513"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/categories?post=513"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nil.uniza.sk\/en\/wp-json\/wp\/v2\/tags?post=513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}