Wissensdatenbank
Buehl, Kevin
04 Juli 2015
3.277

Wissensdatenbank

Debian 7 Whezzy Installation eines DHCP Servers

Vorwort


Für meine virtuellen Server möchte ich einen DHCP Server betreiben, welcher den VPS eine externe IP-Adresse zuweist.

Installation


apt-get install isc-dhcp-server


Konfiguration


Internetprotokoll Version 4


nano /etc/dhcp/dhcpd.conf

authoritative;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet 192.168.0.0 netmask 255.255.255.0
{
interface br0;
option subnet-mask 255.255.255.255;
option routers 48.42.48.42;
option domain-name-servers 8.8.8.8, 8.8.4.4;
option domain-name "customer.4b42.eu";

host vps4842
{
hardware ethernet 4b:42:4b:42:4b:42:4b:42;
fixed-address 48.42.48.42;
}
}

/etc/init.d/isc-dhcp-server restart

Internetprotokoll Version 6


nano /etc/dhcp/dhcpd6.conf

authoritative;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;

subnet6 4b42:4b42:4b42:4b42::/64
{
interface br0;
# Additional options
option dhcp6.name-servers 2001:4860:4860::8888;
option dhcp6.domain-search "customer.4b42.eu";

host vps4842
{
host-identifier option dhcp6.client-id 48:42:48:42:1f:ba:e3:60:b9:1f:01:23:45;
fixed-address6 4b42:4b42:4b42:4b42::127;
}
}

cp /etc/init.d/isc-dhcp-server /etc/init.d/isc-dhcp6-server

nano /etc/init.d/isc-dhcp6-server

...
DESC="ISC DHCP6 server"
DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd6.conf}
DHCPD_PID="${DHCPD_PID:-/var/run/dhcpd6.pid}"
OPTIONS="-6"
...

Starten Sie zum Schluss den DHCP Server neu:
touch /var/lib/dhcp/dhcpd6.leases && /etc/init.d/isc-dhcp6-server restart