Sunday, 7 June 2009

DHCP server with ubuntu

first install the correct package :
sudo aptitude install dhcp3-server
then edit the configuration file :
vim /etc/dhcp3/dhcpd.conf
ddns-update-style none;

# option definitions common to all supported networks...

option domain-name "domain.tld"
option domain-name-servers,,;

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).

log-facility local7;

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.

# eth0 subnet configuration

subnet netmask {
option routers;
option broadcast-address;
Replace domain.tld by your local domain (keep the quotes around the domaine).
Replace the nameservers by your ISP domain servers (or your local DNS server)
then modify the subnet configuration according to your network.

Here I setup a dhcp server on network (gateway :

The dhcp server will attribute ip from to

then start the server :

sudo service dhcp3-server start

No comments: