How to install dhcp3-server in Ubuntu
Dynamic Host Configuration Protocol, shortly known as DHCP, is very useful tool when it comes to networking with multiple computers in the network. It is a must have tool for an office network infrastructure. Of course, you can live without it, but it makes sysadmin’s life much more easier and let’s users just plug in their network cables and they are in the network. You can read more about DHCP here.
Ok, so let’s look at how we install DHCP in Ubuntu 6.06.1 LTS (Dapper Drake). I assume you did a clean install of Ubuntu Linux server edition or at least have a working Ubuntu running in your box.
So steps:
1. You should set your IP settings to static. You can do it by editing file/etc/network/interfaces config file. For the primary interface, usually it’s eth0, you will see following lines:
auto eth0 iface eth0 inet dhcp
You may set different IP settings here, in my case I change those lines to:
auto eth0 iface eth0 inet static address 192.168.1.100 netmask 255.255.255.0 network 192.168.1.0 broadcast 192.168.1.255 gateway 192.168.1.1
2. Set your DNS Servers editing /etc/resolv.conf file.
3. sudo /etc/init.d/networking restart
4. sudo apt-get update
5. sudo apt-get install dhcp3-server
6. sudo vim /etc/defaults/dhcp3-server
Add your interface name in the settings file. ( INTERFACES=”eth0″ )
We know that right after installing dhcp3-server packages it tries to start it but fails. So now that we changed default interface it will listen to we try again to start the server by typing:
7. sudo /etc/init.d/dhcp3-server start
8. All the logs from dhcp server is sent to syslog, we check it:
arstan@ubuntu:~$ sudo tail -f /var/log/syslog Jul 6 13:03:24 ubuntu dhcpd: Wrote 0 leases to leases file. Jul 6 13:03:24 ubuntu dhcpd: Jul 6 13:03:24 ubuntu dhcpd: No subnet declaration for eth0 (192.168.1.100). Jul 6 13:03:24 ubuntu dhcpd: ** Ignoring requests on eth0. If this is not what Jul 6 13:03:24 ubuntu dhcpd: you want, please write a subnet declaration Jul 6 13:03:24 ubuntu dhcpd: in your dhcpd.conf file for the network segment Jul 6 13:03:24 ubuntu dhcpd: to which interface eth0 is attached. **
So why is it still not starting up? After doing some digging in /etc/init.d/dhcp3-server start script I found that it has the following lines:
# Allow ltsp to override if [ -f /etc/ltsp/dhcpd.conf ]; then CONFIG_FILE=/etc/ltsp/dhcpd.conf break fi
Since we don’t need ltsp configs in this case, let’s just comment them out. You can do so by adding # at the beginning of each line.
Let’s restart the server by typing:
sudo /etc/init.d/dhcp3-server start
That’s all about it! You know have DHCP server configured in Ubuntu Linux.
Have fun!
_______________________________________________________
Hot Wedding Guide Website
_______________________________________________________
Hello!
i tried to follow your indications, but i also had to edit /etc/dhcp3/dhcpd.conf in order to get dhcp3-server to start; even with this, no way to get dhcp offers on client – dhcp3 doesn’t answer..
do you have any idea? thx in advance,
Paolo
Hello Paolo,
can you please tell which version of Ubuntu are you trying this.
Also make sure your IP settings set to static.
It would also help if you can post the dhcpd.conf file contents.
/etc/defaults/dhcp3-server set?
I agree, Ubuntu dhcpd3-server is broken.
[...] Read the rest at jusupov.com [...]
SDAS – How To Install – Ubuntu…
HOW TO install SDAS on Ubuntu \## INTERNAL USE ONLY ## 1. Based on Unbutu v8.10 Follow the basic install procedure. iptables v1.40 is install and has the quote command already included. Test iptables. 1…….