Installing and configuring dhcpd server on Debian (Lenny)

## Install DHCP server for automatic IP assignment
apt-get update
apt-get install dhcp3-server

## Remove original config file and set the IP address for eth1 (internal network card)
rm /etc/dhcp3/dhcpd.conf
pico /etc/network/interfaces

# —————————————— #
## Example configuration: (no eth0)
auto eth1
iface eth1 inet static
address 192.168.0.1
netmask 255.255.255.0
# —————————————— #

## Configure “dhcpd.conf”
# From file: “/etc/dhcp3/dhcpd.conf”

example:
# ————————————————- ————– #
# ————————- #
# Dhcpd configuration file #
# ————————- #

# Server configuration
DDNS-update-style ad-hoc;
boot-unknown-clients false;
option domain-name-servers 4.2.2.2,4.2.2.3,4.2.2.4,4.2.2.5;
authoritative;
default-lease-time 43200;
max-lease-time 86400;
allow unknown-clients;

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.2 192.168.0.254;
option subnet-mask 255.255.255.0;
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
allow unknown-clients;
}
# ————————————————- ————– #

Notes:

DHCP server will assign IP addresses in the range: 192.168.0.2 – 192.168.0.254
If you want the DHCP server to allocate IP addresses used by Poppy example below (just below the line “allow unknown-clients” in dhcpd.conf)
Hardware address (Mac) can be seen using arping command (ex: arping -I eth1 local_ip)

linuxserver host {
hardware ethernet 00:2b:dc:36:32:46;
fixed-address 192.168.0.10;
}

Tagged with:  

Leave a Reply

Premium WordPress Themes

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Copyright © 2005-2010 Linux Server™. Use of this web site constitutes acceptance of the Linux Server™ Terms of Use and Privacy Policy. en-US Linux is a trademark registered by Linus Torvalds in the United States and other countries.