ISC-DHCPD (Linux): Unterschied zwischen den Versionen

Aus Tutorials
Zur Navigation springen Zur Suche springen
 
(22 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 6: Zeile 6:


== Konfiguraration ==
== Konfiguraration ==
=== /etc/default/isc-dhcp-server ===
<pre>
sudo vi /etc/default/isc-dhcp-server
</pre>
In dieser Zeile die Schnittstelle, wo DHCP-Anfragen beantwortet werden sollen, eintragen:
<pre>
INTERFACESv4="eth0"
</pre>
=== /etc/dhcp/dhcpd.conf ===


Die Datei ''/etc/dhcp/dhcpd.conf'' anpassen:
Die Datei ''/etc/dhcp/dhcpd.conf'' anpassen:
<pre>
<pre>
sudo nano /etc/dhcp/dhcpd.conf
sudo vi /etc/dhcp/dhcpd.conf
</pre>
</pre>


Zeile 22: Zeile 36:
# option definitions common to all supported networks...
# option definitions common to all supported networks...
option domain-name "kirner.or.at";
option domain-name "kirner.or.at";
option domain-name-servers 10.0.0.100;
option domain-name-servers 8.8.8.8, 8.8.4.4;


default-lease-time 600;
default-lease-time 600;
Zeile 31: Zeile 45:
authoritative;
authoritative;


# Use this to send dhcp log messages to a different log file (you also
subnet 10.3.0.0 netmask 255.255.255.0 {
# have to hack syslog.conf to complete the redirection).
  range 10.0.0.50 10.0.0.200;
log-facility local7;
  option broadcast-address 10.3.0.255;
  option routers 10.3.0.1;
}
</pre>
 
==== statische IP-Adresse ====
 
Um einem Client eine statische IP-Adresse zuzuweisen, muss pro Client eine eigene ''host''-Sektion angehängt werden, wobei der Name des Clients (hier ''testclient'') frei wählbar ist:


subnet 10.0.0.0 netmask 255.255.255.0 {
<pre>
   range 10.0.0.2 10.0.0.100;
host testclient {
   option routers 10.0.0.1;
   hardware ethernet DC:A6:32:BE:D1:7D;
   fixed-address 10.3.0.49;
}
}
</pre>
</pre>


Danach den den DHCP-Server neustarten:
=== /etc/dhcpcd.enter-hook ===
 
Zum Abschluss der Schnittstellen-Initialisierung die IP-Adresse setzen (ansonsten startet der ISC-DHCPD-Server nicht):
 
<pre>
sudo vi /etc/dhcpcd.enter-hook
</pre>
 
<pre>
ifconfig eth0 10.3.0.1
</pre>
 
Siehe auch [[Dhcpcd-run-hooks (Raspbian)|dhcpcd-run-hooks]]
 
=== Neustart ===
 
Zum Abschluss den DHCP-Server neustarten:
 
<pre>
<pre>
sudo /etc/init.d/isc-dhcp-server restart
sudo /etc/init.d/isc-dhcp-server restart
Zeile 52: Zeile 91:
== PXE (Preboot Execution Environment) ==
== PXE (Preboot Execution Environment) ==


[https://www.debian.org/releases/jessie/i386/ch04s05.html.de https://www.debian.org/releases/jessie/i386/ch04s05.html.de]
Siehe [[PXE - Preboot Execution Environment (unterschiedliche Versionen)|PXE (Preboot Execution Environment)]]
 
== Probleme ==
 
=== No subnet declaration for eth0 ===
 
Für die betroffene Schnittstelle muss zuerst eine IP-Adresse gesetzt werden:
 
<pre>
sudo ifconfig eth0 10.3.0.1
</pre>


== Links ==
== Links ==


[https://wiki.ubuntuusers.de/ISC-DHCPD/ https://wiki.ubuntuusers.de/ISC-DHCPD/]
[https://wiki.ubuntuusers.de/ISC-DHCPD/ https://wiki.ubuntuusers.de/ISC-DHCPD/]
[https://kb.isc.org/docs/isc-dhcp-41-manual-pages-dhcpdconf https://kb.isc.org/docs/isc-dhcp-41-manual-pages-dhcpdconf]




Zurück zu [[Ubuntu]]
Zurück zu [[Ubuntu]]

Aktuelle Version vom 27. September 2020, 15:32 Uhr

Installation

sudo apt-get install isc-dhcp-server 

Konfiguraration

/etc/default/isc-dhcp-server

sudo vi /etc/default/isc-dhcp-server

In dieser Zeile die Schnittstelle, wo DHCP-Anfragen beantwortet werden sollen, eintragen:

INTERFACESv4="eth0"

/etc/dhcp/dhcpd.conf

Die Datei /etc/dhcp/dhcpd.conf anpassen:

sudo vi /etc/dhcp/dhcpd.conf

Foldende Konfiguration beinhaltet nur alle einkommentierten Optionen:

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
option domain-name "kirner.or.at";
option domain-name-servers 8.8.8.8, 8.8.4.4;

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.
authoritative;

subnet 10.3.0.0 netmask 255.255.255.0 {
  range 10.0.0.50 10.0.0.200;
  option broadcast-address 10.3.0.255;
  option routers 10.3.0.1;
}

statische IP-Adresse

Um einem Client eine statische IP-Adresse zuzuweisen, muss pro Client eine eigene host-Sektion angehängt werden, wobei der Name des Clients (hier testclient) frei wählbar ist:

host testclient {
  hardware ethernet DC:A6:32:BE:D1:7D;
  fixed-address 10.3.0.49;
}

/etc/dhcpcd.enter-hook

Zum Abschluss der Schnittstellen-Initialisierung die IP-Adresse setzen (ansonsten startet der ISC-DHCPD-Server nicht):

sudo vi /etc/dhcpcd.enter-hook
ifconfig eth0 10.3.0.1

Siehe auch dhcpcd-run-hooks

Neustart

Zum Abschluss den DHCP-Server neustarten:

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

Replikation

https://www.tech-island.com/tutorials/dhcp-failover-linux

PXE (Preboot Execution Environment)

Siehe PXE (Preboot Execution Environment)

Probleme

No subnet declaration for eth0

Für die betroffene Schnittstelle muss zuerst eine IP-Adresse gesetzt werden:

sudo ifconfig eth0 10.3.0.1

Links

https://wiki.ubuntuusers.de/ISC-DHCPD/

https://kb.isc.org/docs/isc-dhcp-41-manual-pages-dhcpdconf


Zurück zu Ubuntu