Here's a small tutorial on how to setup DHCP server in ubuntu . You could install this on the desktop or the server version of ubuntu. It would work with any linux distro. DHCP servers are usually configured on Gateways to give out ip addresses to the clients connected to it either via wired or wireless . So here's how you do it :
Step 1 : Go to the Terminal(Applications->Accessories->Terminal) and type sudo apt-get install dhcp3-server
NOTE : Now for my setup i have 2 interfaces one connected to my DSL router and the other to other machines on my network . So i do not want the DHCP server to listen on the interface connected to the DSL router . for me , eth1 is connected to clients on my network , so first i need to tell the DHCP server to listen to eth1 .
Step 2 : For this , in your terminal type sudo gedit /etc/default/dhcp3-server
Step 3 : Then look for the line INTERFACES=”eth0″ . And replace it with INTERFACES=”eth1″
NOTE: This is how it is for my setup , if you have say eth0 or wlan0 which is connected to clients then change as necessary.
Step 4 : Save the file and close the window
Step 5 : Now back in the terminal type sudo gedit /etc/dhcp3/dhcpd.conf
NOTE : Now again , i have configured my setup to have a gatway ip as 192.168.0.1 and set the DHCP range between 192.168.0.2 to 192.168.0.15 ( this small range is more than enough for me , change as necessary ) .I have also configured DHCP server to give out Opendns server ips as DNS servers.
Step 6 : For the above setup , this is my configuration file , so just replace the existing content with this content ( NOTE: Make necessary changes if you wish , if not , dont worry the default configuration will work )
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.254;
option domain-name-servers 208.67.222.222, 208.67.220.220;
option domain-name “HOME”;
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.15;
}
Step 7 : Once done , save the file and close the window
Step 8 : Now restart DHCP server by typing sudo /etc/init.d/dhcp3-server restart
Step 9 : Thats it , you should now have a successful DHCP server running!!
|
0
comments
]
0 comments
Post a Comment