Free WiFi for all : Headlines

Tuesday, April 15, 2008

Linux Router : DHCP Server Tutorial

One of function need to be done by linux router is to give IP address to other computer in the LAN so that they can get IP address automatically. With automatic IP address assign, we do not need to configure it one by one anymore.

To fulfill our need , we must install DHCP server on linux router (Ubuntu distro)

Building DHCP server on Ubuntu is relative easy because most tool already provided in the package.

Install DHCP3-server package with this command:

  • # apt-get install dhcp3-server
Edit DHCP3 server configuration file with this command :
  • # vi /etc/dhcp3/dhcpd.conf
In our configuration , if we want to allocate 192.168.0.110 to 192.168.0.200 automatically make sure in /etc/dhcp3/dhcpd.conf file contain the following command:
  • option domain-name "yourdomain.com"
  • option domain-name-servers 208.67.222.222, 208.67.220.220;
  • subnet 192.168.0.0 netmask 255.255.255.0 {range 192.168.0.110 192.168.0.200 options routers 192.168.0.100;}
Restart DHCP3 Server with this command :
  • # /etc/init.d/dhcp3-server-restart