Friday, March 12, 2010

Bookmark and Share

October 1, 2009 by Ivan  

[HowTo] Install DHCP Server On Ubuntu

To complete my guide “How To Install And Configure Squid as Transparent Proxy“, you will need a DHCP server installed on the server as well. So all of your client will have the same gateway point to Squid Server. In my case i installed Proxy server (Squid) and DHCP server is on the same machine. But if you want to install in separate machine, you still can use this tutorial. The use of DHCP here is to point all of your client gateway to proxy server so the squid can work properly.

I have a case example like this: i have a PC as a router that i installed squid proxy and dhcp server. My PC have 2 network cards eth0 connect to local Lan, and eth1 connect to a modem that connect to the Internet. My eth0 address is 172.16.144.1 (this would be the gateway ip). Ok now let’s start install a dhcp server, folow this steps:
1. Open your terminal and type this command:

sudo apt-get install dhcp3-server


2. Open file /etc/default/dhcp3-server with this command:

vim /etc/default/dhcp3-server

Find this line INTERFACES=”eth0?
Change that line according to your network card, in my case it is eth0 so i don’t have to change that.
3. Open file /etc/dhcp3/dhcpd.conf with this command:

vim /etc/dhcp3/dhcpd.conf

Make the configuration like below:

subnet 172.16.144.0 netmask 255.255.255.0 {
range 172.16.144.100 172.16.144.200;
option domain-name-servers 172.16.144.1;
option domain-name "yourdomain.com";
option routers 172.16.144.1;
option subnet-mask 255.255.255.0;
option broadcast-address 172.16.144.255;
default-lease-time 21600;
max-lease-time 43200;
}

Save the file and close.
4. Restart your dhcp server with this command:

/etc/init.d/dhcp3-server restart

It’s done, now test your client. And see if your client computer can get the ip from the dhcp and also test if the proxy server function properly. Cheers and Good luck.

Bookmark and Share

Related Post(s)

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!