DHCP Server


Zurück zur Linux Startseite

Inhalt


Intro

Ein DHCP (Dynamic Host Configuration Protocol) Server wird eingesetzt wenn man keine statischen IP Adressen mehr vergeben möchte und die damit verbundene Papierarbeit los wird.

Fast alle IP Basierten Clients können die IP auch via DHCP holen. Der Client 'schreit' ins Netzwerk hinaus und verlangt eine IP Adresse. Der DHCP Server vergibt (sofern noch Adressen zur Verfügung stehen) eine IP Adresse aus dem vorgegebenen IP Range.

top.gifZurück zum Inhalt


Download

Der DCHP Server wurde vom Internet Software Consortium entwickelt und kann unter http://www.isc.org/products/DHCP/ heruntergeladen werden.

top.gifZurück zum Inhalt


Compile

tar -xzf dhcp-3.0p1.tar.gz
./configure
make
make install

top.gifZurück zum Inhalt


Firewall

Wenn auf dem DHCP Server auch noch ein Packetfilter lnstalliert ist dann sollten nachfolgende Regeln beachtet werden.

Die Firewall Rulesets müssen alle UDP Packete von 0.0.0.0 to 255.255.255.255 des UDP Ports 68 zum UDP Port 67 durchlassen. Vom Firewall ins Netz muss der UDP Port 68 und 67 offen sein.

top.gifZurück zum Inhalt


Startscript

[/etc/init.d/dhcpd]
#!/bin/sh
BIN=/usr/local/dhcpd/bin/dhcpd
CONF=/etc/dhcpd.conf
PIDFILE=/var/run/httpd.pid

if [ -f $PIDFILE ]; then
pid=`cat $PIDFILE`
fi

if [ ! -x $BIN ]; then
echo "$0: BIN: cannot execute"
exit 1
fi

case "$1" in
start)
echo -n "Starting DHCPD... "
$BIN
echo "done!"
;;

stop)
if [ -n "$pid" ]; then
echo -n "Stopping DHCPD... "
kill -TERM $pid
echo "done!"
else
echo "$0: DHCPD not running"
exit 1
fi
;;

restart)
if [ -n "$pid" ]; then
echo -n "Restarting DHCPD... "
kill -HUP $pid
echo "done!"
fi
;;

*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;

esac
exit 0

top.gifZurück zum Inhalt


Config File erstellen (dhcpd.conf)

[/etc/dhcpd.conf]
# Setting DHCPD global parameters
allow unknown-clients;

# Set parameters for the 192.168.0.0/24 subnet.
subnet 192.168.0.0 netmask 255.255.255.0 {

# Range of IP addresses available for assignment.
range 192.168.0.2 192.168.0.8;
# Default lease time in seconds. This is the time assigned if the client doesn't request one.
default-lease-time 604800;

# Maximum time a lease will be given.
max-lease-time 604800;

# subnetmask given to clients
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.0.255;
option routers 192.168.0.1;

# put a list of name server IP addresses here.
option domain-name-servers 1.2.3.4, 1.2.3.5;
option domain-name "your.domain.name";

#WINS Server angeben
option netbios-name-servers 192.168.0.10;
option netbios-node-type 8;
option netbios-dd-server 192.168.0.10;
option netbios-scope "";

# list of routers the clients should use
option routers 192.168.0.1;
}

# DDNS Update Style ddns-update-style none;

top.gifZurück zum Inhalt


Zur Linux Startseite home.icewolf.ch/linux/ | Copyright © 2002 - Andres Bohren Icewolf Software