Tuesday, November 1, 2011

DHCP Server on Debian


With the Dynamic Host Configuration Protocol (DHCP) the computers within the network can get the required information to connect to the internet (IP Address, Gateway Address, DNS Server address and others)


On a Debian machine, it's quite simple to setup and configure a DHCP server:


1- Installation
apt-get install isc-dhcp-server
2- Configuration


The configuration file for a dhcp-server is /etc/dhcp/dhcpd.conf, edit it as follows: 
- Choose whatever domain name you like ex. home.local:
option domain-name "home.local";
- Define the DNS servers to use, you can use your private DNS server or any public one like the 8.8.8.8 or 4.2.2.4:
option domain-name-servers 8.8.8.8, 4.2.2.4; 
- Define the gateway IP address:
option routers 192.168.1.1;
- Define the range of addresses that will be distributed by the DHCP server :
subnet 192.168.1.0 netmask 255.255.255.0 {range 192.168.1.50 192.168.1.100;}
- To assign a fixed address to a particular machine (WebServer):
host WebServer{hardware ethernet 00:0D:87:B3:AE:A6;fixed-address 192.168.1.55;}
where  00:0D:87:B3:AE:A6 is the MAC address of the WebServer machine and 192.168.1.55 is the required IP address to be assigned.


HINTS: 
  1. Start the server by /etc/init.d/isc-dhcp-server start to take effect.
  2. Don't forget to edit the /etc/default/isc-dhcp-server file for INTERFACES="eth0" where eth0 is the interface through which to accept DHCP requests from clients.

Source Link: http://wiki.debian.org/DHCP_Server

No comments:

Post a Comment