Related Items  

Linux and Windows IT Support  

We make IT Support easy!

Windows, Apple and Linux IT support and services.

Login or Register  

If you wish to contribute an article, please login or register.

Installing DHCP Server on Linux


Q. I would like to install a DHCP server.

1. Should I pick Windows or Linux

2. What are the install steps?

A. To answer 1st question - its up to you. There's no clear advantage to using one or the other. If you are running a router on Linux - then you should probably install Linux-based. If you have an Exchange or file-server running on Windows or you're just more comfortable with a gui based interface - then Windows is the way to go. This article will cover Linux install of the DHCP server (Windows will be covered some other time).

The installation process itself is quite simple (assuming you have one of the known distributions. For the sake of the example we'll use Ubuntu): at a terminal prompt, enter the following command to install DHCP server:

sudo apt-get install dhcp3-server

Once installed, to configure it you would have to make changes to /etc/dhcp3/dhcpd.conf

subnet netmask {
option domain-name-servers;
option domain-name "canadem";
option routers;
option broadcast-address;
option netbios-name-servers;
default-lease-time 600;
max-lease-time 7200;

This will give a client an IP address range from to IPs will be leased for 600 seconds if the client doesn't ask for a specific time frame. The maximum allowed lease of 7200 seconds. The server will also "advise" the client that it should use as its subnet mask, as its broadcast address. is the router. is the DNS server. WINS server for your Windows clients is (windows server in this case).

The last thing to do (assuming you've installed this on a router, with 2 network cards) is to bind your config to a network card (modify /etc/default/dhcp3-server)

# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp3-server by the maintainer scripts

# This is a POSIX shell fragment

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".

Otherwise you'll get an error like this in your logs:

Not configured to listen on any interfaces!

Start/Restart the DHCP server:

sudo /etc/init.d/dhcp3-server start

You can also specify a fixed IP, based on the MAC address. (This is very handy if you want to use remote access in your network, or just simply manage access). This can be done in the config file, /etc/dhcp3/dhcpd.conf:

host fantasia { 
hardware ethernet 08:00:02:24:c1:a3;

Note: make sure you are using an IP outside of the DHCP range (in our case, .120 is outside of .150-.240)

Add your comment

Your name:
  The word for verification. Lowercase letters only with no spaces.
Word verification:
yvComment v.1.24.0
Copyright © 1999 - 2017 Virtual Helpme | Business IT Support | Original Template: Allrounder