Monday, June 6, 2011

Configuration DHCP-Server in Linux Debian





DHCP (Dynamic Host Configuration Protocol) is protocol-based client / server architecture that is used to facilitate the allocation of IP addresses in one network. A local network that does not use DHCP to give IP addresses to all computers manually. If DHCP is installed on the local network, all computers that are connected in a network will get an IP address automatically from a DHCP server. In addition to IP addresses, many network parameters that may be provided by DHCP, such as default gateway and DNS server.

Example Configuration :
eth0 connected to an ADSL Modem or WiFi with Default-Gw 192.168.137.1
eth1 connected to local network / internet client
setting eth0 with IP-address 192.168.137.2 and the IP address for eth1 (local) 10.11.12.1,  
subnet mask to 255.255.255.0
Range For DHCP-Server is 10.11.12.100 - 10.11.12.150

Root@pasca:~# nano /etc/network/interfaces
     auto eth0
     iface eth0 inet static
     address 192.168.137.2
     netmask 255.255.255.0
     gateway 192.168.137.1

     auto eth1
     iface eth1 inet static
     address 10.11.12.1
     netmask 255.255.255.0

after the router configuration (BIND9) in debian already run, so follow the Address Range Gateway to create a DHCP Server.

1. First Step, installation of Dhcp3-Server
     Root@pasca:~# apt-get install dhcp3-server

2. The Seconds Step, Configuration file in /etc/dhcp3/dhcpd.conf
     Root@pasca:~# nano /etc/dhcp3/dhcpd.conf

- find the following line:

     # A slightly different configuration for an internal subnet.
     #subnet 10.5.5.0 netmask 255.255.255.224 {
     # range 10.5.5.26 10.5.5.30;
     # option domain-name-servers ns1.internal.example.org;
     # option domain-name “internal.example.org”;
     # option routers 10.5.5.1;
     # option broadcast-address 10.5.5.31;
     # default-lease-time 600;
     # max-lease-time 7200;
     #}

- change the following line into:
      
     # A slightly different configuration for an internal subnet.
     subnet 10.11.12..0 netmask 255.255.255.0 {
     range 10.11.12.100 10.11.12.150 ;
     option domain-name-servers 10.11.12.1;
     option domain-name “Pasca.net”;
     option routers 10.11.12.1;
     option broadcast-address 10.11.12.255;
     default-lease-time 600;
     max-lease-time 7200;
     }

3. The Third Step,  Configuration file in /etc/default/dhcp3-server
      Root@pasca:~# nano /etc/default/dhcp3-server

- find the following line:
     section INTERFACES=" "
- change the following line into:
     section INTERFACES= "eth1"

4. The Fourth Steps, then Restart your DHCP
      Root@pasca:~# /etc/init.d/dhcp3-server restart

InsyaAllah, Tutorial about dhcp3-server is Finished...
Syukron, hopefully useful...

Assalamualaikum

No comments:

Post a Comment