Zur Grundausstattung eines Linux-Rechners gehört ein DHCP-Server. Hier die Konfiguration

Installation

sudo apt-get install dhcp3-server

Konfiguration

Zuerst muss in der Datei /etc/default/dhcp3-server (bei Debian Squeeze /etc/default/isc-dhcp-server) folgendes eingetragen werden, auf welche Netzwerkschnittstelle der DHCP-Server antworten soll

INTERFACES="eth0"

Konfigurationsdatei wie folgt füllen (/etc/dhcp3/dhcpd.conf)

# eigene Konfiguration # -------------------------------------------- # Globale Konfiguration # DHCP-Einstellungen authoritative; default-lease-time 86400; max-lease-time 86400; # Netzwerkeinstellungen option broadcast-address 192.168.0.255; option subnet-mask 255.255.255.0; option routers 192.168.0.254; option domain-name-servers 192.168.0.254; option domain-name "schindelmann.local"; # ------------------------------------------- # Dynamische IP-Zuweisung subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.90 192.168.0.99; } # ------------------------------------------- # Statische IP-Zuweisung host workstation {hardware ethernet 00:40:ca:68:2e:d4; fixed-address 192.168.0.101; } host laptop-lan {hardware ethernet 00:02:3f:18:e2:33; fixed-address 192.168.0.102; } host laptop-wlan {hardware ethernet 00:0e:35:2d:40:c1; fixed-address 192.168.0.103; } host laptop-gbit {hardware ethernet 00:13:3b:02:b4:ba; fixed-address 192.168.0.104; } host netbook-lan {hardware ethernet 00:1d:92:58:8c:3e; fixed-address 192.168.0.105; } host netbook-wlan {hardware ethernet 00:15:af:bc:4d:ce; fixed-address 192.168.0.106; } host fernseher {hardware ethernet 00:12:fb:a2:0a:ef; fixed-address 192.168.0.107; } host wii-lan {hardware ethernet 00:19:fd:4e:42:dd; fixed-address 192.168.0.108; } host wii-wlan {hardware ethernet 00:1b:ea:f2:42:ab; fixed-address 192.168.0.109; } host dvd-player {hardware ethernet 00:06:dc:40:07:c2; fixed-address 192.168.0.110; } host popcorn-hour {hardware ethernet 00:06:dc:80:8b:1c; fixed-address 192.168.0.111; } host Nokia-E51 {hardware ethernet 00:1c:d6:2e:83:f7; fixed-address 192.168.0.112; } host e-pc {hardware ethernet 00:01:02:06:0c:0b; fixed-address 192.168.0.120; }

Jetzt den DHCP-Server noch neu starten und fertig.

Version	Befehl
Ubuntu	/etc/init.d/dhcp3-server start
Debian Squeeze	/etc/init.d/isc-dhcp-server start

Problembehebung

Problem:

DHCP-Server starten nicht

Log-File des DHCP-Servers (/var/log/syslog) stehen folgende einträge

Can't open lease database /var/lib/dhcpd/dhcpd.leases: No such file or directory --
check for failed database rewrite attempt!

Lösung: Die Datei dhcpd.leases konnte nicht angelegt werden

sudo mkdir /var/lib/dhcpd