DHCPv4|v6-Server mit DHCP ISC Kea unter Arch Linux einrichten und nutzen

Bild: Logo des DHCP ISC Kea Zum Einsatz in unserer Umgebung wird der Kea DHCP-Server kommen, der Nachfolger des ISC DHCP Servers der Ende 2022 das Ende seines Lebenszyklus erreichte und nicht weiterentwickelt wurde. Das Nachfolgeprodukt ist nun der moderne Open Source DHCPv4 & DHCPv6 Server Kea.

Im wesentlichen unterscheidet sich Kea von seinem Vorgänger unter anderem durch sein modulares Komponenten basierenden Design, welches mit sog. Hooks-Modulen leicht erweiterbar ist. Kea stellt einzelne Daemons zur Verfügung die entweder gemeinsam oder auch getrennt genutzt werden können. So enthält Kea einen Daemon für einen DHCPv4-Server, einen DHCPv6-Server und ein dynamisches Modul für DNS. Die Konfiguration des Kea-Servers erfolgt mit Hilfe einer JSON-Konfigurationsdatei. Mit Hilfe der REST-API können zur Laufzeit jederzeit während des Betriebs Änderungen des Daemons vorgenommen werden, ohne dass der Daemon neu gestartet werden muss. Optional kann beim Kea Server auch ein WEB-UI ein grafisches Dashboard genutzt werden zur Überwachung mehrerer Kea-Instanzen. Neben der Dateibasierenden Variante können die ganzen Konfigurationsoptionen auch optional in einer PostgreSQL oder Maria-mySQL-Datenbank vorgehalten werden.

In der nachfolgenden WIKI-Artikel wollen wir uns nun eingehender mit der Installation und Konfiguration unseres Kea DHCP Servers für für DHCPv4 und DHCPv6 beschäftigen. In dem Konfigurationsbeispiel wird dem Kea-Daemon die Verwaltung und Verteilung der Intranet-Adressen der Zone intra.nausch.org übertragen. Dieses Subnetz umfasst nachfolgende Adressbereiche - zum besseren Verständnis sind in der Tabelle auch exemplarische Hosts mit den entsprechenden Adressen vermerkt:

Subnetz
(ID)
Subnetz
(Use)
Subnetz Prefix
(global Unicast)
Host
-
IPv4
-
Link-Local-Scope
(LLA)
Unique-Local-Scope
(ULA)
Global-Scope
(GUA)
7 Intra 2003:a:bcd:1234::/64
pml010073 10.0.10.73 fe80::e9a6::bb03:1544:b0000/64 fd00:dead:beef:0:10:0:10:073/64 2003:a:bcd:1234:10:0:10:73
pml010102 10.0.10.102 fe80::10:ff:fe10:102 fdb6:dead:beef:0:10:0:10:102/64 2003:a:bcd:1234:10:0:10:102
vml010110 10.0.10.110 fe80::10:ff:fe10:110 fdb6:dead:beef:0:10:0:10:110/64 2003:a:bcd:1234:10:0:10:110

Für die Zuweisung der Netzwerkkonfiguration an den Client durch unseren Server bedienen wir uns des DHCP1), DHCP ist eine Ergänzung und Erweiterung von BOOTP2). DHCP wurde im RFC 2131 definiert und bekam von der Internet Assigned Numbers Authority die beiden UDP-Ports 67 und 68 zugewiesen.

Mittels DHCP ist die automatische Einbindung eines neuen Client in unser bestehendes Netzwerk ohne grosse manuelle Konfiguration möglich. Am Client muss daher nur der automatische Bezug der IP-Adresse eingestellt sein. Beim Start des Clients am Netz kann dieser die IP-Adresse, die Netzmaske, das Gateway, DNS-Server und weitere Konfigurationsparameter vom DHCP-Server beziehen. Neben diesen klassischen Parametern zählen hierzu auch die Verwendung einer Reihe von weiteren IP-Variablen, wie z.B.: X-Display- , Time-, Swap-, NIS-Server und die Unterstützung von Vendor-Code-Identifiern zum Einsatz im Bereich PXE3) finden.

Beim Starten eines Clients frägt dieser über einen Broadcast im gesamten Netzwerk nach (s)einer IP-Adresse. Als Antwort auf seinen Broadcast erhält er die beiden wichtigsten Parameter:

  • IP-Adresse
  • Lease-Time

Darüber hinaus können optional noch weitere Parameter mit übergeben werden, wie z.B.:

  • Default-Route
  • Netzmaske
  • DNS-Server-Adressen
  • WINS-Server
  • Broadcast-Adresse
  • IP-Variablen
  • sowie noch weitere Parameter

DHCPv4-Adressvergabe - Detailbetrachtung

Der grundsätzliche Ablauf bei der Adress-Anfrage folgt dabei folgendem Schema. Die Kommunikation zwischen dem Server (Port 67) und dem Clients (Port 68) erfolgte mittels UPD4).

  1. Schritt der DHCP-Adressanfrage - DHCPDISCOVER
    Beim Booten unseres Client-Rechners frägt dieser mit einer DHCPDISCOVER-Nachricht via Broadcast nach seiner Konfiguration. Zu diesem Zeitpunkt besitzt er noch keine eigene IP-Adresse und er kennt auch noch nicht, in welchem Netz er sich befindet. Lediglich seine MAC5)-Adresse seines Netzwerkinterfaces ist ihm bekannt. Aus diesem Grund sendet er ein Broadcastpaket mit der Quelladresse 0.0.0.0 und an die Zieladresse 255.255.255.255.

    @startuml
    !define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
    !include osaPuml/Common.puml
    !include osaPuml/Hardware/all.puml
    !include osaPuml/Server/all.puml

    Client: <$osa_desktop>
    Server: <$osa_server_proxy>

    Client -> Server : DHCPDISCOVER mit \n MAC 00:11:22:33:44:55
    note right : DHCP4_QUERY_LABEL

    @enduml

    2024-07-04 13:23:11.726 INFO  [kea-dhcp4.dhcp4/1023.138852396816064] DHCP4_QUERY_LABEL received query: [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x9788fd77
    Das Label DHCP4_QUERY_LABEL zeigt in dieser Informationsmeldung an, dass eine Abfrage empfangen wurde. Diese Meldung zeigt den Client und die Transaktionskennung an.


    @startuml
    !define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
    !include osaPuml/Common.puml
    !include osaPuml/Hardware/all.puml
    !include osaPuml/Server/all.puml

    Client: <$osa_desktop>
    Server: <$osa_server_proxy>

    Client -> Server : DHCPDISCOVER mit \n MAC 00:11:22:33:44:55
    note right : DHCP4_PACKET_RECEIVED

    @enduml
    2024-07-04 13:23:11.726 INFO  [kea-dhcp4.packets/1023.138852396816064] DHCP4_PACKET_RECEIVED [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x9788fd77: DHCPREQUEST (type 3) received from 0.0.0.0 to 255.255.255.255 on interface net1
    
    Die zweite Meldung mit dem Label DHCP4_PACKET_RECEIVED gibt einen Hinweis, dass der DHCP-Daemon den angegebenen Pakettyp auf der angegebenen Schnittstelle empfangen hat. Das erste Argument gibt die Client- und Transaktionsidentifikationsinformationen an. Das zweite und dritte Argument geben den Namen der DHCPv4-Nachricht bzw. ihren numerischen Typ an. Die übrigen Argumente geben die Quell-IPv4-Adresse, die Ziel-IPv4-Adresse und den Namen der Schnittstelle an, über die die Nachricht empfangen wurde.


    @startuml
    !define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
    !include osaPuml/Common.puml
    !include osaPuml/Hardware/all.puml
    !include osaPuml/Server/all.puml

    Client: <$osa_desktop>
    Server: <$osa_server_proxy>

    Client -> Server : DHCPREQUEST Address 10.0.10.230
    note right : DHCP4_INIT_REBOOT

    @enduml
    2024-07-04 13:23:11.726 INFO  [kea-dhcp4.leases/1023.138852396816064] DHCP4_INIT_REBOOT [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x9788fd77: client is in INIT-REBOOT state and requests address 10.0.10.230
    Die Dritte Meldung mit dem Label DHCP4_INIT_REBOOT besagt, dass sich der Client im Zustand INIT-REBOOT befindet und die Zuweisung einer von ihm verwendeten IPv4-Adresse anfordert. Das erste Argument enthält die Client- und Transaktionsidentifikationsinformationen. Das zweite Argument gibt die angeforderte IPv4-Adresse an, die der Client gerne haben würde.


    @startuml
    !define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
    !include osaPuml/Common.puml
    !include osaPuml/Hardware/all.puml
    !include osaPuml/Server/all.puml

    Client: <$osa_desktop>
    Server: <$osa_server_proxy>

    Client -> Server : DHCPDISCOVER mit \n MAC 00:11:22:33:44:55
    note right : DHCP4_QUERY_LABEL

    @enduml

    2024-07-04 13:23:13.726 INFO  [kea-dhcp4.dhcp4/1023.138852413601472] DHCP4_QUERY_LABEL received query: [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494
    Das Label DHCP4_QUERY_LABEL zeigt in dieser Informationsmeldung an, dass eine Abfrage empfangen wurde. Diese Meldung zeigt den Client und die Transaktionskennung an.


    @startuml
    !define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
    !include osaPuml/Common.puml
    !include osaPuml/Hardware/all.puml
    !include osaPuml/Server/all.puml

    Client: <$osa_desktop>
    Server: <$osa_server_proxy>

    Client -> Server : DHCPDISCOVER mit \n MAC 00:11:22:33:44:55
    note right : DHCP4_PACKET_RECEIVED

    @enduml
    2024-07-04 13:23:13.726 INFO  [kea-dhcp4.packets/1023.138852413601472] DHCP4_PACKET_RECEIVED [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface net1
    Das Label DHCP4_PACKET_RECEIVED zeigt in dieser Meldung an, dass der DHCP-Daemon den angegebenen Pakettyp auf der angegebenen Schnittstelle empfangen hat. Das erste Argument gibt die Client- und Transaktionsidentifikationsinformationen an. Das zweite und dritte Argument geben den Namen der DHCPv4-Nachricht bzw. ihren numerischen Typ an. Die übrigen Argumente geben die Quell-IPv4-Adresse, die Ziel-IPv4-Adresse und den Namen der Schnittstelle an, über die die Nachricht empfangen wurde.

  2. Stufe der DHCP-Adressanfrage - DHCPOFFER
    Dieses Broadcast-Pakete beantwortet nun der DHCP-Server mit einer DHCPOFFER-Nachricht. Das Antwortpaket beinhaltet bereits als Zieladresse die IP, welche der Client in Zukunft bekommen soll. Da bei der vorherigen Anfrage des Clients, dieser seine eigene MAC-Adresse mitschickte, kann nun auf diese Weise die DHCPOFFER-Nachricht ihr Ziel finden.

    @startuml
    !define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
    !include osaPuml/Common.puml
    !include osaPuml/Hardware/all.puml
    !include osaPuml/Server/all.puml

    Client: <$osa_desktop>
    Server: <$osa_server_proxy>

    Client <- Server : DHCPOFFER mit Address 10.0.10.231

    note right : DHCP4_LEASE_OFFER DHCP4_PACKET_SEND

    @enduml

    2024-07-04 13:23:13.726 INFO  [kea-dhcp4.leases/1023.138852413601472] DHCP4_LEASE_OFFER [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: lease 10.0.10.231 will be offered
    
    Diese Informationsmeldung zeigt an, dass der Server eine Lease gefunden hat, die er dem Client anbieten wird. Das erste Argument gibt den Client und die Transaktionskenndaten an. Das zweite Argument gibt die IPv4-Adresse an, die angeboten werden soll.
    2024-07-04 13:23:13.727 INFO  [kea-dhcp4.packets/1023.138852413601472] DHCP4_PACKET_SEND [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: trying to send packet DHCPOFFER (type 2) from 10.0.10.110:67 to 10.0.10.231:68 on interface net1
    Dies ist eine INFO-Meldung, die besagt, dass der Server versucht, den angegebenen Pakettyp zu senden. Die Argumente geben die Client-Identifikationsinformationen (HW-Adresse und Client-Identifier), den Namen und den Typ der DHCP-Nachricht, die Quell-IPv4-Adresse und den Port, die Ziel-IPv4-Adresse und den Port sowie den Schnittstellennamen an.

  3. Stufe der DHCP-Adressanfrage - DHCPREQUEST
    Die angebotene Adresse wird nun vom Client nochmals explizit angefordert.

    @startuml
    !define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
    !include osaPuml/Common.puml
    !include osaPuml/Hardware/all.puml
    !include osaPuml/Server/all.puml

    Client: <$osa_desktop>
    Server: <$osa_server_proxy>

    Client -> Server : DHCPREQUEST

    note right : DHCP4_QUERY_LABEL DHCP4_PACKET_RECEIVED
    @enduml

    2024-07-04 13:23:13.728 INFO  [kea-dhcp4.dhcp4/1023.138852405208768] DHCP4_QUERY_LABEL received query: [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494
    Das Label DHCP4_QUERY_LABEL zeigt in dieser Meldung an, dass eine Abfrage empfangen wurde. Diese Meldung zeigt den Client und die Transaktionskennung an.
    2024-07-04 13:23:13.728 INFO  [kea-dhcp4.packets/1023.138852405208768] DHCP4_PACKET_RECEIVED [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: DHCPREQUEST (type 3) received from 0.0.0.0 to 255.255.255.255 on interface net1
    Das Label DHCP4_PACKET_RECEIVED zeigt in dieser Meldung an, dass der DHCP-Daemon den angegebenen Pakettyp auf der angegebenen Schnittstelle empfangen hat. Das erste Argument gibt die Client- und Transaktionsidentifikationsinformationen an. Das zweite und dritte Argument geben den Namen der DHCPv4-Nachricht bzw. ihren numerischen Typ an. Die übrigen Argumente geben die Quell-IPv4-Adresse, die Ziel-IPv4-Adresse und den Namen der Schnittstelle an, über die die Nachricht empfangen wurde.

  4. Stufe der DHCP-Adressanfrage - DHCPACK
    Die dem Client angebotene und bestätigte Adresse wird nun vom DHCP-Daemon als belegt gekennzeichnet und dem Client entsprechend mit einem DHCPACK abschliessend bestätigt

    @startuml
    !define osaPuml https://raw.githubusercontent.com/Crashedmind/PlantUML-opensecurityarchitecture2-icons/master
    !include osaPuml/Common.puml
    !include osaPuml/Hardware/all.puml
    !include osaPuml/Server/all.puml

    Client: <$osa_desktop>
    Server: <$osa_server_proxy>

    Client -> Server : DHCPREQUEST

    note right : DHCP4_LEASE_ALLOC DHCP4_PACKET_SEND
    @enduml

    2024-07-04 13:23:13.728 INFO  [kea-dhcp4.leases/1023.138852405208768] DHCP4_LEASE_ALLOC [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: lease 10.0.10.231 has been allocated for 3600 seconds
    Diese Informationsmeldung zeigt an, dass der Server als Antwort auf die DHCPREQUEST-Nachricht des Clients erfolgreich einen Lease vergeben hat. Die Lease-Informationen werden in der nachfolgenden DHCPACK-Nachricht an den Client gesendet. Das erste Argument enthält den Client und die Transaktionsidentifikationsinformationen. Das zweite Argument enthält die zugewiesene IPv4-Adresse. Das dritte Argument ist die Gültigkeitsdauer.
    2024-07-04 13:23:13.728 INFO  [kea-dhcp4.packets/1023.138852405208768] DHCP4_PACKET_SEND [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: trying to send packet DHCPACK (type 5) from 10.0.10.110:67 to 10.0.10.231:68 on interface net
    Dies ist eine INFO-Meldung, die besagt, dass der Server versucht, den angegebenen Pakettyp zu senden. Die Argumente geben die Client-Identifikationsinformationen (HW-Adresse und Client-Identifier), den Namen und den Typ der DHCP-Nachricht, die Quell-IPv4-Adresse und den Port, die Ziel-IPv4-Adresse und den Port sowie den Schnittstellennamen an.

Gesamtbetrachtung und Zusammenfassung

Der gesamte erfolgreiche Ablauf aus Sicht des DHCP-Servers entspricht zusammengefasst folgendem Diagramm.

erfolgreiche Ablauf aus Sicht des DHCP-Serverserfolgreiche Ablauf aus Sicht des DHCP-Servers <rect fill="#000000" fill-opacity="0.00000" height="266.4609" width="8" x="232.02" y="122.4844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="236" x2="236" y1="122.4844" y2="388.9453"/></g><g><title/><rect fill="#000000" fill-opacity="0.00000" height="266.4609" width="8" x="540.9727" y="122.4844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="544.0063" x2="544.0063" y1="122.4844" y2="388.9453"/></g><g class="participant participant-head" data-participant="links"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="172.04" x="150" y="58.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="233.7949" y="78.5889"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="109.0879" x="183.7012" y="94.8857">DHCP - SERVER</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="233.7949" y="111.1826"> </text></g><g class="participant participant-tail" data-participant="links"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="172.04" x="150" y="387.9453"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="233.7949" y="407.9404"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="109.0879" x="183.7012" y="424.2373">DHCP - SERVER</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="233.7949" y="440.5342"> </text></g><g class="participant participant-head" data-participant="rechts"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="107.9326" x="491.0063" y="58.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="542.7476" y="78.5889"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="40.5303" x="524.7075" y="94.8857">Client</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="542.7476" y="111.1826"> </text></g><g class="participant participant-tail" data-participant="rechts"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="107.9326" x="491.0063" y="387.9453"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="542.7476" y="407.9404"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="40.5303" x="524.7075" y="424.2373">Client</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="542.7476" y="440.5342"> </text></g><g class="message" data-participant-1="rechts" data-participant-2="links"><polygon fill="#181818" points="247.02,160.1836,237.02,164.1836,247.02,168.1836,243.02,164.1836" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;stroke-dasharray:2.0,2.0;" x1="241.02" x2="543.9727" y1="164.1836" y2="164.1836"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="272.873" x="253.02" y="159.1177">(Port 67) DHCPDISCOVER</text></g><path d="M549,137.4844 L549,177.4844 L720,177.4844 L720,147.4844 L710,137.4844 L549,137.4844" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M710,137.4844 L710,147.4844 L720,147.4844 L710,137.4844" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="129.7524" x="555" y="154.5513">DHCPDISCOVER mit</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="150.7568" x="555" y="169.6841">MAC 00:04:13:23:3f:b5</text><g class="message" data-participant-1="links" data-participant-2="rechts"><polygon fill="#181818" points="532.9727,218.0156,542.9727,222.0156,532.9727,226.0156,536.9727,222.0156" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;" x1="236.02" x2="538.9727" y1="222.0156" y2="222.0156"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="284.9526" x="243.02" y="216.9497">DHCPOFFER (Port 68)</text></g><path d="M38,187.75 L38,242.75 L230,242.75 L230,197.75 L220,187.75 L38,187.75" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M220,187.75 L220,197.75 L230,197.75 L220,187.75" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="158.374" x="44" y="204.8169">DHCPOFFER mit Angabe</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="136.6396" x="44" y="219.9497">der IP 192.168.10.61</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="171.0947" x="44" y="235.0825">an MAC 00:04:13:23:3f:b5</text><g class="message" data-participant-1="rechts" data-participant-2="links"><polygon fill="#181818" points="247.02,283.4141,237.02,287.4141,247.02,291.4141,243.02,287.4141" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;stroke-dasharray:2.0,2.0;" x1="241.02" x2="543.9727" y1="287.4141" y2="287.4141"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="266.7285" x="253.02" y="282.3481">(Port 67) DHCPREQUEST</text></g><path d="M549,253.1484 L549,308.1484 L751,308.1484 L751,263.1484 L741,253.1484 L549,253.1484" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M741,253.1484 L741,263.1484 L751,263.1484 L741,253.1484" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="177.3408" x="555" y="270.2153">DHCPREQUEST mit Angabe</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="136.6396" x="555" y="285.3481">der IP 192.168.10.61</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="179.6196" x="555" y="300.481">und MAC 00:04:13:23:3f:b5</text><g class="message" data-participant-1="links" data-participant-2="rechts"><polygon fill="#181818" points="532.9727,348.8125,542.9727,352.8125,532.9727,356.8125,536.9727,352.8125" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;" x1="236.02" x2="538.9727" y1="352.8125" y2="352.8125"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="277.2783" x="243.02" y="347.7466">DHCPACK (Port 68)</text></g><path d="M5,318.5469 L5,373.5469 L231,373.5469 L231,328.5469 L221,318.5469 L5,318.5469" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M221,318.5469 L221,328.5469 L231,328.5469 L221,318.5469" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="142.4351" x="11" y="335.6138">DHCPACK mit Angabe</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="136.6396" x="11" y="350.7466">der IP 192.168.10.61</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="205.3467" x="11" y="365.8794">und der MAC 00:04:13:23:3f:b5</text><!--SRC=[fP3DJeD058NtFCL9LtO1WQArJem9eJGsnhG5TSLcMYuu4OTccFhypY29DbQjUdPpV-PyzsYXQmAfigahHMBpI8ZMDT-LuBiMcIbe5DHYUXqltOpK2wasbuwpvKgBZTXogJ789JhP8RZ8alGXIRjABWVWBMeXdzh3Et4joBm_JYiohgrZrEtXqdNx6XXEbetI69yFyRKintIUnGk3uSX64vIep25ihuDdeOtbRHJ3zvb_oeAGZK8MbcnzrZkxL-_6TdKnc_M7_Q2USZ9yiw-fr7jVMEj8LdnDXg0WXVaImSN82yOJB_2zSM3ANE8xjZ-baYQh-oIx-nnAtpWAR2SB_2QrABu1_fUQ_U9ODDiwYFSA]--></g></svg></div> </p> <p> Im <strong>journald</strong> unseres Kea-DHCPv4-<span class="search_hit">Servers</span> wird der Ablauf wie folgt festgehalten: </p> <pre class="code">2024-07-04 13:23:11.726 INFO [kea-dhcp4.dhcp4/1023.138852396816064] DHCP4_QUERY_LABEL received query: [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x9788fd77 2024-07-04 13:23:11.726 INFO [kea-dhcp4.packets/1023.138852396816064] DHCP4_PACKET_RECEIVED [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x9788fd77: DHCPREQUEST (type 3) received from 0.0.0.0 to 255.255.255.255 on interface net1 2024-07-04 13:23:11.726 INFO [kea-dhcp4.leases/1023.138852396816064] DHCP4_INIT_REBOOT [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x9788fd77: client is in INIT-REBOOT state and requests address 10.0.10.230 2024-07-04 13:23:13.726 INFO [kea-dhcp4.dhcp4/1023.138852413601472] DHCP4_QUERY_LABEL received query: [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494 2024-07-04 13:23:13.726 INFO [kea-dhcp4.packets/1023.138852413601472] DHCP4_PACKET_RECEIVED [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface net1 2024-07-04 13:23:13.726 INFO [kea-dhcp4.leases/1023.138852413601472] DHCP4_LEASE_OFFER [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: lease 10.0.10.231 will be offered 2024-07-04 13:23:13.727 INFO [kea-dhcp4.packets/1023.138852413601472] DHCP4_PACKET_SEND [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: trying to send packet DHCPOFFER (type 2) from 10.0.10.110:67 to 10.0.10.231:68 on interface net1 2024-07-04 13:23:13.728 INFO [kea-dhcp4.dhcp4/1023.138852405208768] DHCP4_QUERY_LABEL received query: [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494 2024-07-04 13:23:13.728 INFO [kea-dhcp4.packets/1023.138852405208768] DHCP4_PACKET_RECEIVED [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: DHCPREQUEST (type 3) received from 0.0.0.0 to 255.255.255.255 on interface net1 2024-07-04 13:23:13.728 INFO [kea-dhcp4.leases/1023.138852405208768] DHCP4_LEASE_ALLOC [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: lease 10.0.10.231 has been allocated for 3600 seconds 2024-07-04 13:23:13.728 INFO [kea-dhcp4.packets/1023.138852405208768] DHCP4_PACKET_SEND [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x14bc2494: trying to send packet DHCPACK (type 5) from 10.0.10.110:67 to 10.0.10.231:68 on interface net1</pre> <p> Sollte die ganze Prozedur Fehl schlagen, z.B. weil der Client herausgefunden hat, dass die IP-Adresse doppelt vergeben ist, sendet er eine <em><strong>DHCPDECLINE</strong>-Nachricht</em> an der Server. Diese Meldung wird ausgegeben, wenn ein Client eine Adresse erhalten hat, aber festgestellt hat, dass sie von einem anderen Gerät verwendet wird, und dies dem Server durch Senden einer DHCPDECLINE-Meldung mitgeteilt hat. Der Server prüft, ob diese Adresse wirklich an den Client vermietet wurde, und kennzeichnet diese Adresse für eine bestimmte Zeit als unbrauchbar und die gesamte Vergabeprozedur beginnt erneut von vorne.. Diese Meldung kann auf eine Fehlkonfiguration in einem Netzwerk hinweisen, da entweder ein fehlerhafter Client oder, was wahrscheinlicher ist, ein Gerät eine Adresse verwendet, die es nicht verwenden darf. </p> <p> Zusammen mit seiner IP-Adresse erhält der Client in der DHCPACK-Nachricht auch eine Lease-Time mitgeteilt, welche ihm mitteilt, wie lange die IP-Adresse für ihn reserviert ist. Im <abbr title="Request for Comments">RFC</abbr> Standard wurde definiert, dass der Client nach der Hälfte der Lease-Time einen erneuten DHCPREQUEST sendet. So teilt er dem Server mit, dass er weiterhin die für ihn reservierte IP-Adresse behalten möchte. Nach Erhalt dieser Nachricht sendet der DHCP-Server eine identische DHCPACK-Nachricht an den Client zurück, in der dann die aktuelle neue Lease-Time mitgeteilt wird. Die IP-Adresse ist somit verlängert und der DCHP-Refresh ist komplett. Sollte der Client es versäumen eine Verlängerung zu beantragen, muss er die Konfiguration des Netzwerkinterfaces verwerfen und der DHCP-Request startet erneut mit einer DHCPDISCOVER-Nachricht. </p> <p> Beim Herunterfahren eines Client-Hosts kann dieser dem Server mit einer <em><strong>DHCPRELEASE</strong>-Nachricht</em> den Server informieren, damit dieser die Adresse wieder freigeben kann. </p> <pre class="code">Oct 05 14:23:22 vml000110 kea-dhcp4[558]: INFO [kea-dhcp4.leases.138560182671040] DHCP4_RELEASE [hwtype=1 52:54:00:41:21:12], cid=[ff:5d:e2:6c:15:00:02:00:00:ab:11:6b:87:16:0d:70:5c:ed:6d]> Oct 05 14:23:22 vml000110 kea-dhcp4[558]: INFO [kea-dhcp4.leases.138560182671040] DHCP4_RELEASE_EXPIRED [hwtype=1 52:54:00:41:21:12], cid=[ff:5d:e2:6c:15:00:02:00:00:ab:11:6b:87:16:0d:70:5></pre> <p> Diese Informationsmeldung zeigt an, dass eine Adresse ordnungsgemäss freigegeben wurde. Es handelt sich um einen normalen Vorgang beim Herunterfahren des Clients. Das erste Argument enthält die Client- und Transaktionsidentifikationsinformationen. Das zweite Argument enthält die freigegebene IPv4-Adresse. </p> <p> Der Client hat aber auch die Möglichkeit, seine zuletzt zugewiesene IP-Adresse über den Reboot hinweg zu „merken“. Dies kann z.B. dann der Fall sein, wenn die Lease-Time, noch nicht abgelaufen ist, oder dem Client eine feste IP-Adresse zugeteilt wurde. Dann entfallen die Initialisierungsschritte und der Client schickt direkt eine <em><strong>DHCPREQUEST</strong>-Nachricht</em> an den DHCP-Server. Dieser bestätigt entweder die Anfrage oder sendet eine <em><strong>DHCPNAK</strong>-Nachricht</em> um dem Client mitzuteilen, dass dieser seine gespeicherten Konfigurationen zu löschen, und die Anfrage komplett von vorne zu beginnen hat. </p> <pre class="code">Oct 18 14:20:27 vml000110 kea-dhcp4[16237]: INFO [kea-dhcp4.packets.136432101570240] DHCP4_PACKET_RECEIVED [hwtype=1 00:03:c5:0e:0e:20], cid=[01:00:03:c5:0e:0e:20], tid=0x96de036a: DHCPREQUEST (type 3) received from 10.0.10.31 to 10.0.10.110 on interface net</pre> </div> <h3 class="sectionedit7 page-header pb-3 mb-4 mt-5" id="ipv6_-_dhcpv6">IPv6 - DHCPv6</h3> <div class="level3"> </div> <h4 class="sectionedit8" id="dhcpv6-adressvergabe">DHCPv6-Adressvergabe</h4> <div class="level4"> <p> Ein <strong>Stateful DHCPv6-Server</strong> liefert neben IPv6-Adressen auch weitere Informationen, wie z.B. wie eine <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domänennamen, an einen Host aus. Hosts. Dieser Stateful DHCPv6-Server behält auch den Status jeder Zuweisung im Auge, sprich er verfolgt die Verfügbarkeit des Adresspools und löst doppelte Adresskonflikte auf. Darüber hinaus protokolliert er jede Zuweisung und behält die Ablaufzeiten im Auge. Im Gegensatz zu IPv4 stellt ein Stateful DHCPv6-Server den Hosts keine Standard-Gateway-Adressen zur Verfügung, das kann bei IPv6 nur Router, die Router Advertisement-Nachrichten sendet wie z.B. unser <strong><a href="/doku.php/linux:radvd#router_advertisement_icmpv6-nachrichten_fuer_stateful_dhcpv6" class="wikilink1" title="linux:radvd" data-wiki-id="linux:radvd">radvd</a></strong>! </p> <p> Im Kapitel <strong><a href="/doku.php/linux:radvd#router_advertisement_icmpv6-nachrichten_fuer_stateful_dhcpv6" class="wikilink1" title="linux:radvd" data-wiki-id="linux:radvd">Router Advertisement ICMPv6-Nachrichten für Stateful DHCPv6</a></strong> haben wir uns bereits eingehend mit der Definition und Konfiguration der Router Advertisement Meldungen auseinander gesetzt. </p> <p> In den <strong>RA</strong><sup><a href="#fn__6" id="fnt__6" class="fn_top">6)</a></sup>-Meldungen muss also drei Flags entsprechend gesetzt seingesetzt sein: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong>M-Flag</strong>: <br/> AdvManagedFlag = <strong><code>on</code></strong> (Adresskonfiguration via Stateful DHCPv6)</div> </li> <li class="level1"><div class="li"> <strong>O-Flag</strong>: <br/> AdvOtherConfigFlag = <strong><code>on</code></strong> (Abrufen einer <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domain-Namen von einem Stateless DHCPv6-Server, aber <em class="u">keine</em> keine Adressierungsinformationen. </div> </li> <li class="level1"><div class="li"> <strong>A-Flag</strong>: <br/> AdvAutonomous = <strong><code>off</code></strong> (Adresskonfiguration via Statful DHCPv6)</div> </li> </ul> <p> Nachfolgendes Schaubild fasst den grundlegenden Ablauf bei <strong>Stateful DHCPv6</strong> zusammen: </p> <p> <div id='plant-uml-diagram-56d4f5e46001781f512471eea4b298dd4f758c68'><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" contentstyletype="text/css" data-diagram-type="SEQUENCE" height="884px" preserveaspectratio="none" style="width:1494px;height:884px;background:#FFFFFF;" version="1.1" viewbox="0 0 1494 884" width="1494px" zoomandpan="magnify"><title>erfolgreiche Ablauf aus Sicht des Clients bei der Kommunikation mit dem RADV-/DHCPv6-<span class="search_hit">Servers</span>erfolgreiche Ablauf aus Sicht des Clients bei der Kommunikation mit dem RADV-/DHCPv6-Servers <rect fill="#000000" fill-opacity="0.00000" height="694.5156" width="8" x="346.834" y="122.4844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="350" x2="350" y1="122.4844" y2="817"/></g><g><title/><rect fill="#000000" fill-opacity="0.00000" height="694.5156" width="8" x="797.4092" y="122.4844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="800.9214" x2="800.9214" y1="122.4844" y2="817"/></g><g><title/><rect fill="#000000" fill-opacity="0.00000" height="694.5156" width="8" x="1212.9263" y="122.4844"/><line style="stroke:#181818;stroke-width:0.5;stroke-dasharray:5.0,5.0;" x1="1216.0146" x2="1216.0146" y1="122.4844" y2="817"/></g><g class="participant participant-head" data-participant="links"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="239.668" x="231" y="58.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="348.6089" y="78.5889"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="176.7158" x="264.7012" y="94.8857">RADV - SERVER/DAEMON</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="348.6089" y="111.1826"> </text></g><g class="participant participant-tail" data-participant="links"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="239.668" x="231" y="816"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="348.6089" y="835.9951"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="176.7158" x="264.7012" y="852.292">RADV - SERVER/DAEMON</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="348.6089" y="868.5889"> </text></g><g class="participant participant-head" data-participant="mitte"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="148.9756" x="726.9214" y="58.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="799.1841" y="78.5889"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="86.0234" x="760.6226" y="94.8857">Client / Host</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="799.1841" y="111.1826"> </text></g><g class="participant participant-tail" data-participant="mitte"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="148.9756" x="726.9214" y="816"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="799.1841" y="835.9951"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="86.0234" x="760.6226" y="852.292">Client / Host</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="799.1841" y="868.5889"> </text></g><g class="participant participant-head" data-participant="rechts"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="247.8232" x="1093.0146" y="58.5938"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="1214.7012" y="78.5889"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="193.7715" x="1126.7158" y="94.8857">DHCPv6 - SERVER/DAEMON</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="1214.7012" y="111.1826"> </text></g><g class="participant participant-tail" data-participant="rechts"><rect fill="#E2E2F0" height="62.8906" rx="2.5" ry="2.5" style="stroke:#181818;stroke-width:0.5;" width="247.8232" x="1093.0146" y="816"/><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="1214.7012" y="835.9951"> </text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="193.7715" x="1126.7158" y="852.292">DHCPv6 - SERVER/DAEMON</text><text fill="#000000" font-family="sans-serif" font-size="14" lengthadjust="spacing" textlength="4.4502" x="1214.7012" y="868.5889"> </text></g><g class="message" data-participant-1="mitte" data-participant-2="links"><polygon fill="#181818" points="361.834,175.3164,351.834,179.3164,361.834,183.3164,357.834,179.3164" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;stroke-dasharray:2.0,2.0;" x1="355.834" x2="800.4092" y1="179.3164" y2="179.3164"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="326.0347" x="367.834" y="174.2505">(Port 547) ROUTER SOLICITATION</text></g><path d="M806,137.4844 L806,207.4844 L1070,207.4844 L1070,147.4844 L1060,137.4844 L806,137.4844" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M1060,137.4844 L1060,147.4844 L1070,147.4844 L1060,137.4844" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="239.8208" x="812" y="154.5513">1. Der Hosts erkundigt sich mit einer</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="203.3979" x="828.5293" y="169.6841">Router Solicitation-Nachrichten</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="149.8682" x="828.5293" y="184.8169">nach Routern auf einer</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="195.7871" x="828.5293" y="199.9497">angeschlossenen Verbindung.</text><g class="message" data-participant-1="links" data-participant-2="mitte"><polygon fill="#181818" points="789.4092,255.8477,799.4092,259.8477,789.4092,263.8477,793.4092,259.8477" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;" x1="350.834" x2="795.4092" y1="259.8477" y2="259.8477"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="359.7852" x="357.834" y="254.7817">UNSOLICATED ROUTER ADVERTISEMENTS (Port 546)</text></g><path d="M7,218.0156 L7,288.0156 L345,288.0156 L345,228.0156 L335,218.0156 L7,218.0156" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M335,218.0156 L335,228.0156 L345,228.0156 L335,218.0156" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="243.6357" x="13" y="235.0825">2. Der Router gibt seine Anwesenheit</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="287.4536" x="29.5293" y="250.2153">zusammen mit verschiedenen Verbindungs-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="296.626" x="29.5293" y="265.3481">und Internet-Parametern als Antwort auf eine</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="249.3042" x="29.5293" y="280.481">Router-Solicitation-Nachricht bekannt.</text><g class="message" data-participant-1="mitte" data-participant-2="links"><polygon fill="#181818" points="361.834,336.3789,351.834,340.3789,361.834,344.3789,357.834,340.3789" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;stroke-dasharray:2.0,2.0;" x1="355.834" x2="800.4092" y1="340.3789" y2="340.3789"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="426.5752" x="367.834" y="335.313">(Port 547) SOLICIT an alle Router/DHCPv6 Server</text></g><path d="M806,298.5469 L806,368.5469 L1089,368.5469 L1089,308.5469 L1079,298.5469 L806,298.5469" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M1079,298.5469 L1079,308.5469 L1089,308.5469 L1079,298.5469" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="258.5845" x="812" y="315.6138">3. Der Host fordert mit dieser Nachricht</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="220.9238" x="828.5293" y="330.7466">Router Advertisements sofort und</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="227.1572" x="828.5293" y="345.8794">nicht erst zum nächsten geplanten</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="137.9282" x="816.1323" y="361.0122">Zeitpunkt zu senden.</text><g class="message" data-participant-1="links" data-participant-2="mitte"><polygon fill="#181818" points="789.4092,409.3438,799.4092,413.3438,789.4092,417.3438,793.4092,413.3438" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;" x1="350.834" x2="795.4092" y1="413.3438" y2="413.3438"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="343.751" x="357.834" y="408.2778">SOLICITED ROUTER ADVERTISEMENTS (Port 546)</text></g><path d="M5,379.0781 L5,434.0781 L345,434.0781 L345,389.0781 L335,379.0781 L5,379.0781" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M335,379.0781 L335,389.0781 L345,389.0781 L335,379.0781" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="319.8647" x="11" y="396.145">4. Der Router sendet gezielt an den anfragenden</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="297.7939" x="31.6616" y="411.2778">Host die zugehörigen Verbindungs- und Inter-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="98.376" x="31.6616" y="426.4106">net-Parameter.</text><g class="message" data-participant-1="mitte" data-participant-2="rechts"><polygon fill="#181818" points="1204.9263,474.7422,1214.9263,478.7422,1204.9263,482.7422,1208.9263,478.7422" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;" x1="801.4092" x2="1210.9263" y1="478.7422" y2="478.7422"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="391.5171" x="808.4092" y="473.6763">REQUEST bzw. INFORMATION REQUEST Unicast (Port 547)</text></g><path d="M424,444.4766 L424,499.4766 L795,499.4766 L795,454.4766 L785,444.4766 L424,444.4766" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M785,444.4766 L785,454.4766 L795,454.4766 L785,444.4766" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="340.6787" x="430" y="461.5435">5. Der Client sendet eine DHCPv6 SOLICIT-Nachricht</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="280.4268" x="450.6616" y="476.6763">an die all-dhcpv6-<span class="search_hit">servers</span> Multicast-Gruppe</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="338.1016" x="442.397" y="491.8091">FF02::1:2 und sucht so nach (s)einem DHCP-Server.</text><g class="message" data-participant-1="rechts" data-participant-2="mitte"><polygon fill="#181818" points="812.4092,540.1406,802.4092,544.1406,812.4092,548.1406,808.4092,544.1406" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;stroke-dasharray:2.0,2.0;" x1="806.4092" x2="1215.9263" y1="544.1406" y2="544.1406"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="378.7329" x="818.4092" y="539.0747">(Port 546) Antwort mit REQUESTED INFORMATION Unicast</text></g><path d="M1221,509.875 L1221,564.875 L1475,564.875 L1475,519.875 L1465,509.875 L1221,509.875" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M1465,509.875 L1465,519.875 L1475,519.875 L1465,509.875" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="233.9111" x="1227" y="526.9419">6. Bei DHCPv6 antwortet der Server</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="194.3652" x="1243.5293" y="542.0747">und teilt dem Client die ange-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="162.792" x="1243.5293" y="557.2075">forderten Parameter mit.</text><g class="message" data-participant-1="mitte" data-participant-2="rechts"><polygon fill="#181818" points="1204.9263,613.1055,1214.9263,617.1055,1204.9263,621.1055,1208.9263,617.1055" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;" x1="801.4092" x2="1210.9263" y1="617.1055" y2="617.1055"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="264.9766" x="808.4092" y="612.0396">DHCPv6-ADVERTISE Unicast (Port 547)</text></g><path d="M449,575.2734 L449,645.2734 L796,645.2734 L796,585.2734 L786,575.2734 L449,575.2734" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M786,575.2734 L786,585.2734 L796,585.2734 L786,575.2734" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="322.0864" x="455" y="592.3403">7. Bei DHCPv6 frägt der Client beim betreffenden</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="292.1763" x="475.6616" y="607.4731">DHCPv6-Server nach der IP-Adresse und ggf.</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="283.4546" x="475.6616" y="622.606">weiteren Parametern wie DNS oder Search-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="47.7852" x="471.5293" y="637.7388">-Listen.</text><g class="message" data-participant-1="rechts" data-participant-2="mitte"><polygon fill="#181818" points="812.4092,731.4688,802.4092,735.4688,812.4092,739.4688,808.4092,735.4688" style="stroke:#181818;stroke-width:1;"/><line style="stroke:#181818;stroke-width:1;stroke-dasharray:2.0,2.0;" x1="806.4092" x2="1215.9263" y1="735.4688" y2="735.4688"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="339.3774" x="818.4092" y="730.4028">(Port 546) Antwort mit REPLY INFORMATION Unicast</text></g><path d="M1221,655.8047 L1221,801.8047 L1487,801.8047 L1487,665.8047 L1477,655.8047 L1221,655.8047" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><path d="M1477,655.8047 L1477,665.8047 L1487,665.8047 L1477,655.8047" fill="#FEFFDD" style="stroke:#181818;stroke-width:0.5;"/><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="233.9111" x="1227" y="672.8716">8. Bei DHCPv6 antwortet der Server</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="194.3652" x="1243.5293" y="688.0044">und teilt dem Client die ange-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="162.792" x="1243.5293" y="703.1372">forderten Parameter mit.</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="4.1323" x="1227" y="718.27"> </text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="228.1919" x="1227" y="733.4028">9. Der Client sendet eine Duplicate</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="224.377" x="1243.5293" y="748.5356">Address Detection für die empfan-</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="186.1831" x="1243.5293" y="763.6685">gene UA- und GUA-Adresse</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="206.0576" x="1243.5293" y="778.8013">durch, um sicherzustellen, dass</text><text fill="#000000" font-family="sans-serif" font-size="13" lengthadjust="spacing" textlength="170.9297" x="1243.5293" y="793.9341">diese auch eindeutig sind.</text><!--SRC=[lLLBRzj64BxhLmnoYe6GRjp4QOKY06lHYH1RKad9G09VLkIGN8XS4hlB2F3loM_egJV_iSu-g8ShDsqFrK4lpknyZvbPpNMDWB9ewr8Ypog4Q5splW3MAqZf3mqvAhYgEGgjO8sSValur3PDB_Y6QTuAQBY9QY299dV1-UJZrUBhPP2Y_8fItOlHg6DIyuntJ6XuSI_0lamm1936oLsSd4-Y-7O-im_knGjW2cekDkfqgaC3v_2nLVemXu1eF9tZK9qew5Cb4bSr6jcoy4iGkCDW32yNhTJmzisxCtZ-bSnNopY1T7uplPeke-LqFXk9bl8bBqd3CRmEOKB26SIA1D_q8kUb1aKIM_sG2thiq2Pjh-b7sjP4GrkDWndBAcdyGE6Z1FtZGmKOomwFOA94bLLrgnGAIhb3kUOYxqKPUeh1-nt3rSpYZfRnP212viJ9Sfh6j_5icLgAWmwNPuvPZGM9FuOBnyo3BlcQM1ae48ajKlKAYPv3zT0hrZJeEiPqHrPnp9y0L86F9ebWAWmzrC62ITQWurehEbjl3Po1zv5omMdbg7itJ0WT_bUJlRiaBc6WkN7LVCE3Q_XZrt_Skmv5Asbqj9iMJif8s4CxCZxAwI3D5JPsw5HR67163k-yJI7vD2dQW7ZybbNAD4Q9NKrTxrha2-dUzM9ZWiWHGJg7y5VpFQc_jVvvyzyScM-hQ8BnmB7MHYSgIX-5PAK5uAVHwa4Q4B8IgyVVIQwdBR0pF_0vHqqGZXnyuk46bw0ayM-hE5t2-c4RmdHsFKzkxHpk7gn8D-OMnjxk0pfZWBUEZbymdexjhy5afrRmr3dBbGXHNmHvbNMq09LRW73RrzeM3Zx8lkjygrvV_t0n7hyUNrYcgZT7gTODzKjrPcesjgXVf0DZqxGxodjNTWDXkiiJ9aiFPV3qZnlqCeHVQQTxTimTWjekULTuFuiQUUqMlTV74gP5uoto3KvExdmoS4vvvU-8NQlz4s_U7K4jvEEtqk7qQEXkQkXDIomAsso3DKSNabFOf4qNGPHBf0LfsPLb4GuPMneTb8T416o9x6IMGkkaOJAhXaKLt70pVl_EeiNDv-_RyzF_O8yXSIz-Vhxp-uwsATF3Zerogng5Qypi_Lyy_Y5jDMowWeb15fffX5KKU7mVwEiWk0l8UnBn5T0ACzSWIheUDD9Y5QyWPrJ1HvbTIOkUR2CyEVQQbvGWyl1F]--></g></svg></div> </p> <p> Im Detail sind das folgende nacheinander folgende Schritte: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Der Hosts erkundigt sich mit einerRouter Solicitation-Nachrichtennach Routern auf einerangeschlossenen Verbindung, in dem er eine Router-Solicitation-Nachricht an die All-Router-Multicast-Adresse <strong><code>FF02::2</code></strong> sendet.</div> </li> <li class="level1"><div class="li"> Der Router generiert eine gibt eine Router-Advertisement-Nachricht, bei der jeweils das <strong><code>M-Flag</code></strong> = <strong><code>on</code></strong> und das <strong><code>A-Flag</code></strong> auf <strong><code>off</code></strong> gesetzt ist. Ferner reichert er diese <strong>RA</strong>-Nachricht noch um Verbindungs-Parameter wie Default-Routen an. Diese RA-Nachrichten wird an die All-Nodes-Multicast-Gruppe <strong><code>FF02::1</code></strong> gesendet und von allen Nachbarn auf einem lokalen Segment empfangen.</div> </li> <li class="level1"><div class="li"> Der Host fordert mit dieser NachrichtRouter Advertisements sofort und nicht erst zum nächsten geplanten Zeitpunkt zu senden.</div> </li> <li class="level1"><div class="li"> Der Router sendet gezielt an den anfragenden Host die zugehörigen Verbindungs- und Internet-Parameter. Nach dem Empfang des Route Advertisements setzt Client die Quell-IPv6-Adresse von Router <strong><code>FE80::1</code></strong> als Standardgateway. Da das <strong><code>A-Flag</code></strong> auf <strong><code>off</code></strong> gesetzt ist, führt der Client <strong><em class="u">keine</em></strong> Stateless Address Auto-Configuration (SLAAC) durch.</div> </li> <li class="level1"><div class="li"> Da in der RA-Nachricht das <strong><code>M-Flag</code></strong> auf <strong><code>on</code></strong> gesetzt ist, sendet der Client eine DHCPv6 SOLICIT-Nachricht an die <strong><code>all-dhcpv6-<span class="search_hit">servers</span></code></strong> Multicast-Gruppe <strong><code>FF02::1:2</code></strong> und sucht so nach (s)einem DHCP-Server.</div> </li> <li class="level1"><div class="li"> Nach Erhalt der Solicit-Nachricht antwortet der Server mit einer DHCPv6-ADVERTISE-Nachricht. Sie ist direkt als Unicast an die link-local-Adresse des Clients gerichtet.</div> </li> <li class="level1"><div class="li"> Der Client weiss nun, dass es einen DHCPv6-Daemon im Netzwerk gibt und sendet ein REQUEST-Paket an den DHCPv6-Daemon und bitten so um entsprechende Adressierungsinformationen.</div> </li> <li class="level1"><div class="li"> Nach dem Empfang des REQUEST-Pakets antwortet der Server mit einem DHCPv6 REPLY-Paket, welches u.a. die globale Unicast-Adresse und alle weiteren Informationen enthält.</div> </li> <li class="level1"><div class="li"> Am Ende führt der Client dann noch eine <strong>DAD</strong><sup><a href="#fn__7" id="fnt__7" class="fn_top">7)</a></sup> für die empfangene LUA- und GUA-Adresse durch, um sicherzustellen, dass diese auch eindeutig sind.</div> </li> </ol> </div> <h2 class="sectionedit9 page-header pb-3 mb-4 mt-5" id="installation_und_konfiguration_des_kea-dhcp-servers">Installation und Konfiguration des Kea-DHCP-<span class="search_hit">Servers</span></h2> <div class="level2"> </div> <h3 class="sectionedit10 page-header pb-3 mb-4 mt-5" id="dokumentation">Dokumentation</h3> <div class="level3"> <p> Eine ausführliche Onlinedokumentation des <strong><a href="https://www.isc.org/kea/" class="urlextern" target="_tab" title="https://www.isc.org/kea/" rel="ugc nofollow noopener">modernen Open Source DHCPv4 & DHCPv6 Server Kea</a></strong> findet sich auf der entsprechenden Dokumentationsseite bei <strong><a href="https://about.readthedocs.com/" class="urlextern" target="_tab" title="https://about.readthedocs.com/" rel="ugc nofollow noopener">Read the Docs</a></strong> → <a href="https://kea.readthedocs.io/en/latest/" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/" rel="ugc nofollow noopener">https://kea.readthedocs.io/en/latest/</a> . </p> </div> <h3 class="sectionedit11 page-header pb-3 mb-4 mt-5" id="paketinstallation">Paketinstallation</h3> <div class="level3"> <p> Die Installation und Konfiguration des DHCP-<span class="search_hit">Servers</span> gestaltet sich relativ einfach. Bei der Installation des Kea-Paketes verwenden wir unter <strong><a href="https://archlinux.org/" class="urlextern" target="_tab" title="https://archlinux.org/" rel="ugc nofollow noopener">Arch Linux</a></strong> den Paketmanager <strong><code>pacman</code></strong>. </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Als User: <pre class="code"> $ sudo pacman -S kea</pre> </div> </li> <li class="level1"><div class="li"> Als Nutzer mit Root-Rechten entsprechend: <pre class="code"> # pacman -S kea</pre> </div> </li> </ol> <p> Was uns das Paket <strong>kea</strong> alles in das System unseres Arch Linux Server gebracht hat, können wir wie folgt abfragen: </p> <pre class="code"> # pacman -Qil kea</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_1">Paketinhalte </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_1"><pre class="code">Name : kea Version : 2.6.1-1 Description : High-performance, extensible DHCP server engine from ISC, supporting both DHCPv4 and DHCPv6 Architecture : x86_64 URL : https://kea.isc.org Licenses : MPL-2.0 Groups : None Provides : None Depends On : log4cplus mariadb-libs openssl postgresql-libs Optional Deps : mariadb: lease information database postgresql: lease information database python: to use kea-shell [installed] krb5: Kerberos support [installed] kea-docs: user and developer documentation Required By : None Optional For : None Conflicts With : None Replaces : None Installed Size : 22.81 MiB Packager : Robin Candau <antiz@archlinux.org> Build Date : Wed 31 Jul 2024 10:21:28 AM CEST Install Date : Wed 09 Oct 2024 07:27:55 PM CEST Install Reason : Explicitly installed Install Script : No Validated By : Signature kea /etc/ kea /etc/kea/ kea /etc/kea/kea-ctrl-agent.conf kea /etc/kea/kea-dhcp-ddns.conf kea /etc/kea/kea-dhcp4.conf kea /etc/kea/kea-dhcp6.conf kea /etc/kea/keactrl.conf kea /usr/ kea /usr/bin/ kea /usr/bin/kea-admin kea /usr/bin/kea-ctrl-agent kea /usr/bin/kea-dhcp-ddns kea /usr/bin/kea-dhcp4 kea /usr/bin/kea-dhcp6 kea /usr/bin/kea-lfc kea /usr/bin/kea-msg-compiler kea /usr/bin/kea-shell kea /usr/bin/keactrl kea /usr/bin/perfdhcp kea /usr/include/ kea /usr/include/kea/ kea /usr/include/kea/asiodns/ kea /usr/include/kea/asiodns/asiodns_messages.h kea /usr/include/kea/asiodns/io_fetch.h kea /usr/include/kea/asiodns/logger.h kea /usr/include/kea/asiolink/ kea /usr/include/kea/asiolink/addr_utilities.h kea /usr/include/kea/asiolink/asio_wrapper.h kea /usr/include/kea/asiolink/asiolink.h kea /usr/include/kea/asiolink/botan_boost_tls.h kea /usr/include/kea/asiolink/botan_boost_wrapper.h kea /usr/include/kea/asiolink/botan_tls.h kea /usr/include/kea/asiolink/common_tls.h kea /usr/include/kea/asiolink/crypto_tls.h kea /usr/include/kea/asiolink/dummy_io_cb.h kea /usr/include/kea/asiolink/interval_timer.h kea /usr/include/kea/asiolink/io_acceptor.h kea /usr/include/kea/asiolink/io_address.h kea /usr/include/kea/asiolink/io_asio_socket.h kea /usr/include/kea/asiolink/io_endpoint.h kea /usr/include/kea/asiolink/io_error.h kea /usr/include/kea/asiolink/io_service.h kea /usr/include/kea/asiolink/io_service_mgr.h kea /usr/include/kea/asiolink/io_service_signal.h kea /usr/include/kea/asiolink/io_service_thread_pool.h kea /usr/include/kea/asiolink/io_socket.h kea /usr/include/kea/asiolink/openssl_tls.h kea /usr/include/kea/asiolink/process_spawn.h kea /usr/include/kea/asiolink/tcp_acceptor.h kea /usr/include/kea/asiolink/tcp_endpoint.h kea /usr/include/kea/asiolink/tcp_socket.h kea /usr/include/kea/asiolink/tls_acceptor.h kea /usr/include/kea/asiolink/tls_socket.h kea /usr/include/kea/asiolink/udp_endpoint.h kea /usr/include/kea/asiolink/udp_socket.h kea /usr/include/kea/asiolink/unix_domain_socket.h kea /usr/include/kea/asiolink/unix_domain_socket_acceptor.h kea /usr/include/kea/asiolink/unix_domain_socket_endpoint.h kea /usr/include/kea/cc/ kea /usr/include/kea/cc/base_stamped_element.h kea /usr/include/kea/cc/cfg_to_element.h kea /usr/include/kea/cc/command_interpreter.h kea /usr/include/kea/cc/data.h kea /usr/include/kea/cc/dhcp_config_error.h kea /usr/include/kea/cc/element_value.h kea /usr/include/kea/cc/json_feed.h kea /usr/include/kea/cc/server_tag.h kea /usr/include/kea/cc/simple_parser.h kea /usr/include/kea/cc/stamped_element.h kea /usr/include/kea/cc/stamped_value.h kea /usr/include/kea/cc/user_context.h kea /usr/include/kea/cfgrpt/ kea /usr/include/kea/cfgrpt/config_report.h kea /usr/include/kea/config.h kea /usr/include/kea/config/ kea /usr/include/kea/config/base_command_mgr.h kea /usr/include/kea/config/client_connection.h kea /usr/include/kea/config/cmd_http_listener.h kea /usr/include/kea/config/cmd_response_creator.h kea /usr/include/kea/config/cmd_response_creator_factory.h kea /usr/include/kea/config/cmds_impl.h kea /usr/include/kea/config/command_mgr.h kea /usr/include/kea/config/config_log.h kea /usr/include/kea/config/config_messages.h kea /usr/include/kea/config/hooked_command_mgr.h kea /usr/include/kea/config/timeouts.h kea /usr/include/kea/config_backend/ kea /usr/include/kea/config_backend/base_config_backend.h kea /usr/include/kea/config_backend/base_config_backend_mgr.h kea /usr/include/kea/config_backend/base_config_backend_pool.h kea /usr/include/kea/config_backend/constants.h kea /usr/include/kea/cryptolink/ kea /usr/include/kea/cryptolink/crypto_hash.h kea /usr/include/kea/cryptolink/crypto_hmac.h kea /usr/include/kea/cryptolink/crypto_rng.h kea /usr/include/kea/cryptolink/cryptolink.h kea /usr/include/kea/cryptolink/openssl_common.h kea /usr/include/kea/cryptolink/openssl_compat.h kea /usr/include/kea/d2srv/ kea /usr/include/kea/d2srv/d2_cfg_mgr.h kea /usr/include/kea/d2srv/d2_config.h kea /usr/include/kea/d2srv/d2_log.h kea /usr/include/kea/d2srv/d2_messages.h kea /usr/include/kea/d2srv/d2_simple_parser.h kea /usr/include/kea/d2srv/d2_stats.h kea /usr/include/kea/d2srv/d2_tsig_key.h kea /usr/include/kea/d2srv/d2_update_message.h kea /usr/include/kea/d2srv/d2_zone.h kea /usr/include/kea/d2srv/dns_client.h kea /usr/include/kea/d2srv/nc_trans.h kea /usr/include/kea/database/ kea /usr/include/kea/database/audit_entry.h kea /usr/include/kea/database/backend_selector.h kea /usr/include/kea/database/database_connection.h kea /usr/include/kea/database/db_exceptions.h kea /usr/include/kea/database/db_log.h kea /usr/include/kea/database/db_messages.h kea /usr/include/kea/database/dbaccess_parser.h kea /usr/include/kea/database/server.h kea /usr/include/kea/database/server_collection.h kea /usr/include/kea/database/server_selector.h kea /usr/include/kea/dhcp/ kea /usr/include/kea/dhcp/classify.h kea /usr/include/kea/dhcp/dhcp4.h kea /usr/include/kea/dhcp/dhcp6.h kea /usr/include/kea/dhcp/docsis3_option_defs.h kea /usr/include/kea/dhcp/duid.h kea /usr/include/kea/dhcp/duid_factory.h kea /usr/include/kea/dhcp/hwaddr.h kea /usr/include/kea/dhcp/iface_mgr.h kea /usr/include/kea/dhcp/iface_mgr_error_handler.h kea /usr/include/kea/dhcp/libdhcp++.h kea /usr/include/kea/dhcp/opaque_data_tuple.h kea /usr/include/kea/dhcp/option.h kea /usr/include/kea/dhcp/option4_addrlst.h kea /usr/include/kea/dhcp/option4_client_fqdn.h kea /usr/include/kea/dhcp/option4_dnr.h kea /usr/include/kea/dhcp/option6_addrlst.h kea /usr/include/kea/dhcp/option6_auth.h kea /usr/include/kea/dhcp/option6_client_fqdn.h kea /usr/include/kea/dhcp/option6_dnr.h kea /usr/include/kea/dhcp/option6_ia.h kea /usr/include/kea/dhcp/option6_iaaddr.h kea /usr/include/kea/dhcp/option6_iaprefix.h kea /usr/include/kea/dhcp/option6_pdexclude.h kea /usr/include/kea/dhcp/option6_status_code.h kea /usr/include/kea/dhcp/option_classless_static_route.h kea /usr/include/kea/dhcp/option_custom.h kea /usr/include/kea/dhcp/option_data_types.h kea /usr/include/kea/dhcp/option_definition.h kea /usr/include/kea/dhcp/option_int.h kea /usr/include/kea/dhcp/option_int_array.h kea /usr/include/kea/dhcp/option_opaque_data_tuples.h kea /usr/include/kea/dhcp/option_space.h kea /usr/include/kea/dhcp/option_space_container.h kea /usr/include/kea/dhcp/option_string.h kea /usr/include/kea/dhcp/option_vendor.h kea /usr/include/kea/dhcp/option_vendor_class.h kea /usr/include/kea/dhcp/packet_queue.h kea /usr/include/kea/dhcp/packet_queue_mgr.h kea /usr/include/kea/dhcp/packet_queue_mgr4.h kea /usr/include/kea/dhcp/packet_queue_mgr6.h kea /usr/include/kea/dhcp/packet_queue_ring.h kea /usr/include/kea/dhcp/pkt.h kea /usr/include/kea/dhcp/pkt4.h kea /usr/include/kea/dhcp/pkt4o6.h kea /usr/include/kea/dhcp/pkt6.h kea /usr/include/kea/dhcp/pkt_filter.h kea /usr/include/kea/dhcp/pkt_filter6.h kea /usr/include/kea/dhcp/pkt_filter_inet.h kea /usr/include/kea/dhcp/pkt_filter_inet6.h kea /usr/include/kea/dhcp/pkt_filter_lpf.h kea /usr/include/kea/dhcp/pkt_template.h kea /usr/include/kea/dhcp/protocol_util.h kea /usr/include/kea/dhcp/socket_info.h kea /usr/include/kea/dhcp/std_option_defs.h kea /usr/include/kea/dhcp_ddns/ kea /usr/include/kea/dhcp_ddns/dhcp_ddns_log.h kea /usr/include/kea/dhcp_ddns/dhcp_ddns_messages.h kea /usr/include/kea/dhcp_ddns/ncr_io.h kea /usr/include/kea/dhcp_ddns/ncr_msg.h kea /usr/include/kea/dhcp_ddns/ncr_udp.h kea /usr/include/kea/dhcpsrv/ kea /usr/include/kea/dhcpsrv/alloc_engine.h kea /usr/include/kea/dhcpsrv/alloc_engine_log.h kea /usr/include/kea/dhcpsrv/alloc_engine_messages.h kea /usr/include/kea/dhcpsrv/allocation_state.h kea /usr/include/kea/dhcpsrv/allocator.h kea /usr/include/kea/dhcpsrv/base_host_data_source.h kea /usr/include/kea/dhcpsrv/cache_host_data_source.h kea /usr/include/kea/dhcpsrv/callout_handle_store.h kea /usr/include/kea/dhcpsrv/cb_ctl_dhcp.h kea /usr/include/kea/dhcpsrv/cb_ctl_dhcp4.h kea /usr/include/kea/dhcpsrv/cb_ctl_dhcp6.h kea /usr/include/kea/dhcpsrv/cfg_4o6.h kea /usr/include/kea/dhcpsrv/cfg_consistency.h kea /usr/include/kea/dhcpsrv/cfg_db_access.h kea /usr/include/kea/dhcpsrv/cfg_duid.h kea /usr/include/kea/dhcpsrv/cfg_expiration.h kea /usr/include/kea/dhcpsrv/cfg_globals.h kea /usr/include/kea/dhcpsrv/cfg_host_operations.h kea /usr/include/kea/dhcpsrv/cfg_hosts.h kea /usr/include/kea/dhcpsrv/cfg_hosts_util.h kea /usr/include/kea/dhcpsrv/cfg_iface.h kea /usr/include/kea/dhcpsrv/cfg_mac_source.h kea /usr/include/kea/dhcpsrv/cfg_multi_threading.h kea /usr/include/kea/dhcpsrv/cfg_option.h kea /usr/include/kea/dhcpsrv/cfg_option_def.h kea /usr/include/kea/dhcpsrv/cfg_rsoo.h kea /usr/include/kea/dhcpsrv/cfg_shared_networks.h kea /usr/include/kea/dhcpsrv/cfg_subnets4.h kea /usr/include/kea/dhcpsrv/cfg_subnets6.h kea /usr/include/kea/dhcpsrv/cfgmgr.h kea /usr/include/kea/dhcpsrv/client_class_def.h kea /usr/include/kea/dhcpsrv/config_backend_dhcp4.h kea /usr/include/kea/dhcpsrv/config_backend_dhcp4_mgr.h kea /usr/include/kea/dhcpsrv/config_backend_dhcp6.h kea /usr/include/kea/dhcpsrv/config_backend_dhcp6_mgr.h kea /usr/include/kea/dhcpsrv/config_backend_pool_dhcp4.h kea /usr/include/kea/dhcpsrv/config_backend_pool_dhcp6.h kea /usr/include/kea/dhcpsrv/csv_lease_file4.h kea /usr/include/kea/dhcpsrv/csv_lease_file6.h kea /usr/include/kea/dhcpsrv/d2_client_cfg.h kea /usr/include/kea/dhcpsrv/d2_client_mgr.h kea /usr/include/kea/dhcpsrv/db_type.h kea /usr/include/kea/dhcpsrv/dhcp4o6_ipc.h kea /usr/include/kea/dhcpsrv/dhcpsrv_exceptions.h kea /usr/include/kea/dhcpsrv/dhcpsrv_log.h kea /usr/include/kea/dhcpsrv/dhcpsrv_messages.h kea /usr/include/kea/dhcpsrv/flq_allocation_state.h kea /usr/include/kea/dhcpsrv/flq_allocator.h kea /usr/include/kea/dhcpsrv/host.h kea /usr/include/kea/dhcpsrv/host_container.h kea /usr/include/kea/dhcpsrv/host_data_source_factory.h kea /usr/include/kea/dhcpsrv/host_mgr.h kea /usr/include/kea/dhcpsrv/hosts_log.h kea /usr/include/kea/dhcpsrv/hosts_messages.h kea /usr/include/kea/dhcpsrv/ip_range.h kea /usr/include/kea/dhcpsrv/ip_range_permutation.h kea /usr/include/kea/dhcpsrv/iterative_allocation_state.h kea /usr/include/kea/dhcpsrv/iterative_allocator.h kea /usr/include/kea/dhcpsrv/key_from_key.h kea /usr/include/kea/dhcpsrv/lease.h kea /usr/include/kea/dhcpsrv/lease_file_loader.h kea /usr/include/kea/dhcpsrv/lease_file_stats.h kea /usr/include/kea/dhcpsrv/lease_mgr.h kea /usr/include/kea/dhcpsrv/lease_mgr_factory.h kea /usr/include/kea/dhcpsrv/memfile_lease_limits.h kea /usr/include/kea/dhcpsrv/memfile_lease_mgr.h kea /usr/include/kea/dhcpsrv/memfile_lease_storage.h kea /usr/include/kea/dhcpsrv/mysql_host_data_source.h kea /usr/include/kea/dhcpsrv/mysql_lease_mgr.h kea /usr/include/kea/dhcpsrv/ncr_generator.h kea /usr/include/kea/dhcpsrv/network.h kea /usr/include/kea/dhcpsrv/network_state.h kea /usr/include/kea/dhcpsrv/parsers/ kea /usr/include/kea/dhcpsrv/parsers/base_network_parser.h kea /usr/include/kea/dhcpsrv/parsers/client_class_def_parser.h kea /usr/include/kea/dhcpsrv/parsers/dhcp_parsers.h kea /usr/include/kea/dhcpsrv/parsers/dhcp_queue_control_parser.h kea /usr/include/kea/dhcpsrv/parsers/duid_config_parser.h kea /usr/include/kea/dhcpsrv/parsers/expiration_config_parser.h kea /usr/include/kea/dhcpsrv/parsers/host_reservation_parser.h kea /usr/include/kea/dhcpsrv/parsers/host_reservations_list_parser.h kea /usr/include/kea/dhcpsrv/parsers/ifaces_config_parser.h kea /usr/include/kea/dhcpsrv/parsers/multi_threading_config_parser.h kea /usr/include/kea/dhcpsrv/parsers/option_data_parser.h kea /usr/include/kea/dhcpsrv/parsers/sanity_checks_parser.h kea /usr/include/kea/dhcpsrv/parsers/shared_network_parser.h kea /usr/include/kea/dhcpsrv/parsers/shared_networks_list_parser.h kea /usr/include/kea/dhcpsrv/parsers/simple_parser4.h kea /usr/include/kea/dhcpsrv/parsers/simple_parser6.h kea /usr/include/kea/dhcpsrv/pgsql_host_data_source.h kea /usr/include/kea/dhcpsrv/pgsql_lease_mgr.h kea /usr/include/kea/dhcpsrv/pool.h kea /usr/include/kea/dhcpsrv/random_allocation_state.h kea /usr/include/kea/dhcpsrv/random_allocator.h kea /usr/include/kea/dhcpsrv/resource_handler.h kea /usr/include/kea/dhcpsrv/sanity_checker.h kea /usr/include/kea/dhcpsrv/shared_network.h kea /usr/include/kea/dhcpsrv/srv_config.h kea /usr/include/kea/dhcpsrv/subnet.h kea /usr/include/kea/dhcpsrv/subnet_id.h kea /usr/include/kea/dhcpsrv/subnet_selector.h kea /usr/include/kea/dhcpsrv/timer_mgr.h kea /usr/include/kea/dhcpsrv/tracking_lease_mgr.h kea /usr/include/kea/dhcpsrv/utils.h kea /usr/include/kea/dhcpsrv/writable_host_data_source.h kea /usr/include/kea/dns/ kea /usr/include/kea/dns/char_string.h kea /usr/include/kea/dns/edns.h kea /usr/include/kea/dns/exceptions.h kea /usr/include/kea/dns/labelsequence.h kea /usr/include/kea/dns/master_lexer.h kea /usr/include/kea/dns/master_lexer_inputsource.h kea /usr/include/kea/dns/master_lexer_state.h kea /usr/include/kea/dns/master_loader.h kea /usr/include/kea/dns/master_loader_callbacks.h kea /usr/include/kea/dns/message.h kea /usr/include/kea/dns/messagerenderer.h kea /usr/include/kea/dns/name.h kea /usr/include/kea/dns/opcode.h kea /usr/include/kea/dns/question.h kea /usr/include/kea/dns/rcode.h kea /usr/include/kea/dns/rdata.h kea /usr/include/kea/dns/rdataclass.h kea /usr/include/kea/dns/rrclass.h kea /usr/include/kea/dns/rrparamregistry.h kea /usr/include/kea/dns/rrset.h kea /usr/include/kea/dns/rrttl.h kea /usr/include/kea/dns/rrtype.h kea /usr/include/kea/dns/serial.h kea /usr/include/kea/dns/time_utils.h kea /usr/include/kea/dns/tsig.h kea /usr/include/kea/dns/tsigerror.h kea /usr/include/kea/dns/tsigkey.h kea /usr/include/kea/dns/tsigrecord.h kea /usr/include/kea/dns/txt_like.h kea /usr/include/kea/eval/ kea /usr/include/kea/eval/dependency.h kea /usr/include/kea/eval/eval_context.h kea /usr/include/kea/eval/eval_context_decl.h kea /usr/include/kea/eval/eval_log.h kea /usr/include/kea/eval/eval_messages.h kea /usr/include/kea/eval/evaluate.h kea /usr/include/kea/eval/parser.h kea /usr/include/kea/eval/token.h kea /usr/include/kea/exceptions/ kea /usr/include/kea/exceptions/exceptions.h kea /usr/include/kea/exceptions/isc_assert.h kea /usr/include/kea/hooks/ kea /usr/include/kea/hooks/callout_handle.h kea /usr/include/kea/hooks/callout_handle_associate.h kea /usr/include/kea/hooks/callout_manager.h kea /usr/include/kea/hooks/hooks.h kea /usr/include/kea/hooks/hooks_config.h kea /usr/include/kea/hooks/hooks_log.h kea /usr/include/kea/hooks/hooks_manager.h kea /usr/include/kea/hooks/hooks_messages.h kea /usr/include/kea/hooks/hooks_parser.h kea /usr/include/kea/hooks/libinfo.h kea /usr/include/kea/hooks/library_handle.h kea /usr/include/kea/hooks/library_manager.h kea /usr/include/kea/hooks/library_manager_collection.h kea /usr/include/kea/hooks/parking_lots.h kea /usr/include/kea/hooks/pointer_converter.h kea /usr/include/kea/hooks/server_hooks.h kea /usr/include/kea/http/ kea /usr/include/kea/http/auth_config.h kea /usr/include/kea/http/auth_log.h kea /usr/include/kea/http/auth_messages.h kea /usr/include/kea/http/basic_auth.h kea /usr/include/kea/http/basic_auth_config.h kea /usr/include/kea/http/client.h kea /usr/include/kea/http/connection.h kea /usr/include/kea/http/connection_pool.h kea /usr/include/kea/http/date_time.h kea /usr/include/kea/http/header_context.h kea /usr/include/kea/http/http_acceptor.h kea /usr/include/kea/http/http_header.h kea /usr/include/kea/http/http_log.h kea /usr/include/kea/http/http_message.h kea /usr/include/kea/http/http_message_parser_base.h kea /usr/include/kea/http/http_messages.h kea /usr/include/kea/http/http_types.h kea /usr/include/kea/http/listener.h kea /usr/include/kea/http/listener_impl.h kea /usr/include/kea/http/post_request.h kea /usr/include/kea/http/post_request_json.h kea /usr/include/kea/http/request.h kea /usr/include/kea/http/request_context.h kea /usr/include/kea/http/request_parser.h kea /usr/include/kea/http/response.h kea /usr/include/kea/http/response_context.h kea /usr/include/kea/http/response_creator.h kea /usr/include/kea/http/response_creator_factory.h kea /usr/include/kea/http/response_json.h kea /usr/include/kea/http/response_parser.h kea /usr/include/kea/http/url.h kea /usr/include/kea/kea_version.h kea /usr/include/kea/log/ kea /usr/include/kea/log/buffer_appender_impl.h kea /usr/include/kea/log/interprocess/ kea /usr/include/kea/log/interprocess/interprocess_sync.h kea /usr/include/kea/log/interprocess/interprocess_sync_file.h kea /usr/include/kea/log/interprocess/interprocess_sync_null.h kea /usr/include/kea/log/log_dbglevels.h kea /usr/include/kea/log/log_formatter.h kea /usr/include/kea/log/log_messages.h kea /usr/include/kea/log/logger.h kea /usr/include/kea/log/logger_impl.h kea /usr/include/kea/log/logger_level.h kea /usr/include/kea/log/logger_level_impl.h kea /usr/include/kea/log/logger_manager.h kea /usr/include/kea/log/logger_manager_impl.h kea /usr/include/kea/log/logger_name.h kea /usr/include/kea/log/logger_specification.h kea /usr/include/kea/log/logger_support.h kea /usr/include/kea/log/logger_unittest_support.h kea /usr/include/kea/log/logimpl_messages.h kea /usr/include/kea/log/macros.h kea /usr/include/kea/log/message_dictionary.h kea /usr/include/kea/log/message_exception.h kea /usr/include/kea/log/message_initializer.h kea /usr/include/kea/log/message_reader.h kea /usr/include/kea/log/message_types.h kea /usr/include/kea/log/output_option.h kea /usr/include/kea/mysql/ kea /usr/include/kea/mysql/mysql_binding.h kea /usr/include/kea/mysql/mysql_connection.h kea /usr/include/kea/mysql/mysql_constants.h kea /usr/include/kea/pgsql/ kea /usr/include/kea/pgsql/pgsql_connection.h kea /usr/include/kea/pgsql/pgsql_exchange.h kea /usr/include/kea/process/ kea /usr/include/kea/process/cb_ctl_base.h kea /usr/include/kea/process/config_base.h kea /usr/include/kea/process/config_ctl_info.h kea /usr/include/kea/process/config_ctl_parser.h kea /usr/include/kea/process/d_cfg_mgr.h kea /usr/include/kea/process/d_controller.h kea /usr/include/kea/process/d_log.h kea /usr/include/kea/process/d_process.h kea /usr/include/kea/process/daemon.h kea /usr/include/kea/process/log_parser.h kea /usr/include/kea/process/logging_info.h kea /usr/include/kea/process/process_messages.h kea /usr/include/kea/process/redact_config.h kea /usr/include/kea/stats/ kea /usr/include/kea/stats/context.h kea /usr/include/kea/stats/observation.h kea /usr/include/kea/stats/stats_mgr.h kea /usr/include/kea/tcp/ kea /usr/include/kea/tcp/mt_tcp_listener_mgr.h kea /usr/include/kea/tcp/tcp_connection.h kea /usr/include/kea/tcp/tcp_connection_acceptor.h kea /usr/include/kea/tcp/tcp_connection_pool.h kea /usr/include/kea/tcp/tcp_listener.h kea /usr/include/kea/tcp/tcp_log.h kea /usr/include/kea/tcp/tcp_messages.h kea /usr/include/kea/tcp/tcp_stream_msg.h kea /usr/include/kea/util/ kea /usr/include/kea/util/bigints.h kea /usr/include/kea/util/boost_time_utils.h kea /usr/include/kea/util/buffer.h kea /usr/include/kea/util/chrono_time_utils.h kea /usr/include/kea/util/csv_file.h kea /usr/include/kea/util/dhcp_space.h kea /usr/include/kea/util/doubles.h kea /usr/include/kea/util/encode/ kea /usr/include/kea/util/encode/encode.h kea /usr/include/kea/util/encode/utf8.h kea /usr/include/kea/util/filesystem.h kea /usr/include/kea/util/hash.h kea /usr/include/kea/util/io.h kea /usr/include/kea/util/io/ kea /usr/include/kea/util/io/fd.h kea /usr/include/kea/util/io/pktinfo_utilities.h kea /usr/include/kea/util/io/sockaddr_util.h kea /usr/include/kea/util/labeled_value.h kea /usr/include/kea/util/memory_segment.h kea /usr/include/kea/util/memory_segment_local.h kea /usr/include/kea/util/multi_threading_mgr.h kea /usr/include/kea/util/optional.h kea /usr/include/kea/util/pid_file.h kea /usr/include/kea/util/pointer_util.h kea /usr/include/kea/util/range_utilities.h kea /usr/include/kea/util/readwrite_mutex.h kea /usr/include/kea/util/reconnect_ctl.h kea /usr/include/kea/util/staged_value.h kea /usr/include/kea/util/state_model.h kea /usr/include/kea/util/stopwatch.h kea /usr/include/kea/util/stopwatch_impl.h kea /usr/include/kea/util/str.h kea /usr/include/kea/util/thread_pool.h kea /usr/include/kea/util/triplet.h kea /usr/include/kea/util/unlock_guard.h kea /usr/include/kea/util/versioned_csv_file.h kea /usr/include/kea/util/watch_socket.h kea /usr/include/kea/util/watched_thread.h kea /usr/lib/ kea /usr/lib/kea/ kea /usr/lib/kea/hooks/ kea /usr/lib/kea/hooks/libdhcp_bootp.so kea /usr/lib/kea/hooks/libdhcp_flex_option.so kea /usr/lib/kea/hooks/libdhcp_ha.so kea /usr/lib/kea/hooks/libdhcp_lease_cmds.so kea /usr/lib/kea/hooks/libdhcp_mysql_cb.so kea /usr/lib/kea/hooks/libdhcp_perfmon.so kea /usr/lib/kea/hooks/libdhcp_pgsql_cb.so kea /usr/lib/kea/hooks/libdhcp_run_script.so kea /usr/lib/kea/hooks/libdhcp_stat_cmds.so kea /usr/lib/libkea-asiodns.so kea /usr/lib/libkea-asiodns.so.48 kea /usr/lib/libkea-asiodns.so.48.0.0 kea /usr/lib/libkea-asiolink.so kea /usr/lib/libkea-asiolink.so.71 kea /usr/lib/libkea-asiolink.so.71.0.0 kea /usr/lib/libkea-cc.so kea /usr/lib/libkea-cc.so.68 kea /usr/lib/libkea-cc.so.68.0.0 kea /usr/lib/libkea-cfgclient.so kea /usr/lib/libkea-cfgclient.so.65 kea /usr/lib/libkea-cfgclient.so.65.0.0 kea /usr/lib/libkea-cryptolink.so kea /usr/lib/libkea-cryptolink.so.50 kea /usr/lib/libkea-cryptolink.so.50.0.0 kea /usr/lib/libkea-d2srv.so kea /usr/lib/libkea-d2srv.so.46 kea /usr/lib/libkea-d2srv.so.46.0.0 kea /usr/lib/libkea-database.so kea /usr/lib/libkea-database.so.61 kea /usr/lib/libkea-database.so.61.0.0 kea /usr/lib/libkea-dhcp++.so kea /usr/lib/libkea-dhcp++.so.90 kea /usr/lib/libkea-dhcp++.so.90.0.0 kea /usr/lib/libkea-dhcp_ddns.so kea /usr/lib/libkea-dhcp_ddns.so.56 kea /usr/lib/libkea-dhcp_ddns.so.56.0.0 kea /usr/lib/libkea-dhcpsrv.so kea /usr/lib/libkea-dhcpsrv.so.109 kea /usr/lib/libkea-dhcpsrv.so.109.0.0 kea /usr/lib/libkea-dns++.so kea /usr/lib/libkea-dns++.so.56 kea /usr/lib/libkea-dns++.so.56.0.0 kea /usr/lib/libkea-eval.so kea /usr/lib/libkea-eval.so.69 kea /usr/lib/libkea-eval.so.69.0.0 kea /usr/lib/libkea-exceptions.so kea /usr/lib/libkea-exceptions.so.33 kea /usr/lib/libkea-exceptions.so.33.0.0 kea /usr/lib/libkea-hooks.so kea /usr/lib/libkea-hooks.so.98 kea /usr/lib/libkea-hooks.so.98.0.0 kea /usr/lib/libkea-http.so kea /usr/lib/libkea-http.so.71 kea /usr/lib/libkea-http.so.71.0.0 kea /usr/lib/libkea-log.so kea /usr/lib/libkea-log.so.61 kea /usr/lib/libkea-log.so.61.0.0 kea /usr/lib/libkea-mysql.so kea /usr/lib/libkea-mysql.so.70 kea /usr/lib/libkea-mysql.so.70.0.0 kea /usr/lib/libkea-pgsql.so kea /usr/lib/libkea-pgsql.so.70 kea /usr/lib/libkea-pgsql.so.70.0.0 kea /usr/lib/libkea-process.so kea /usr/lib/libkea-process.so.72 kea /usr/lib/libkea-process.so.72.0.0 kea /usr/lib/libkea-stats.so kea /usr/lib/libkea-stats.so.41 kea /usr/lib/libkea-stats.so.41.0.0 kea /usr/lib/libkea-tcp.so kea /usr/lib/libkea-tcp.so.18 kea /usr/lib/libkea-tcp.so.18.0.0 kea /usr/lib/libkea-util-io.so kea /usr/lib/libkea-util-io.so.0 kea /usr/lib/libkea-util-io.so.0.0.1 kea /usr/lib/libkea-util.so kea /usr/lib/libkea-util.so.84 kea /usr/lib/libkea-util.so.84.0.0 kea /usr/lib/python3.12/ kea /usr/lib/python3.12/site-packages/ kea /usr/lib/python3.12/site-packages/kea/ kea /usr/lib/python3.12/site-packages/kea/__pycache__/ kea /usr/lib/python3.12/site-packages/kea/__pycache__/kea_conn.cpython-312.opt-1.pyc kea /usr/lib/python3.12/site-packages/kea/__pycache__/kea_conn.cpython-312.pyc kea /usr/lib/python3.12/site-packages/kea/__pycache__/kea_connector3.cpython-312.opt-1.pyc kea /usr/lib/python3.12/site-packages/kea/__pycache__/kea_connector3.cpython-312.pyc kea /usr/lib/python3.12/site-packages/kea/kea_conn.py kea /usr/lib/python3.12/site-packages/kea/kea_connector3.py kea /usr/lib/systemd/ kea /usr/lib/systemd/system/ kea /usr/lib/systemd/system/kea-ctrl-agent.service kea /usr/lib/systemd/system/kea-dhcp-ddns.service kea /usr/lib/systemd/system/kea-dhcp4.service kea /usr/lib/systemd/system/kea-dhcp6.service kea /usr/lib/tmpfiles.d/ kea /usr/lib/tmpfiles.d/kea.conf kea /usr/share/ kea /usr/share/kea/ kea /usr/share/kea/api/ kea /usr/share/kea/api/build-report.json kea /usr/share/kea/api/cache-clear.json kea /usr/share/kea/api/cache-flush.json kea /usr/share/kea/api/cache-get-by-id.json kea /usr/share/kea/api/cache-get.json kea /usr/share/kea/api/cache-insert.json kea /usr/share/kea/api/cache-load.json kea /usr/share/kea/api/cache-remove.json kea /usr/share/kea/api/cache-size.json kea /usr/share/kea/api/cache-write.json kea /usr/share/kea/api/class-add.json kea /usr/share/kea/api/class-del.json kea /usr/share/kea/api/class-get.json kea /usr/share/kea/api/class-list.json kea /usr/share/kea/api/class-update.json kea /usr/share/kea/api/config-backend-pull.json kea /usr/share/kea/api/config-get.json kea /usr/share/kea/api/config-hash-get.json kea /usr/share/kea/api/config-reload.json kea /usr/share/kea/api/config-set.json kea /usr/share/kea/api/config-test.json kea /usr/share/kea/api/config-write.json kea /usr/share/kea/api/dhcp-disable.json kea /usr/share/kea/api/dhcp-enable.json kea /usr/share/kea/api/extended-info4-upgrade.json kea /usr/share/kea/api/extended-info6-upgrade.json kea /usr/share/kea/api/gss-tsig-get-all.json kea /usr/share/kea/api/gss-tsig-get.json kea /usr/share/kea/api/gss-tsig-key-del.json kea /usr/share/kea/api/gss-tsig-key-expire.json kea /usr/share/kea/api/gss-tsig-key-get.json kea /usr/share/kea/api/gss-tsig-list.json kea /usr/share/kea/api/gss-tsig-purge-all.json kea /usr/share/kea/api/gss-tsig-purge.json kea /usr/share/kea/api/gss-tsig-rekey-all.json kea /usr/share/kea/api/gss-tsig-rekey.json kea /usr/share/kea/api/ha-continue.json kea /usr/share/kea/api/ha-heartbeat.json kea /usr/share/kea/api/ha-maintenance-cancel.json kea /usr/share/kea/api/ha-maintenance-notify.json kea /usr/share/kea/api/ha-maintenance-start.json kea /usr/share/kea/api/ha-reset.json kea /usr/share/kea/api/ha-scopes.json kea /usr/share/kea/api/ha-sync-complete-notify.json kea /usr/share/kea/api/ha-sync.json kea /usr/share/kea/api/lease4-add.json kea /usr/share/kea/api/lease4-del.json kea /usr/share/kea/api/lease4-get-all.json kea /usr/share/kea/api/lease4-get-by-client-id.json kea /usr/share/kea/api/lease4-get-by-hostname.json kea /usr/share/kea/api/lease4-get-by-hw-address.json kea /usr/share/kea/api/lease4-get-page.json kea /usr/share/kea/api/lease4-get.json kea /usr/share/kea/api/lease4-resend-ddns.json kea /usr/share/kea/api/lease4-update.json kea /usr/share/kea/api/lease4-wipe.json kea /usr/share/kea/api/lease4-write.json kea /usr/share/kea/api/lease6-add.json kea /usr/share/kea/api/lease6-bulk-apply.json kea /usr/share/kea/api/lease6-del.json kea /usr/share/kea/api/lease6-get-all.json kea /usr/share/kea/api/lease6-get-by-duid.json kea /usr/share/kea/api/lease6-get-by-hostname.json kea /usr/share/kea/api/lease6-get-page.json kea /usr/share/kea/api/lease6-get.json kea /usr/share/kea/api/lease6-resend-ddns.json kea /usr/share/kea/api/lease6-update.json kea /usr/share/kea/api/lease6-wipe.json kea /usr/share/kea/api/lease6-write.json kea /usr/share/kea/api/leases-reclaim.json kea /usr/share/kea/api/list-commands.json kea /usr/share/kea/api/network4-add.json kea /usr/share/kea/api/network4-del.json kea /usr/share/kea/api/network4-get.json kea /usr/share/kea/api/network4-list.json kea /usr/share/kea/api/network4-subnet-add.json kea /usr/share/kea/api/network4-subnet-del.json kea /usr/share/kea/api/network6-add.json kea /usr/share/kea/api/network6-del.json kea /usr/share/kea/api/network6-get.json kea /usr/share/kea/api/network6-list.json kea /usr/share/kea/api/network6-subnet-add.json kea /usr/share/kea/api/network6-subnet-del.json kea /usr/share/kea/api/remote-class4-del.json kea /usr/share/kea/api/remote-class4-get-all.json kea /usr/share/kea/api/remote-class4-get.json kea /usr/share/kea/api/remote-class4-set.json kea /usr/share/kea/api/remote-class6-del.json kea /usr/share/kea/api/remote-class6-get-all.json kea /usr/share/kea/api/remote-class6-get.json kea /usr/share/kea/api/remote-class6-set.json kea /usr/share/kea/api/remote-global-parameter4-del.json kea /usr/share/kea/api/remote-global-parameter4-get-all.json kea /usr/share/kea/api/remote-global-parameter4-get.json kea /usr/share/kea/api/remote-global-parameter4-set.json kea /usr/share/kea/api/remote-global-parameter6-del.json kea /usr/share/kea/api/remote-global-parameter6-get-all.json kea /usr/share/kea/api/remote-global-parameter6-get.json kea /usr/share/kea/api/remote-global-parameter6-set.json kea /usr/share/kea/api/remote-network4-del.json kea /usr/share/kea/api/remote-network4-get.json kea /usr/share/kea/api/remote-network4-list.json kea /usr/share/kea/api/remote-network4-set.json kea /usr/share/kea/api/remote-network6-del.json kea /usr/share/kea/api/remote-network6-get.json kea /usr/share/kea/api/remote-network6-list.json kea /usr/share/kea/api/remote-network6-set.json kea /usr/share/kea/api/remote-option-def4-del.json kea /usr/share/kea/api/remote-option-def4-get-all.json kea /usr/share/kea/api/remote-option-def4-get.json kea /usr/share/kea/api/remote-option-def4-set.json kea /usr/share/kea/api/remote-option-def6-del.json kea /usr/share/kea/api/remote-option-def6-get-all.json kea /usr/share/kea/api/remote-option-def6-get.json kea /usr/share/kea/api/remote-option-def6-set.json kea /usr/share/kea/api/remote-option4-global-del.json kea /usr/share/kea/api/remote-option4-global-get-all.json kea /usr/share/kea/api/remote-option4-global-get.json kea /usr/share/kea/api/remote-option4-global-set.json kea /usr/share/kea/api/remote-option4-network-del.json kea /usr/share/kea/api/remote-option4-network-set.json kea /usr/share/kea/api/remote-option4-pool-del.json kea /usr/share/kea/api/remote-option4-pool-set.json kea /usr/share/kea/api/remote-option4-subnet-del.json kea /usr/share/kea/api/remote-option4-subnet-set.json kea /usr/share/kea/api/remote-option6-global-del.json kea /usr/share/kea/api/remote-option6-global-get-all.json kea /usr/share/kea/api/remote-option6-global-get.json kea /usr/share/kea/api/remote-option6-global-set.json kea /usr/share/kea/api/remote-option6-network-del.json kea /usr/share/kea/api/remote-option6-network-set.json kea /usr/share/kea/api/remote-option6-pd-pool-del.json kea /usr/share/kea/api/remote-option6-pd-pool-set.json kea /usr/share/kea/api/remote-option6-pool-del.json kea /usr/share/kea/api/remote-option6-pool-set.json kea /usr/share/kea/api/remote-option6-subnet-del.json kea /usr/share/kea/api/remote-option6-subnet-set.json kea /usr/share/kea/api/remote-server4-del.json kea /usr/share/kea/api/remote-server4-get-all.json kea /usr/share/kea/api/remote-server4-get.json kea /usr/share/kea/api/remote-server4-set.json kea /usr/share/kea/api/remote-server6-del.json kea /usr/share/kea/api/remote-server6-get-all.json kea /usr/share/kea/api/remote-server6-get.json kea /usr/share/kea/api/remote-server6-set.json kea /usr/share/kea/api/remote-subnet4-del-by-id.json kea /usr/share/kea/api/remote-subnet4-del-by-prefix.json kea /usr/share/kea/api/remote-subnet4-get-by-id.json kea /usr/share/kea/api/remote-subnet4-get-by-prefix.json kea /usr/share/kea/api/remote-subnet4-list.json kea /usr/share/kea/api/remote-subnet4-set.json kea /usr/share/kea/api/remote-subnet6-del-by-id.json kea /usr/share/kea/api/remote-subnet6-del-by-prefix.json kea /usr/share/kea/api/remote-subnet6-get-by-id.json kea /usr/share/kea/api/remote-subnet6-get-by-prefix.json kea /usr/share/kea/api/remote-subnet6-list.json kea /usr/share/kea/api/remote-subnet6-set.json kea /usr/share/kea/api/reservation-add.json kea /usr/share/kea/api/reservation-del.json kea /usr/share/kea/api/reservation-get-all.json kea /usr/share/kea/api/reservation-get-by-address.json kea /usr/share/kea/api/reservation-get-by-hostname.json kea /usr/share/kea/api/reservation-get-by-id.json kea /usr/share/kea/api/reservation-get-page.json kea /usr/share/kea/api/reservation-get.json kea /usr/share/kea/api/reservation-update.json kea /usr/share/kea/api/server-tag-get.json kea /usr/share/kea/api/shutdown.json kea /usr/share/kea/api/stat-lease4-get.json kea /usr/share/kea/api/stat-lease6-get.json kea /usr/share/kea/api/statistic-get-all.json kea /usr/share/kea/api/statistic-get.json kea /usr/share/kea/api/statistic-remove-all.json kea /usr/share/kea/api/statistic-remove.json kea /usr/share/kea/api/statistic-reset-all.json kea /usr/share/kea/api/statistic-reset.json kea /usr/share/kea/api/statistic-sample-age-set-all.json kea /usr/share/kea/api/statistic-sample-age-set.json kea /usr/share/kea/api/statistic-sample-count-set-all.json kea /usr/share/kea/api/statistic-sample-count-set.json kea /usr/share/kea/api/status-get.json kea /usr/share/kea/api/subnet4-add.json kea /usr/share/kea/api/subnet4-del.json kea /usr/share/kea/api/subnet4-delta-add.json kea /usr/share/kea/api/subnet4-delta-del.json kea /usr/share/kea/api/subnet4-get.json kea /usr/share/kea/api/subnet4-list.json kea /usr/share/kea/api/subnet4-update.json kea /usr/share/kea/api/subnet6-add.json kea /usr/share/kea/api/subnet6-del.json kea /usr/share/kea/api/subnet6-delta-add.json kea /usr/share/kea/api/subnet6-delta-del.json kea /usr/share/kea/api/subnet6-get.json kea /usr/share/kea/api/subnet6-list.json kea /usr/share/kea/api/subnet6-update.json kea /usr/share/kea/api/version-get.json kea /usr/share/kea/scripts/ kea /usr/share/kea/scripts/admin-utils.sh kea /usr/share/kea/scripts/mysql/ kea /usr/share/kea/scripts/mysql/dhcpdb_create.mysql kea /usr/share/kea/scripts/mysql/dhcpdb_drop.mysql kea /usr/share/kea/scripts/mysql/upgrade_001.0_to_002.0.sh kea /usr/share/kea/scripts/mysql/upgrade_002.0_to_003.0.sh kea /usr/share/kea/scripts/mysql/upgrade_003.0_to_004.0.sh kea /usr/share/kea/scripts/mysql/upgrade_004.0_to_004.1.sh kea /usr/share/kea/scripts/mysql/upgrade_004.1_to_005.0.sh kea /usr/share/kea/scripts/mysql/upgrade_005.0_to_005.1.sh kea /usr/share/kea/scripts/mysql/upgrade_005.1_to_005.2.sh kea /usr/share/kea/scripts/mysql/upgrade_005.2_to_006.0.sh kea /usr/share/kea/scripts/mysql/upgrade_006.0_to_007.0.sh kea /usr/share/kea/scripts/mysql/upgrade_007.0_to_008.0.sh kea /usr/share/kea/scripts/mysql/upgrade_008.0_to_008.1.sh kea /usr/share/kea/scripts/mysql/upgrade_008.1_to_008.2.sh kea /usr/share/kea/scripts/mysql/upgrade_008.2_to_009.0.sh kea /usr/share/kea/scripts/mysql/upgrade_009.0_to_009.1.sh kea /usr/share/kea/scripts/mysql/upgrade_009.1_to_009.2.sh kea /usr/share/kea/scripts/mysql/upgrade_009.2_to_009.3.sh kea /usr/share/kea/scripts/mysql/upgrade_009.3_to_009.4.sh kea /usr/share/kea/scripts/mysql/upgrade_009.4_to_009.5.sh kea /usr/share/kea/scripts/mysql/upgrade_009.5_to_009.6.sh kea /usr/share/kea/scripts/mysql/upgrade_009.6_to_010.0.sh kea /usr/share/kea/scripts/mysql/upgrade_010_to_011.sh kea /usr/share/kea/scripts/mysql/upgrade_011_to_012.sh kea /usr/share/kea/scripts/mysql/upgrade_012_to_013.sh kea /usr/share/kea/scripts/mysql/upgrade_013_to_014.sh kea /usr/share/kea/scripts/mysql/upgrade_014_to_015.sh kea /usr/share/kea/scripts/mysql/upgrade_015_to_016.sh kea /usr/share/kea/scripts/mysql/upgrade_016_to_017.sh kea /usr/share/kea/scripts/mysql/upgrade_017_to_018.sh kea /usr/share/kea/scripts/mysql/upgrade_018_to_019.sh kea /usr/share/kea/scripts/mysql/upgrade_019_to_020.sh kea /usr/share/kea/scripts/mysql/upgrade_020_to_021.sh kea /usr/share/kea/scripts/mysql/upgrade_021_to_022.sh kea /usr/share/kea/scripts/mysql/upgrade_022_to_022.1.sh kea /usr/share/kea/scripts/mysql/wipe_data.sh kea /usr/share/kea/scripts/pgsql/ kea /usr/share/kea/scripts/pgsql/dhcpdb_create.pgsql kea /usr/share/kea/scripts/pgsql/dhcpdb_drop.pgsql kea /usr/share/kea/scripts/pgsql/upgrade_001.0_to_002.0.sh kea /usr/share/kea/scripts/pgsql/upgrade_002.0_to_003.0.sh kea /usr/share/kea/scripts/pgsql/upgrade_003.0_to_003.1.sh kea /usr/share/kea/scripts/pgsql/upgrade_003.1_to_003.2.sh kea /usr/share/kea/scripts/pgsql/upgrade_003.2_to_003.3.sh kea /usr/share/kea/scripts/pgsql/upgrade_003.3_to_004.0.sh kea /usr/share/kea/scripts/pgsql/upgrade_004.0_to_005.0.sh kea /usr/share/kea/scripts/pgsql/upgrade_005.0_to_005.1.sh kea /usr/share/kea/scripts/pgsql/upgrade_005.1_to_006.0.sh kea /usr/share/kea/scripts/pgsql/upgrade_006.0_to_006.1.sh kea /usr/share/kea/scripts/pgsql/upgrade_006.1_to_006.2.sh kea /usr/share/kea/scripts/pgsql/upgrade_006.2_to_007.0.sh kea /usr/share/kea/scripts/pgsql/upgrade_007_to_008.sh kea /usr/share/kea/scripts/pgsql/upgrade_008_to_009.sh kea /usr/share/kea/scripts/pgsql/upgrade_009_to_010.sh kea /usr/share/kea/scripts/pgsql/upgrade_010_to_011.sh kea /usr/share/kea/scripts/pgsql/upgrade_011_to_012.sh kea /usr/share/kea/scripts/pgsql/upgrade_012_to_013.sh kea /usr/share/kea/scripts/pgsql/upgrade_013_to_014.sh kea /usr/share/kea/scripts/pgsql/upgrade_014_to_015.sh kea /usr/share/kea/scripts/pgsql/upgrade_015_to_016.sh kea /usr/share/kea/scripts/pgsql/upgrade_016_to_017.sh kea /usr/share/kea/scripts/pgsql/upgrade_017_to_018.sh kea /usr/share/kea/scripts/pgsql/upgrade_018_to_019.sh kea /usr/share/kea/scripts/pgsql/upgrade_019_to_020.sh kea /usr/share/kea/scripts/pgsql/upgrade_020_to_021.sh kea /usr/share/kea/scripts/pgsql/upgrade_021_to_022.sh kea /usr/share/kea/scripts/pgsql/upgrade_022_to_022.1.sh kea /usr/share/kea/scripts/pgsql/wipe_data.sh kea /var/ kea /var/lib/ kea /var/lib/kea/ kea /var/log/</pre> </div> </div> <h3 class="sectionedit12 page-header pb-3 mb-4 mt-5" id="grund-konfiguration">Grund-Konfiguration</h3> <div class="level3"> </div> <h4 class="sectionedit13" id="firewall_paketfilter_-_firewalld">Firewall/Paketfilter - firewalld</h4> <div class="level4"> <p> Bevor wir nun unseren <strong>Kea-DHCP-Daemon</strong> konfigurieren und starten müssen wir natürlich sicherstellen, dass auf dem betreffendem Host auch die Kommunikationsbeziehungen entsprechend erlaubt sind. </p> <p> Wie auch schon früher bei <strong>CentOS</strong> ab Release <strong>7</strong> bzw. den nachfolgenden Relaese-Kandidaten <strong>Stream von RHEL</strong> nutzen wir auch unter <strong>Arch Linux</strong> den dynamischen <strong><a href="https://firewalld.org/" class="urlextern" target="_tab" title="https://firewalld.org/" rel="ugc nofollow noopener">firewalld</a></strong> Service. Ein grosser Vorteil der dynamischen Paketfilterregeln ist unter anderem, dass zur Aktivierung der neuen Firewall-Regel(n) nicht der Daemon durchgestartet werden muss und somit alle aktiven Verbindungen kurz getrennt werden. Sondern unsere Änderungen können <strong><em>on-the-fly</em></strong> aktiviert oder auch wieder deaktiviert werden. </p> <p> In folgendem Konfigurationsbeispiel gehen wir von einem Host aus, der zwei Firewall-Zonen hält, einmal die Zone <strong><code>idmz</code></strong> und einmal die Zone <strong><code>intra</code></strong>. Nur in der Zone <strong><code>intra</code></strong> sollen später die beiden DHCP-Daemon <strong>kea-dhcp4</strong> und <strong>kea-dhcp6</strong> Anfragen von Clients entsprechend beantworten. </p> <p> Damit unsere Clients Verbindungen zu dem geöffneten <strong>dhcpv4</strong>-Port <strong>67/udp</strong> und <strong>dhcpv6-server</strong>-Port <strong>547/udp</strong> der beiden zugehörigen <strong>Kea-Daemons</strong> aufbauen können, müssen wir für diese noch Änderungen am Paketfilter <strong>firewalld</strong> vornehmen. </p> <p> Mit Hilfe des Programms <strong>firewall-cmd</strong> legen wir nun eine <strong>permanente</strong> Regel in der Zone <strong>intra</strong> an. Genug der Vorrede, mit nachfolgendem Befehl werden die Ports für den Service <strong>dhcp</strong> geöffnet. </p> <pre class="code"> # firewall-cmd --permanent --zone=intra --add-service=dhcp</pre> <pre class="code">success </pre> <p> Das Gleiche machen wir nun noch für den Service <strong>dhcpv6</strong> </p> <pre class="code"> # firewall-cmd --permanent --zone=intra --add-service=dhcpv6</pre> <pre class="code">success </pre> <p> Anschliessend können wir den Firewall-Daemon einmal neu laden und überprüfen, ob die Regeln auch entsprechend unserer Definition, gezogen haben. </p> <pre class="code"> # firewall-cmd --reload</pre> <pre class="code">success</pre> <p> Werfen wir noch kurz einen Blick in die Zone <strong><code>intra</code></strong>: </p> <pre class="code"> # firewall-cmd --zone=intra --list-services</pre> <pre class="code">dhcp dhcpv6</pre> </div> <h4 class="sectionedit14" id="automatischer_start_des_daemon">automatischer Start des Daemon</h4> <div class="level4"> <p> Damit die beiden Daemon <strong>kea-dhcp4</strong> und <strong>kea-dhcp6</strong> automatisch bei jedem Systemstart startet, kann die Einrichtung eines Start-Scriptes über folgenden Befehl erreicht werden: </p> <pre class="code"> # systemctl enable kea-dhcp4.service kea-dhcp6.service</pre> <pre class="code">Created symlink '/etc/systemd/system/multi-user.target.wants/kea-dhcp4.service' → '/usr/lib/systemd/system/kea-dhcp4.service'. Created symlink '/etc/systemd/system/multi-user.target.wants/kea-dhcp6.service' → '/usr/lib/systemd/system/kea-dhcp6.service'.</pre> <p> Ein Überprüfung ob die beiden Dienste (Daemon) <strong>kea-dhcp4</strong> und <strong>kea-dhcp6</strong> wirklich bei jedem Systemstart automatisch mit gestartet wird, kann durch folgenden Befehl erreicht werden: </p> <pre class="code"> # systemctl is-enabled kea-dhcp4.service kea-dhcp6.service</pre> <pre class="code">enabled enabled</pre> <div class="wrap_center wrap_round wrap_info plugin_wrap" style="width: 80%;"> <p> Starten werden wir ddie beiden Deamon <strong>kea-dhcp4</strong> und <strong>kea-dhcp6</strong>aber erst einmal noch nicht, da wir diesen ja noch konfigurieren müssen. Nachfolgend werden wir noch detailliert zu einzelnen Anwendungsfällen eingehen: </p> <ol class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><a href="#dhcpv4_server" title="linux:kea ↵" class="wikilink1">DHCPv4 Server für statische und dynamische IPv4-Adressen</a></strong></div> </li> <li class="level1"><div class="li"> <strong><a href="#stateful_dhcpv6_server" title="linux:kea ↵" class="wikilink1">Stateful DHCPv6 Server</a></strong></div> </li> </ol> </div> </div> <h2 class="sectionedit17 page-header pb-3 mb-4 mt-5" id="konfiguration">Konfiguration</h2> <div class="level2"> <p> Die Konfiguration unseres DHCPv4 und DHCPv6-<span class="search_hit">Servers</span> wie auch des Controll-Agenten und ggf. des Kea DHCP DDNS Daemaons erfolgt über JSON-Konfigurationsdateien im Verzeichnis <strong><code>/etc/kea/</code></strong>. </p> </div> <h3 class="sectionedit18 page-header pb-3 mb-4 mt-5" id="dhcpv4_server">DHCPv4 Server</h3> <div class="level3"> <p> Zunächst wollen wir uns eingehend mit der Konfiguration unseres DHCPv4-Daemons befassen. Die zugehörige Original-Dokumentation findet sich im Abschnitt <strong><a href="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#dhcpv4-server-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#dhcpv4-server-configuration" rel="ugc nofollow noopener">8.2. DHCPv4 Server Configuration</a></strong>. </p> </div> <h4 class="sectionedit19" id="konfigurationsoptionen_fuer_unseren_dhcpv4-daemon">Konfigurationsoptionen für unseren DHCPv4-Daemon</h4> <div class="level4"> <p> In unserer Betriebsumgebung haben wir folgende Rahmenbedingungen für unseren DHCPv4-Server: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#interface-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#interface-configuration" rel="ugc nofollow noopener">Netzwerkinterface</a></strong> : <br/> Unser DHCPv4-Daemon soll auf den beiden Netzwerkinterfaces <strong><code>net0</code></strong> (<strong>idmz</strong>) und <strong><code>net1</code></strong> (<strong>intra</strong>) auf entsprechende Adressanfragen lauschen und entsprechend Adressen ausliefern.</div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#management-api-for-the-dhcpv4-server" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#management-api-for-the-dhcpv4-server" rel="ugc nofollow noopener">Management API</a></strong> : <br/> Die Verwaltungs-<abbr title="Application Programming Interface">API</abbr> ermöglicht die Ausgabe spezifischer Verwaltungsbefehle, wie z. B. das Abrufen von Statistiken, die Neukonfiguration oder das Herunterfahren. Die <abbr title="Application Programming Interface">API</abbr> soll unter dem <strong><code>socket-type</code></strong> = <strong><code>unix</code></strong> der unter dem Link <strong><code>socket-name</code></strong> = <strong><code>/var/lib/kea/kea4-ctrl-socket</code></strong> erreichbar sein.</div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#memfile-basic-storage-for-leases" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#memfile-basic-storage-for-leases" rel="ugc nofollow noopener">Leases</a></strong> : <br/> In unserer Beispielumgebung sollen die Leases unserer Clients in der Datei <strong><code>/var/lib/kea/dhcp4.leases</code></strong> vorgehalten werden. Optional wäre auch die Speicherung in einer <a href="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#lease-database-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#lease-database-configuration" rel="ugc nofollow noopener">MariaDB bzw. mySQL-Datenbank</a> oder in einer <a href="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#lease-database-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#lease-database-configuration" rel="ugc nofollow noopener">PostgreSQL-Datenbank</a> denkbar. Aber im ersten Schritt wollen wir uns mal mit einer Ablage in einer Datei begnügen. Die Lease-Time soll eine Stunde, also <strong><code>3600</code></strong> Sekunden gelten. Nach 90% der max. Lease-Time soll der Daemon sein Lease-File aufräumen <strong>LFC</strong><sup><a href="#fn__8" id="fnt__8" class="fn_top">8)</a></sup> durchführt werden, also nach <strong><code>3200</code></strong> Sekunden <strong><code>lfc-interval</code></strong>. Dadurch werden redundante (historische) Informationen aus der Lease-Datei entfernt und die Grösse der Lease-Datei effektiv reduziert. Gibt es beim Laden des Lease-Files Fehler, soll der Server nach 100 Fehlern abbrechen und aufhören, zu versuchen die Lease-Datei zu laden.</div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/lease-expiration.html#lease-reclamation-configuration-parameters" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/lease-expiration.html#lease-reclamation-configuration-parameters" rel="ugc nofollow noopener">Lease Reclamation</a></strong> : <br/> Bei der Lease Reclamation, also der Rückforderung von Leases, bei dem abgelaufene Leases zurückgefordert und so anderen Clients wieder zur Verfügung gestellt werden. Hier übernehmen wir die vorgegebenen Default-Wertev von <strong><code>reclaim-timer-wait-time</code></strong> mit <strong><code>10</code></strong>, <strong><code>flush-reclaimed-timer-wait-time</code></strong> vomn <strong><code>25</code></strong>, <strong><code>hold-reclaimed-time</code></strong> von <strong><code>3600</code></strong>, <strong><code>max-reclaim-leases</code></strong> von <strong><code>100</code></strong>, <strong><code>max-reclaim-time</code></strong> von <strong><code>250</code></strong> und <strong><code>unwarned-reclaim-cycles</code></strong> von <strong><code>5</code></strong>.</div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/lease-expiration.html#lease-expiration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/lease-expiration.html#lease-expiration" rel="ugc nofollow noopener">Lease-Timer</a></strong> : <br/> Leases sollen eine Stunde, also <strong><code>valid-lifetime</code></strong> von <strong><code>3600</code></strong> Sekunden gelten. Nach <strong><code>1800</code></strong> Sekunden - das ist die 1/2 der <strong><code>valid-lifetime</code></strong> sollen die Clients nach einer Verlängerung der Lease fragen, also setzen wir <strong><code>renew-timer</code></strong> = <strong><code>1800</code></strong>. Die Clients sollen zusätzlich alle erreichbaren DHCP-Server fragen, ob die Lease noch einmal verlängert werden kann und dies nach <strong>90%</strong> der <strong><code>valid-lifetime</code></strong>, also setzen wir <strong><code>rebind-timer</code></strong> = <strong><code>3200</code></strong>. </div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/logging.html#logging-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/logging.html#logging-configuration" rel="ugc nofollow noopener">Logging</a></strong> : <br/> Da wir ein zentrales Logging und Auswertung mit Hilfe von <strong><a href="https://graylog.org/" class="urlextern" target="_tab" title="https://graylog.org/" rel="ugc nofollow noopener">Graylog</a></strong> einsetzen, lassen wir den DHCP4-Daemon <strong><em class="u">kein</em></strong> eigenes Logfile schreiben sondern nutzen unser zentrales syslog, welches der <strong><code>systemd-journald.service</code></strong> in unser <strong>Journal</strong> schreibt. Hierzu setzen wir die nötigen Parameter wie folgt: <strong><code>name</code></strong> gleich <strong><code>kea-dhcp4</code></strong>, <strong><code>output</code></strong> auf <strong><code>syslog</code></strong>, die <strong><code>severity</code></strong> gleich <strong><code>INFO</code></strong> und den <strong><code>debuglevel</code></strong> auf <strong><code>0</code></strong>.</div> </li> <li class="level1"><div class="li"> <strong>Name-Server</strong> : <br/> Der interne <abbr title="Domain Name System">DNS</abbr>-Daemon ist unter der IP-Adresse <strong><code>10.0.0.27</code></strong> erreichbar.</div> </li> <li class="level1"><div class="li"> <strong>Domain-Name</strong> : <br/> Der Name unserer Domain lautet <strong><code>nausch.org</code></strong>.</div> </li> <li class="level1"><div class="li"> <strong>Domain-Search-Liste</strong> : <br/> Auf Domain-Search-Listen wird bewusst verzichtet, da diese ein <a href="https://de.wikipedia.org/wiki/Anachronismus" class="urlextern" target="_tab" title="https://de.wikipedia.org/wiki/Anachronismus" rel="ugc nofollow noopener">Anachronismus</a> aus den Anfangszeiten des <abbr title="Domain Name System">DNS</abbr> sind und gerne alle Arten von Sicherheits- und Konfigurationsproblemen (DNSSEC, DNS64, QName-Minimization, <abbr title="Domain Name System">DNS</abbr>-Leakage von internen Konfigurationsdaten) erzeugen.</div> </li> <li class="level1"><div class="li"> <strong>Time-Server</strong> : <br/> Der interne Time-Server ist unter der IP-Adresse <strong><code>10.0.0.17</code></strong> erreichbar.</div> </li> <li class="level1 node"><div class="li"> <strong>Subnetz</strong> : <br/> Der DHCPv4-Server ist verantwortlich für das Sub-Netz <strong><code>10.0.10.0/24</code></strong> der Zone <strong><code>intra</code></strong></div> <ul class=" fix-media-list-overlap"> <li class="level2"><div class="li"> <strong>Router</strong> : <br/> Der Default-Router ist für dieses Subnetz unter der IP-Adresse <strong><code>10.0.10.110</code></strong> erreichbar.</div> </li> <li class="level2"><div class="li"> <strong>Time-Server</strong> : <br/> Der interne Time-Server ist bei diesem Subnetz unter der IP-Adresse <strong><code>10.0.10.110</code></strong> erreichbar.</div> </li> <li class="level2"><div class="li"> <strong>Name-Server</strong> : <br/> Der interne <abbr title="Domain Name System">DNS</abbr>-Daemon ist unter der IP-Adresse <strong><code>10.0.10.110</code></strong> in diesem Subnetz erreichbar.</div> </li> <li class="level2"><div class="li"> <strong>Pool (dynamischer Adress-Bereich)</strong> : <br/> Dynamische IP-Adressen sollen aus dem Bereich von <strong><code>10.0.10.230 - 10.0.10.250</code></strong> vergeben werden. </div> </li> <li class="level2"><div class="li"> <strong>Reservierungen</strong> : <br/> Einige Hosts bekommen eine feste IP-Adresse, die der DHCP-Server an Hand der übermittelten MAC-Adresse der Netzwerkschnittstelle vergeben wird.</div> </li> </ul> </li> <li class="level1 node"><div class="li"> <strong>Subnetz</strong> : <br/> Der DHCPv4-Server ist verantwortlich für das Sub-Netz <strong><code>10.0.0.0/24</code></strong> der Zone <strong><code>idmz</code></strong></div> <ul class=" fix-media-list-overlap"> <li class="level2"><div class="li"> <strong>Router</strong> : <br/> Der Default-Router ist für dieses Subnetz unter der IP-Adresse <strong><code>10.0.0.210</code></strong> erreichbar.</div> </li> <li class="level2"><div class="li"> <strong>Time-Server</strong> : <br/> Der interne Time-Server ist bei diesem Subnetz unter der IP-Adresse <strong><code>10.0.0.110</code></strong> erreichbar.</div> </li> <li class="level2"><div class="li"> <strong>Name-Server</strong> : <br/> Der interne <abbr title="Domain Name System">DNS</abbr>-Daemon ist unter der IP-Adresse <strong><code>10.0.0.110</code></strong> in diesem Subnetz erreichbar.</div> </li> <li class="level2"><div class="li"> <strong>Pool (dynamischer Adress-Bereich)</strong> : <br/> Da die IPv4-Adressen in der Zone <strong>idmz</strong> ausschließlich per <strong><a href="/doku.php/linux:kea" class="wikilink1" title="linux:kea" data-wiki-id="linux:kea">Ansible</a></strong> statisch vergeben werden, gibt es hier keinen dynamischen Adresspool!</div> </li> <li class="level2"><div class="li"> <strong>Reservierungen</strong> : <br/> Einige Hosts bekommen eine feste IP-Adresse, die der DHCP-Server an Hand der übermittelten MAC-Adresse der Netzwerkschnittstelle vergeben wird.</div> </li> </ul> </li> </ul> </div> <h4 class="sectionedit20" id="konfigurationsdatei_etc_kea-dhcp4conf">Konfigurationsdatei /etc/kea-dhcp4.conf</h4> <div class="level4"> <p> Bei der Installation unseres Kea-<span class="search_hit">Servers</span> wurde uns eine entsprechende Musterkonfigurations-Datei bereits mitgeliefert. </p> <pre class="code"> # less /etc/kea/kea-dhcp4.conf</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_2">/etc/kea/kea-dhcp4.conf </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_2"><dl class="file"> <dt><a href="/doku.php/linux:kea?do=export_code&codeblock=7" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/kea/kea-dhcp4.conf</a></dt> <dd><pre class="code file java"><span class="co1">// This is a basic configuration for the Kea DHCPv4 server. Subnet declarations</span> <span class="co1">// are mostly commented out and no interfaces are listed. Therefore, the <span class="search_hit">servers</span></span> <span class="co1">// will not listen or respond to any queries.</span> <span class="co1">// The basic configuration must be extended to specify interfaces on which</span> <span class="co1">// the <span class="search_hit">servers</span> should listen. There are a number of example options defined.</span> <span class="co1">// These probably don't make any sense in your network. Make sure you at least</span> <span class="co1">// update the following, before running this example in your network:</span> <span class="co1">// - change the network interface names</span> <span class="co1">// - change the subnets to match your actual network</span> <span class="co1">// - change the option values to match your network</span> <span class="co1">//</span> <span class="co1">// This is just a very basic configuration. Kea comes with large suite (over 30)</span> <span class="co1">// of configuration examples and extensive Kea User's Guide. Please refer to</span> <span class="co1">// those materials to get better understanding of what this software is able to</span> <span class="co1">// do. Comments in this configuration file sometimes refer to sections for more</span> <span class="co1">// details. These are section numbers in Kea User's Guide. The version matching</span> <span class="co1">// your software should come with your Kea package, but it is also available</span> <span class="co1">// in ISC's Knowledgebase (https://kea.readthedocs.io; the direct link for</span> <span class="co1">// the stable version is https://kea.readthedocs.io/).</span> <span class="co1">//</span> <span class="co1">// This configuration file contains only DHCPv4 server's configuration.</span> <span class="co1">// If configurations for other Kea services are also included in this file they</span> <span class="co1">// are ignored by the DHCPv4 server.</span> <span class="br0">{</span>   <span class="co1">// DHCPv4 configuration starts here. This section will be read by DHCPv4 server</span> <span class="co1">// and will be ignored by other components.</span> <span class="st0">"Dhcp4"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="co1">// Add names of your network interfaces to listen on.</span> <span class="st0">"interfaces-config"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="co1">// See section 8.2.4 for more details. You probably want to add just</span> <span class="co1">// interface name (e.g. "eth0" or specific IPv4 address on that</span> <span class="co1">// interface name (e.g. "eth0/192.0.2.1").</span> <span class="st0">"interfaces"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">]</span>   <span class="co1">// Kea DHCPv4 server by default listens using raw sockets. This ensures</span> <span class="co1">// all packets, including those sent by directly connected clients</span> <span class="co1">// that don't have IPv4 address yet, are received. However, if your</span> <span class="co1">// traffic is always relayed, it is often better to use regular</span> <span class="co1">// UDP sockets. If you want to do that, uncomment this line:</span> <span class="co1">// "dhcp-socket-type": "udp"</span> <span class="br0">}</span>,   <span class="co1">// Kea supports control channel, which is a way to receive management</span> <span class="co1">// commands while the server is running. This is a Unix domain socket that</span> <span class="co1">// receives commands formatted in JSON, e.g. config-set (which sets new</span> <span class="co1">// configuration), config-reload (which tells Kea to reload its</span> <span class="co1">// configuration from file), statistic-get (to retrieve statistics) and many</span> <span class="co1">// more. For detailed description, see Sections 8.8, 16 and 15.</span> <span class="st0">"control-socket"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"socket-type"</span><span class="sy0">:</span> <span class="st0">"unix"</span>, <span class="st0">"socket-name"</span><span class="sy0">:</span> <span class="st0">"/tmp/kea4-ctrl-socket"</span> <span class="br0">}</span>,   <span class="co1">// Use Memfile lease database backend to store leases in a CSV file.</span> <span class="co1">// Depending on how Kea was compiled, it may also support SQL databases</span> <span class="co1">// (MySQL and/or PostgreSQL). Those database backends require more</span> <span class="co1">// parameters, like name, host and possibly user and password.</span> <span class="co1">// There are dedicated examples for each backend. See Section 7.2.2 "Lease</span> <span class="co1">// Storage" for details.</span> <span class="st0">"lease-database"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="co1">// Memfile is the simplest and easiest backend to use. It's an in-memory</span> <span class="co1">// C++ database that stores its state in CSV file.</span> <span class="st0">"type"</span><span class="sy0">:</span> <span class="st0">"memfile"</span>, <span class="st0">"lfc-interval"</span><span class="sy0">:</span> <span class="nu0">3600</span> <span class="br0">}</span>,   <span class="co1">// Kea allows storing host reservations in a database. If your network is</span> <span class="co1">// small or you have few reservations, it's probably easier to keep them</span> <span class="co1">// in the configuration file. If your network is large, it's usually better</span> <span class="co1">// to use database for it. To enable it, uncomment the following:</span> <span class="co1">// "hosts-database": {</span> <span class="co1">// "type": "mysql",</span> <span class="co1">// "name": "kea",</span> <span class="co1">// "user": "kea",</span> <span class="co1">// "password": "kea",</span> <span class="co1">// "host": "localhost",</span> <span class="co1">// "port": 3306</span> <span class="co1">// },</span> <span class="co1">// See Section 7.2.3 "Hosts storage" for details.</span>   <span class="co1">// Setup reclamation of the expired leases and leases affinity.</span> <span class="co1">// Expired leases will be reclaimed every 10 seconds. Every 25</span> <span class="co1">// seconds reclaimed leases, which have expired more than 3600</span> <span class="co1">// seconds ago, will be removed. The limits for leases reclamation</span> <span class="co1">// are 100 leases or 250 ms for a single cycle. A warning message</span> <span class="co1">// will be logged if there are still expired leases in the</span> <span class="co1">// database after 5 consecutive reclamation cycles.</span> <span class="co1">// If both "flush-reclaimed-timer-wait-time" and "hold-reclaimed-time" are</span> <span class="co1">// not 0, when the client sends a release message the lease is expired</span> <span class="co1">// instead of being deleted from the lease storage.</span> <span class="st0">"expired-leases-processing"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"reclaim-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">10</span>, <span class="st0">"flush-reclaimed-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">25</span>, <span class="st0">"hold-reclaimed-time"</span><span class="sy0">:</span> <span class="nu0">3600</span>, <span class="st0">"max-reclaim-leases"</span><span class="sy0">:</span> <span class="nu0">100</span>, <span class="st0">"max-reclaim-time"</span><span class="sy0">:</span> <span class="nu0">250</span>, <span class="st0">"unwarned-reclaim-cycles"</span><span class="sy0">:</span> <span class="nu0">5</span> <span class="br0">}</span>,   <span class="co1">// Global timers specified here apply to all subnets, unless there are</span> <span class="co1">// subnet specific values defined in particular subnets.</span> <span class="st0">"renew-timer"</span><span class="sy0">:</span> <span class="nu0">900</span>, <span class="st0">"rebind-timer"</span><span class="sy0">:</span> <span class="nu0">1800</span>, <span class="st0">"valid-lifetime"</span><span class="sy0">:</span> <span class="nu0">3600</span>,   <span class="co1">// Many additional parameters can be specified here:</span> <span class="co1">// - option definitions (if you want to define vendor options, your own</span> <span class="co1">// custom options or perhaps handle standard options</span> <span class="co1">// that Kea does not support out of the box yet)</span> <span class="co1">// - client classes</span> <span class="co1">// - hooks</span> <span class="co1">// - ddns information (how the DHCPv4 component can reach a DDNS daemon)</span> <span class="co1">//</span> <span class="co1">// Some of them have examples below, but there are other parameters.</span> <span class="co1">// Consult Kea User's Guide to find out about them.</span>   <span class="co1">// These are global options. They are going to be sent when a client</span> <span class="co1">// requests them, unless overwritten with values in more specific scopes.</span> <span class="co1">// The scope hierarchy is:</span> <span class="co1">// - global (most generic, can be overwritten by class, subnet or host)</span> <span class="co1">// - class (can be overwritten by subnet or host)</span> <span class="co1">// - subnet (can be overwritten by host)</span> <span class="co1">// - host (most specific, overwrites any other scopes)</span> <span class="co1">//</span> <span class="co1">// Not all of those options make sense. Please configure only those that</span> <span class="co1">// are actually useful in your network.</span> <span class="co1">//</span> <span class="co1">// For a complete list of options currently supported by Kea, see</span> <span class="co1">// Section 7.2.8 "Standard DHCPv4 Options". Kea also supports</span> <span class="co1">// vendor options (see Section 7.2.10) and allows users to define their</span> <span class="co1">// own custom options (see Section 7.2.9).</span> <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="co1">// When specifying options, you typically need to specify</span> <span class="co1">// one of (name or code) and data. The full option specification</span> <span class="co1">// covers name, code, space, csv-format and data.</span> <span class="co1">// space defaults to "dhcp4" which is usually correct, unless you</span> <span class="co1">// use encapsulate options. csv-format defaults to "true", so</span> <span class="co1">// this is also correct, unless you want to specify the whole</span> <span class="co1">// option value as long hex string. For example, to specify</span> <span class="co1">// domain-name-<span class="search_hit">servers</span> you could do this:</span> <span class="co1">// {</span> <span class="co1">// "name": "domain-name-<span class="search_hit">servers</span>",</span> <span class="co1">// "code": 6,</span> <span class="co1">// "csv-format": "true",</span> <span class="co1">// "space": "dhcp4",</span> <span class="co1">// "data": "192.0.2.1, 192.0.2.2"</span> <span class="co1">// }</span> <span class="co1">// but it's a lot of writing, so it's easier to do this instead:</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-name-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"192.0.2.1, 192.0.2.2"</span> <span class="br0">}</span>,   <span class="co1">// Typically people prefer to refer to options by their names, so they</span> <span class="co1">// don't need to remember the code names. However, some people like</span> <span class="co1">// to use numerical values. For example, option "domain-name" uses</span> <span class="co1">// option code 15, so you can reference to it either by</span> <span class="co1">// "name": "domain-name" or "code": 15.</span> <span class="br0">{</span> <span class="st0">"code"</span><span class="sy0">:</span> <span class="nu0">15</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"example.org"</span> <span class="br0">}</span>,   <span class="co1">// Domain search is also a popular option. It tells the client to</span> <span class="co1">// attempt to resolve names within those specified domains. For</span> <span class="co1">// example, name "foo" would be attempted to be resolved as</span> <span class="co1">// foo.mydomain.example.com and if it fails, then as foo.example.com</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-search"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"mydomain.example.com, example.com"</span> <span class="br0">}</span>,   <span class="co1">// String options that have a comma in their values need to have</span> <span class="co1">// it escaped (i.e. each comma is preceded by two backslashes).</span> <span class="co1">// That's because commas are reserved for separating fields in</span> <span class="co1">// compound options. At the same time, we need to be conformant</span> <span class="co1">// with JSON spec, that does not allow "\,". Therefore the</span> <span class="co1">// slightly uncommon double backslashes notation is needed.</span>   <span class="co1">// Legal JSON escapes are \ followed by "\/bfnrt character</span> <span class="co1">// or \u followed by 4 hexadecimal numbers (currently Kea</span> <span class="co1">// supports only \u0000 to \u00ff code points).</span> <span class="co1">// CSV processing translates '\\' into '\' and '\,' into ','</span> <span class="co1">// only so for instance '\x' is translated into '\x'. But</span> <span class="co1">// as it works on a JSON string value each of these '\'</span> <span class="co1">// characters must be doubled on JSON input.</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"boot-file-name"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"EST5EDT4<span class="es0">\\</span>,M3.2.0/02:00<span class="es0">\\</span>,M11.1.0/02:00"</span> <span class="br0">}</span>,   <span class="co1">// Options that take integer values can either be specified in</span> <span class="co1">// dec or hex format. Hex format could be either plain (e.g. abcd)</span> <span class="co1">// or prefixed with 0x (e.g. 0xabcd).</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"default-ip-ttl"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"0xf0"</span> <span class="br0">}</span>   <span class="co1">// Note that Kea provides some of the options on its own. In particular,</span> <span class="co1">// it sends IP Address lease type (code 51, based on valid-lifetime</span> <span class="co1">// parameter, Subnet mask (code 1, based on subnet definition), Renewal</span> <span class="co1">// time (code 58, based on renew-timer parameter), Rebind time (code 59,</span> <span class="co1">// based on rebind-timer parameter).</span> <span class="br0">]</span>,   <span class="co1">// Other global parameters that can be defined here are option definitions</span> <span class="co1">// (this is useful if you want to use vendor options, your own custom</span> <span class="co1">// options or perhaps handle options that Kea does not handle out of the box</span> <span class="co1">// yet).</span>   <span class="co1">// You can also define classes. If classes are defined, incoming packets</span> <span class="co1">// may be assigned to specific classes. A client class can represent any</span> <span class="co1">// group of devices that share some common characteristic, e.g. Windows</span> <span class="co1">// devices, iphones, broken printers that require special options, etc.</span> <span class="co1">// Based on the class information, you can then allow or reject clients</span> <span class="co1">// to use certain subnets, add special options for them or change values</span> <span class="co1">// of some fixed fields.</span> <span class="st0">"client-classes"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// This specifies a name of this class. It's useful if you need to</span> <span class="co1">// reference this class.</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"voip"</span>,   <span class="co1">// This is a test. It is an expression that is being evaluated on</span> <span class="co1">// each incoming packet. It is supposed to evaluate to either</span> <span class="co1">// true or false. If it's true, the packet is added to specified</span> <span class="co1">// class. See Section 12 for a list of available expressions. There</span> <span class="co1">// are several dozens. Section 8.2.14 for more details for DHCPv4</span> <span class="co1">// classification and Section 9.2.19 for DHCPv6.</span> <span class="st0">"test"</span><span class="sy0">:</span> <span class="st0">"substring(option[60].hex,0,6) == 'Aastra'"</span>,   <span class="co1">// If a client belongs to this class, you can define extra behavior.</span> <span class="co1">// For example, certain fields in DHCPv4 packet will be set to</span> <span class="co1">// certain values.</span> <span class="st0">"next-server"</span><span class="sy0">:</span> <span class="st0">"192.0.2.254"</span>, <span class="st0">"server-hostname"</span><span class="sy0">:</span> <span class="st0">"hal9000"</span>, <span class="st0">"boot-file-name"</span><span class="sy0">:</span> <span class="st0">"/dev/null"</span>   <span class="co1">// You can also define option values here if you want devices from</span> <span class="co1">// this class to receive special options.</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// Another thing possible here are hooks. Kea supports a powerful mechanism</span> <span class="co1">// that allows loading external libraries that can extract information and</span> <span class="co1">// even influence how the server processes packets. Those libraries include</span> <span class="co1">// additional forensic logging capabilities, ability to reserve hosts in</span> <span class="co1">// more flexible ways, and even add extra commands. For a list of available</span> <span class="co1">// hook libraries, see https://gitlab.isc.org/isc-projects/kea/wikis/Hooks-available.</span> <span class="co1">// "hooks-libraries": [</span> <span class="co1">// {</span> <span class="co1">// // Forensic Logging library generates forensic type of audit trail</span> <span class="co1">// // of all devices serviced by Kea, including their identifiers</span> <span class="co1">// // (like MAC address), their location in the network, times</span> <span class="co1">// // when they were active etc.</span> <span class="co1">// "library": "/usr/lib/kea/hooks/libdhcp_legal_log.so",</span> <span class="co1">// "parameters": {</span> <span class="co1">// "path": "/var/lib/kea",</span> <span class="co1">// "base-name": "kea-forensic4"</span> <span class="co1">// }</span> <span class="co1">// },</span> <span class="co1">// {</span> <span class="co1">// // Flexible identifier (flex-id). Kea software provides a way to</span> <span class="co1">// // handle host reservations that include addresses, prefixes,</span> <span class="co1">// // options, client classes and other features. The reservation can</span> <span class="co1">// // be based on hardware address, DUID, circuit-id or client-id in</span> <span class="co1">// // DHCPv4 and using hardware address or DUID in DHCPv6. However,</span> <span class="co1">// // there are sometimes scenario where the reservation is more</span> <span class="co1">// // complex, e.g. uses other options that mentioned above, uses part</span> <span class="co1">// // of specific options or perhaps even a combination of several</span> <span class="co1">// // options and fields to uniquely identify a client. Those scenarios</span> <span class="co1">// // are addressed by the Flexible Identifiers hook application.</span> <span class="co1">// "library": "/usr/lib/kea/hooks/libdhcp_flex_id.so",</span> <span class="co1">// "parameters": {</span> <span class="co1">// "identifier-expression": "relay4[2].hex"</span> <span class="co1">// }</span> <span class="co1">// }</span> <span class="co1">// ],</span>   <span class="co1">// Below an example of a simple IPv4 subnet declaration. Uncomment to enable</span> <span class="co1">// it. This is a list, denoted with [ ], of structures, each denoted with</span> <span class="co1">// { }. Each structure describes a single subnet and may have several</span> <span class="co1">// parameters. One of those parameters is "pools" that is also a list of</span> <span class="co1">// structures.</span> <span class="st0">"subnet4"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// This defines the whole subnet. Kea will use this information to</span> <span class="co1">// determine where the clients are connected. This is the whole</span> <span class="co1">// subnet in your network.</span>   <span class="co1">// Subnet identifier should be unique for each subnet.</span> <span class="st0">"id"</span><span class="sy0">:</span> <span class="nu0">1</span>,   <span class="co1">// This is mandatory parameter for each subnet.</span> <span class="st0">"subnet"</span><span class="sy0">:</span> <span class="st0">"192.0.2.0/24"</span>,   <span class="co1">// Pools define the actual part of your subnet that is governed</span> <span class="co1">// by Kea. Technically this is optional parameter, but it's</span> <span class="co1">// almost always needed for DHCP to do its job. If you omit it,</span> <span class="co1">// clients won't be able to get addresses, unless there are</span> <span class="co1">// host reservations defined for them.</span> <span class="st0">"pools"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"pool"</span><span class="sy0">:</span> <span class="st0">"192.0.2.1 - 192.0.2.200"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// These are options that are subnet specific. In most cases,</span> <span class="co1">// you need to define at least routers option, as without this</span> <span class="co1">// option your clients will not be able to reach their default</span> <span class="co1">// gateway and will not have Internet connectivity.</span> <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// For each IPv4 subnet you most likely need to specify at</span> <span class="co1">// least one router.</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"routers"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"192.0.2.1"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// Kea offers host reservations mechanism. Kea supports reservations</span> <span class="co1">// by several different types of identifiers: hw-address</span> <span class="co1">// (hardware/MAC address of the client), duid (DUID inserted by the</span> <span class="co1">// client), client-id (client identifier inserted by the client) and</span> <span class="co1">// circuit-id (circuit identifier inserted by the relay agent).</span> <span class="co1">//</span> <span class="co1">// Kea also support flexible identifier (flex-id), which lets you</span> <span class="co1">// specify an expression that is evaluated for each incoming packet.</span> <span class="co1">// Resulting value is then used for as an identifier.</span> <span class="co1">//</span> <span class="co1">// Note that reservations are subnet-specific in Kea. This is</span> <span class="co1">// different than ISC DHCP. Keep that in mind when migrating</span> <span class="co1">// your configurations.</span> <span class="st0">"reservations"</span><span class="sy0">:</span> <span class="br0">[</span>   <span class="co1">// This is a reservation for a specific hardware/MAC address.</span> <span class="co1">// It's a rather simple reservation: just an address and nothing</span> <span class="co1">// else.</span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"1a:1b:1c:1d:1e:1f"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"192.0.2.201"</span> <span class="br0">}</span>,   <span class="co1">// This is a reservation for a specific client-id. It also shows</span> <span class="co1">// the this client will get a reserved hostname. A hostname can</span> <span class="co1">// be defined for any identifier type, not just client-id.</span> <span class="br0">{</span> <span class="st0">"client-id"</span><span class="sy0">:</span> <span class="st0">"01:11:22:33:44:55:66"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"192.0.2.202"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"special-snowflake"</span> <span class="br0">}</span>,   <span class="co1">// The third reservation is based on DUID. This reservation defines</span> <span class="co1">// a special option values for this particular client. If the</span> <span class="co1">// domain-name-<span class="search_hit">servers</span> option would have been defined on a global,</span> <span class="co1">// subnet or class level, the host specific values take preference.</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"01:02:03:04:05"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"192.0.2.203"</span>, <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-name-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.1.1.202, 10.1.1.203"</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span>,   <span class="co1">// The fourth reservation is based on circuit-id. This is an option</span> <span class="co1">// inserted by the relay agent that forwards the packet from client</span> <span class="co1">// to the server. In this example the host is also assigned vendor</span> <span class="co1">// specific options.</span> <span class="co1">//</span> <span class="co1">// When using reservations, it is useful to configure</span> <span class="co1">// reservations-global, reservations-in-subnet,</span> <span class="co1">// reservations-out-of-pool (subnet specific parameters)</span> <span class="co1">// and host-reservation-identifiers (global parameter).</span> <span class="br0">{</span> <span class="st0">"client-id"</span><span class="sy0">:</span> <span class="st0">"01:12:23:34:45:56:67"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"192.0.2.204"</span>, <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"vivso-suboptions"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"4491"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"tftp-<span class="search_hit">servers</span>"</span>, <span class="st0">"space"</span><span class="sy0">:</span> <span class="st0">"vendor-4491"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.1.1.202, 10.1.1.203"</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span>, <span class="co1">// This reservation is for a client that needs specific DHCPv4</span> <span class="co1">// fields to be set. Three supported fields are next-server,</span> <span class="co1">// server-hostname and boot-file-name</span> <span class="br0">{</span> <span class="st0">"client-id"</span><span class="sy0">:</span> <span class="st0">"01:0a:0b:0c:0d:0e:0f"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"192.0.2.205"</span>, <span class="st0">"next-server"</span><span class="sy0">:</span> <span class="st0">"192.0.2.1"</span>, <span class="st0">"server-hostname"</span><span class="sy0">:</span> <span class="st0">"hal9000"</span>, <span class="st0">"boot-file-name"</span><span class="sy0">:</span> <span class="st0">"/dev/null"</span> <span class="br0">}</span>, <span class="co1">// This reservation is using flexible identifier. Instead of</span> <span class="co1">// relying on specific field, sysadmin can define an expression</span> <span class="co1">// similar to what is used for client classification,</span> <span class="co1">// e.g. substring(relay[0].option[17],0,6). Then, based on the</span> <span class="co1">// value of that expression for incoming packet, the reservation</span> <span class="co1">// is matched. Expression can be specified either as hex or</span> <span class="co1">// plain text using single quotes.</span> <span class="co1">//</span> <span class="co1">// Note: flexible identifier requires flex_id hook library to be</span> <span class="co1">// loaded to work.</span> <span class="br0">{</span> <span class="st0">"flex-id"</span><span class="sy0">:</span> <span class="st0">"'s0mEVaLue'"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"192.0.2.206"</span> <span class="br0">}</span> <span class="co1">// You can add more reservations here.</span> <span class="br0">]</span> <span class="co1">// You can add more subnets there.</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// There are many, many more parameters that DHCPv4 server is able to use.</span> <span class="co1">// They were not added here to not overwhelm people with too much</span> <span class="co1">// information at once.</span>   <span class="co1">// Logging configuration starts here. Kea uses different loggers to log various</span> <span class="co1">// activities. For details (e.g. names of loggers), see Chapter 18.</span> <span class="st0">"loggers"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// This section affects kea-dhcp4, which is the base logger for DHCPv4</span> <span class="co1">// component. It tells DHCPv4 server to write all log messages (on</span> <span class="co1">// severity INFO or more) to a file.</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"kea-dhcp4"</span>, <span class="st0">"output_options"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// Specifies the output file. There are several special values</span> <span class="co1">// supported:</span> <span class="co1">// - stdout (prints on standard output)</span> <span class="co1">// - stderr (prints on standard error)</span> <span class="co1">// - syslog (logs to syslog)</span> <span class="co1">// - syslog:name (logs to syslog using specified name)</span> <span class="co1">// Any other value is considered a name of the file</span> <span class="st0">"output"</span><span class="sy0">:</span> <span class="st0">"/var/log/kea-dhcp4.log"</span>   <span class="co1">// Shorter log pattern suitable for use with systemd,</span> <span class="co1">// avoids redundant information</span> <span class="co1">// "pattern": "%-5p %m\n",</span>   <span class="co1">// This governs whether the log output is flushed to disk after</span> <span class="co1">// every write.</span> <span class="co1">// "flush": false,</span>   <span class="co1">// This specifies the maximum size of the file before it is</span> <span class="co1">// rotated.</span> <span class="co1">// "maxsize": 1048576,</span>   <span class="co1">// This specifies the maximum number of rotated files to keep.</span> <span class="co1">// "maxver": 8</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="co1">// This specifies the severity of log messages to keep. Supported values</span> <span class="co1">// are: FATAL, ERROR, WARN, INFO, DEBUG</span> <span class="st0">"severity"</span><span class="sy0">:</span> <span class="st0">"INFO"</span>,   <span class="co1">// If DEBUG level is specified, this value is used. 0 is least verbose,</span> <span class="co1">// 99 is most verbose. Be cautious, Kea can generate lots and lots</span> <span class="co1">// of logs if told to do so.</span> <span class="st0">"debuglevel"</span><span class="sy0">:</span> <span class="nu0">0</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">}</span></pre> </dd></dl> </div> <p> Bevor wir nun aber unseren Kea-DHCPv4-Daemon individuell nach unseren Bedürfnissen hin anpassen, werden wir zunächst die im Paket mitgelieferte Original-Konfigurationsdatei <strong><code>/etc/kea/kea-dhcp4.conf</code></strong> für spätere Referenzen sichern. </p> <pre class="code"> # cp -a /etc/kea/kea-dhcp4.conf /etc/kea/kea-dhcp4.conf.orig</pre> <p> So können wir später bei etwaigen Bedarf Vergleiche zur originalen Konfigurationsdatei mit einer neuen Version bei einem Update des KEA-Paketes anstreben, wie in diesem Beispiel hier: </p> <pre class="code"> # vimdiff /etc/kea/kea-dhcp4.conf.orig /etc/kea/kea-dhcp4.conf.pacnew</pre> <p> <img src="/lib/exe/fetch.php/linux:kea_vimdiff.png?w=900&tok=92a4fb" class="mediacenter img-responsive" loading="lazy" title="Bild: Bildschirmharcopy des Aufgrufes 'vimdiff /etc/kea/kea-dhcp4.conf.orig /etc/kea/kea-dhcp4.conf.pacnew'" alt="Bild: Bildschirmharcopy des Aufgrufes 'vimdiff /etc/kea/kea-dhcp4.conf.orig /etc/kea/kea-dhcp4.conf.pacnew'" width="900" /> </p> <p> Aus den oben genannten Konfigurationsparametern erstellen wir uns nun eine entsprechende Konfigurationsdatei <strong><code>/etc/kea/kea-dhcp4.conf</code></strong> für unseren Kea-DHCPv4-Daemon. </p> <pre class="code"> # vim /etc/kea/kea-dhcp4.conf</pre> <dl class="file"> <dt><a href="/doku.php/linux:kea?do=export_code&codeblock=8" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/kea/kea-dhcp4.conf</a></dt> <dd><pre class="code file java"><span class="co1">// This is a basic configuration for the Kea DHCPv4 server. See section</span> <span class="co1">// 8.2. DHCPv4 Server Configuration for detailed informations.</span> <span class="co1">//</span> <span class="co1">// This configuration file contains only DHCPv4 server's configuration.</span> <span class="co1">// If configurations for other Kea services are also included in this file they</span> <span class="co1">// are ignored by the DHCPv4 server.</span> <span class="br0">{</span>   <span class="co1">// DHCPv4 configuration starts here. This section will be read by DHCPv4 server</span> <span class="co1">// and will be ignored by other components.</span> <span class="st0">"Dhcp4"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="co1">// See section 8.2.4 Interface Configuration for more details.</span> <span class="st0">"interfaces-config"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"interfaces"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"net0"</span>, <span class="st0">"net1"</span> <span class="br0">]</span>, <span class="st0">"dhcp-socket-type"</span><span class="sy0">:</span> <span class="st0">"raw"</span> <span class="br0">}</span>,   <span class="co1">// See section 8.9. Management API for the DHCPv4 Server for more details.</span> <span class="st0">"control-socket"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"socket-type"</span><span class="sy0">:</span> <span class="st0">"unix"</span>, <span class="st0">"socket-name"</span><span class="sy0">:</span> <span class="st0">"/var/lib/kea/kea4-ctrl-socket"</span> <span class="br0">}</span>,   <span class="co1">// See Section 8.2.2.1. Memfile - Basic Storage for Leases" for details.</span> <span class="st0">"lease-database"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"type"</span><span class="sy0">:</span> <span class="st0">"memfile"</span>, <span class="st0">"persist"</span><span class="sy0">:</span> <span class="kw2">true</span>, <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"/var/lib/kea/kea-leases4.csv"</span>, <span class="st0">"lfc-interval"</span><span class="sy0">:</span> <span class="nu0">3240</span>, <span class="st0">"max-row-errors"</span><span class="sy0">:</span> <span class="nu0">100</span> <span class="br0">}</span>,   <span class="co1">// Setup reclamation of the expired leases and leases affinity.</span> <span class="co1">// See section 11. Lease Expiration for more and detailed informations.</span> <span class="st0">"expired-leases-processing"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"reclaim-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">10</span>, <span class="st0">"flush-reclaimed-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">25</span>, <span class="st0">"hold-reclaimed-time"</span><span class="sy0">:</span> <span class="nu0">3600</span>, <span class="st0">"max-reclaim-leases"</span><span class="sy0">:</span> <span class="nu0">100</span>, <span class="st0">"max-reclaim-time"</span><span class="sy0">:</span> <span class="nu0">250</span>, <span class="st0">"unwarned-reclaim-cycles"</span><span class="sy0">:</span> <span class="nu0">5</span> <span class="br0">}</span>,   <span class="co1">// Global timers specified here apply to all subnets, unless there are</span> <span class="co1">// subnet specific values defined in particular subnets. See section</span> <span class="co1">// 8.2.1. Introduction ans section 8.2.9. Sending T1 (Option 58) and T2 </span> <span class="co1">// (Option 59) for details. </span> <span class="st0">"renew-timer"</span><span class="sy0">:</span> <span class="nu0">1800</span>, <span class="st0">"rebind-timer"</span><span class="sy0">:</span> <span class="nu0">3200</span>, <span class="st0">"valid-lifetime"</span><span class="sy0">:</span> <span class="nu0">3600</span>,   <span class="co1">// Many additional parameters can be specified here. Alle datails will be</span> <span class="co1">// found in following sections:</span> <span class="co1">// - 8.2.10. Standard DHCPv4 Options</span> <span class="co1">// - 8.2.11. Custom DHCPv4 Options</span> <span class="co1">// - 8.2.12. DHCPv4 Private Options </span> <span class="co1">// - 8.2.13. DHCPv4 Vendor-Specific Options</span> <span class="co1">// - 8.2.14. Nested DHCPv4 Options (Custom Option Spaces) </span> <span class="co1">// - 8.2.15. Unspecified Parameters for DHCPv4 Option Configuration</span> <span class="co1">// - 8.2.16. Support for Long Options</span> <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="co1">// Domain-Name-Server:</span> <span class="co1">//{</span> <span class="co1">// "name": "domain-name-<span class="search_hit">servers</span>",</span> <span class="co1">// "data": "10.0.10.27"</span> <span class="co1">//},</span>   <span class="co1">// Domain-Name:</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-name"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// Time-Server:</span> <span class="co1">//{</span> <span class="co1">// "name": "ntp-<span class="search_hit">servers</span>",</span> <span class="co1">// "data": "10.0.0.17"</span> <span class="co1">//},</span>   <span class="co1">// Time-Offset ( Eastern Standard Time):</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"time-offset"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"-18000"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// Finally, we list the subnets from which we will be leasing addresses.</span> <span class="co1">// See section 8.2.6. IPv4 Subnet Identifier and the following sections</span> <span class="co1">// for more details.</span> <span class="st0">"subnet4"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// This defines the whole subnet. Kea will use this information to</span> <span class="co1">// determine where the clients are connected. This is the whole</span> <span class="co1">// subnet in your network.</span>   <span class="co1">// Subnet identifier should be unique for each subnet.</span> <span class="st0">"id"</span><span class="sy0">:</span> <span class="nu0">1</span>,   <span class="co1">// This is mandatory parameter for each subnet.</span> <span class="st0">"subnet"</span><span class="sy0">:</span> <span class="st0">"10.0.10.0/24"</span>,   <span class="co1">// Pools define the actual part of your subnet that is governed</span> <span class="co1">// by Kea.</span> <span class="st0">"pools"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"pool"</span><span class="sy0">:</span> <span class="st0">"10.0.10.230 - 10.0.10.250"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// These are options that are subnet specific.</span> <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// Router for the IPv4 subnet.</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"routers"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.0.10.110"</span> <span class="br0">}</span>,   <span class="br0">{</span> <span class="co1">// Time-Server:</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"ntp-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.0.10.110"</span> <span class="br0">}</span>,   <span class="br0">{</span> <span class="co1">// Domain-Name-Server:</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-name-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.0.10.27"</span> <span class="br0">}</span>   <span class="br0">]</span>,   <span class="co1">// Kea offers host reservations mechanism. Kea supports reservations</span> <span class="co1">// by several different types of identifiers: hw-address</span> <span class="co1">// (hardware/MAC address of the client), duid (DUID inserted by the</span> <span class="co1">// client), client-id (client identifier inserted by the client) and</span> <span class="co1">// circuit-id (circuit identifier inserted by the relay agent).</span> <span class="st0">"reservations"</span><span class="sy0">:</span> <span class="br0">[</span>   <span class="co1">// This are the reservations for a specific hardware/MAC addresses.</span> <span class="co1">// MNSS (c7)</span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"ac:1f:6b:00:d3:9a"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.10.2"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pml010002.intra.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// MNSS-IPMI (C7)</span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"00:25:90:13:ba:a2"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.10.3"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pnc010003.intra.nausch.org"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"reservations"</span><span class="sy0">:</span> <span class="br0">[</span>   <span class="co1">// This are the reservations for a specific hardware/MAC addresses.</span> <span class="co1">// vml000200 </span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:01"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.200"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000200.dmz.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// vml000201</span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:11"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.201"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000201.dmz.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// vml000202</span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:21"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.202"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000202.dmz.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// vml000203</span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:31"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.203"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000203.dmz.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// vml000204</span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:41"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.204"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000204.dmz.nausch.org"</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// Logging configuration starts here. Kea uses different loggers to log various</span> <span class="co1">// activities. For details (e.g. names of loggers), see Chapter 18.</span> <span class="st0">"loggers"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// This section affects kea-dhcp4, which is the base logger for DHCPv4</span> <span class="co1">// component. It tells DHCPv4 server to write all log messages (on</span> <span class="co1">// severity INFO or more) to a file.</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"kea-dhcp4"</span>, <span class="st0">"output_options"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// Specifies the output file. There are several special values</span> <span class="co1">// supported:</span> <span class="co1">// - stdout (prints on standard output)</span> <span class="co1">// - stderr (prints on standard error)</span> <span class="co1">// - syslog (logs to syslog)</span> <span class="co1">// - syslog:name (logs to syslog using specified name)</span> <span class="co1">// Any other value is considered a name of the file</span> <span class="st0">"output"</span><span class="sy0">:</span> <span class="st0">"syslog"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="co1">// This specifies the severity of log messages to keep. Supported values</span> <span class="co1">// are: FATAL, ERROR, WARN, INFO, DEBUG</span> <span class="st0">"severity"</span><span class="sy0">:</span> <span class="st0">"INFO"</span>,   <span class="co1">// If DEBUG level is specified, this value is used. 0 is least verbose,</span> <span class="co1">// 99 is most verbose. Be cautious, Kea can generate lots and lots</span> <span class="co1">// of logs if told to do so.</span> <span class="st0">"debuglevel"</span><span class="sy0">:</span> <span class="nu0">0</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">}</span></pre> </dd></dl> <p> Wollen wir die Kondfigurationsdate ohne die Kommentare sehen, grep'en wir einfach entsprechend danach. </p> <pre class="code"> # grep -Ev '(^.*//|^$)' /etc/kea/kea-dhcp4.conf</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_3">Beispielkonfigurationsdatei ohne Kommentare </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_3"><dl class="file"> <dt><a href="/doku.php/linux:kea?do=export_code&codeblock=9" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/kea/kea-dhcp4.conf</a></dt> <dd><pre class="code file java"><span class="br0">{</span> <span class="st0">"Dhcp4"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"interfaces-config"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"interfaces"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"net0"</span>, <span class="st0">"net1"</span> <span class="br0">]</span>, <span class="st0">"dhcp-socket-type"</span><span class="sy0">:</span> <span class="st0">"raw"</span> <span class="br0">}</span>, <span class="st0">"control-socket"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"socket-type"</span><span class="sy0">:</span> <span class="st0">"unix"</span>, <span class="st0">"socket-name"</span><span class="sy0">:</span> <span class="st0">"/var/lib/kea/kea4-ctrl-socket"</span> <span class="br0">}</span>, <span class="st0">"lease-database"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"type"</span><span class="sy0">:</span> <span class="st0">"memfile"</span>, <span class="st0">"persist"</span><span class="sy0">:</span> <span class="kw2">true</span>, <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"/var/lib/kea/kea-leases4.csv"</span>, <span class="st0">"lfc-interval"</span><span class="sy0">:</span> <span class="nu0">3240</span>, <span class="st0">"max-row-errors"</span><span class="sy0">:</span> <span class="nu0">100</span> <span class="br0">}</span>, <span class="st0">"expired-leases-processing"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"reclaim-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">10</span>, <span class="st0">"flush-reclaimed-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">25</span>, <span class="st0">"hold-reclaimed-time"</span><span class="sy0">:</span> <span class="nu0">3600</span>, <span class="st0">"max-reclaim-leases"</span><span class="sy0">:</span> <span class="nu0">100</span>, <span class="st0">"max-reclaim-time"</span><span class="sy0">:</span> <span class="nu0">250</span>, <span class="st0">"unwarned-reclaim-cycles"</span><span class="sy0">:</span> <span class="nu0">5</span> <span class="br0">}</span>, <span class="st0">"renew-timer"</span><span class="sy0">:</span> <span class="nu0">1800</span>, <span class="st0">"rebind-timer"</span><span class="sy0">:</span> <span class="nu0">3200</span>, <span class="st0">"valid-lifetime"</span><span class="sy0">:</span> <span class="nu0">3600</span>, <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-name"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"time-offset"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"-18000"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"subnet4"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"id"</span><span class="sy0">:</span> <span class="nu0">1</span>, <span class="st0">"subnet"</span><span class="sy0">:</span> <span class="st0">"10.0.10.0/24"</span>, <span class="st0">"pools"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"pool"</span><span class="sy0">:</span> <span class="st0">"10.0.10.230 - 10.0.10.250"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"routers"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.0.10.110"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"ntp-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.0.10.110"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-name-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.0.10.27"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"reservations"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"ac:1f:6b:00:d3:9a"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.10.2"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pml010002.intra.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"00:25:90:13:ba:a2"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.10.3"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pnc010003.intra.nausch.org"</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"id"</span><span class="sy0">:</span> <span class="nu0">2</span>, <span class="st0">"subnet"</span><span class="sy0">:</span> <span class="st0">"10.0.0.0/24"</span>, <span class="st0">"pools"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"pool"</span><span class="sy0">:</span> <span class="st0">"10.0.0.240 - 10.0.0.254"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"routers"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.0.0.210"</span> <span class="br0">}</span>,   <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"ntp-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"10.0.0.110"</span> <span class="br0">}</span>,   <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-name-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"172.17.2.1"</span> <span class="br0">}</span>   <span class="br0">]</span>, <span class="st0">"reservations"</span><span class="sy0">:</span> <span class="br0">[</span>   <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:01"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.200"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000200.dmz.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:11"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.201"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000201.dmz.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:21"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.202"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000202.dmz.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:31"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.203"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000203.dmz.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"52:54:00:41:20:41"</span>, <span class="st0">"ip-address"</span><span class="sy0">:</span> <span class="st0">"10.0.0.204"</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml000204.dmz.nausch.org"</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"loggers"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"kea-dhcp4"</span>, <span class="st0">"output_options"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"output"</span><span class="sy0">:</span> <span class="st0">"syslog"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"severity"</span><span class="sy0">:</span> <span class="st0">"INFO"</span>, <span class="st0">"debuglevel"</span><span class="sy0">:</span> <span class="nu0">0</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">}</span></pre> </dd></dl> </div> <p> Bevor wir nun unseren <strong>kea-dhcp4</strong> starten, führen wir noch einen Konfigurationstest durch. Wir prüfen also nun die Konfigurationsdatei unseres <strong>kea-dhcp4</strong> auf syntaktische Fehler. </p> <pre class="code"> # kea-dhcp4 -t /etc/kea/kea-dhcp4.conf</pre> <pre class="code">2024-07-04 17:23:55.327 INFO [kea-dhcp4.hosts/1913.135232873002112] HOSTS_BACKENDS_REGISTERED the following host backend types are available: mysql postgresql 2024-07-04 17:23:55.328 WARN [kea-dhcp4.dhcpsrv/1913.135232873002112] DHCPSRV_MT_DISABLED_QUEUE_CONTROL disabling dhcp queue control when multi-threading is enabled. 2024-07-04 17:23:55.328 WARN [kea-dhcp4.dhcp4/1913.135232873002112] DHCP4_RESERVATIONS_LOOKUP_FIRST_ENABLED Multi-threading is enabled and host reservations lookup is always performed first. 2024-07-04 17:23:55.328 INFO [kea-dhcp4.dhcpsrv/1913.135232873002112] DHCPSRV_CFGMGR_NEW_SUBNET4 a new subnet has been added to configuration: 10.0.10.0/24 with params: t1=1800, t2=3200, valid-lifetime=3600 2024-07-04 17:23:55.330 INFO [kea-dhcp4.dhcpsrv/1913.135232873002112] DHCPSRV_CFGMGR_NEW_SUBNET4 a new subnet has been added to configuration: 10.0.0.0/24 with params: t1=1800, t2=3200, valid-lifetime=3600 2024-07-04 17:23:55.330 INFO [kea-dhcp4.dhcpsrv/1913.135232873002112] DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type raw 2024-07-04 17:23:55.330 INFO [kea-dhcp4.dhcpsrv/1913.135232873002112] DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type raw 2024-07-04 17:23:55.331 INFO [kea-dhcp4.dhcpsrv/1913.135232873002112] DHCPSRV_CFGMGR_ADD_IFACE listening on interface net0 2024-07-04 17:23:55.331 INFO [kea-dhcp4.dhcpsrv/1913.135232873002112] DHCPSRV_CFGMGR_ADD_IFACE listening on interface net1</pre> </div> <h4 class="sectionedit21" id="start_des_kea-dhcp4">Start des kea-dhcp4</h4> <div class="level4"> <p> Nun können wir beruhigt und guten Mutes unseren <strong>kea-dhcp4</strong> Daemon starten. </p> <pre class="code"> # systemctl start kea-dhcp4.service</pre> <p> Im <strong>Journal</strong> wir der Start entsprechend dokumentiert. </p> <p> <pre class="code">Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.commands.136533820646528] COMMAND_ACCEPTOR_START Starting to accept connections via unix domain socket bound to /var/lib/kea/kea4-ctrl-socket Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533820646528] DHCP4_CONFIG_COMPLETE DHCPv4 server has completed configuration: added IPv4 subnets: 2; DDNS: disabled Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_MEMFILE_DB opening memory file lease database: lfc-interval=3240 max-row-errors=100 name=/var/lib/kea/kea-leases4.csv persist=true type=memfile universe=4 Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/kea-leases4.csv Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_MEMFILE_EXTRACT_EXTENDED_INFO4 extracting extended info saw 0 leases, extended info sanity checks modified 0 / updated 0 leases and 0 leases have relay or remote id Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_MEMFILE_LFC_SETUP setting up the Lease File Cleanup interval to 3240 sec Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for V4 leases in subnet 10.0.10.0/24 Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for V4 leases in subnet 10.0.0.0/24 Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: <font style="color: rgb(201, 214, 95)"><b>WARN [kea-dhcp4.dhcp4.136533820646528] DHCP4_MULTI_THREADING_INFO enabled: yes, number of threads: 4, queue size: 64</b></font> Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533820646528] DHCP4_STARTED Kea DHCPv4 server version 2.6.0 started</pre> </p> <p> Bei Bedarf können wir natürlich auch den Status unseres Daemons jederzeit abfragen. </p> <pre class="code"> # systemctl status kea-dhcp4.service</pre> <p> <pre class="code"> <font style="color: rgb(29, 180, 29)"><b>●</b></font> kea-dhcp4.service - ISC Kea IPv4 DHCP daemon Loaded: loaded (/usr/lib/systemd/system/kea-dhcp4.service; </font><font style="color: rgb(29, 180, 29)"><b>disabled</b></font>; preset: <font style="color: rgb(201, 214, 95)"><b>disabled</b></font>) Active:<font style="color: rgb(29, 180, 29)"><b>active (running)</b></font> since Thu 2024-07-04 17:25:35 CEST; 1min 59s ago Invocation: eb623acd23f840859c8bd34084dd4e82 Docs: man:kea-dhcp4(8) Main PID: 1955 (kea-dhcp4) Tasks: 9 (limit: 9510) Memory: 3M (peak: 3.7M) CPU: 61ms CGroup: /system.slice/kea-dhcp4.service └─1955 /usr/bin/kea-dhcp4 -c /etc/kea/kea-dhcp4.conf Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.commands.136533820646528] COMMAND_ACCEPTOR_START Starting to accept connections via unix domain socket bound to /var/lib/kea/kea4-ctrl-socket Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533820646528] DHCP4_CONFIG_COMPLETE DHCPv4 server has completed configuration: added IPv4 subnets: 2; DDNS: disabled Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_MEMFILE_DB opening memory file lease database: lfc-interval=3240 max-row-errors=100 name=/var/lib/kea/kea-leases4.csv > Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/kea-leases4.csv Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_MEMFILE_EXTRACT_EXTENDED_INFO4 extracting extended info saw 0 leases, extended info sanity checks modified 0 / updated> Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_MEMFILE_LFC_SETUP setting up the Lease File Cleanup interval to 3240 sec Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for V4 leases in subnet 10.0.10.0/24 Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcpsrv.136533820646528] DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for V4 leases in subnet 10.0.0.0/24 Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: <font style="color: rgb(201, 214, 95)"><b>WARN [kea-dhcp4.dhcp4.136533820646528] DHCP4_MULTI_THREADING_INFO enabled: yes, number of threads: 4, queue size: 64</b></font> Jul 04 17:25:35 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533820646528] DHCP4_STARTED Kea DHCPv4 server version 2.6.0 started</font></pre> </p> <p> Verbindet sich nun ein uns unbekannter Host und kontaktiert unseren <strong>kea-dhcp4</strong>-Daemon wird der erfolgreiche Handshake im <strong>Journal</strong> protokolliert. </p> <pre class="code"> # journalctl -fu kea-dhcp4</pre> <pre class="code">Jul 04 17:45:55 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533786449600] DHCP4_QUERY_LABEL received query: [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0xa7b514ea Jul 04 17:45:55 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533786449600] DHCP4_PACKET_RECEIVED [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0xa7b514ea: DHCPREQUEST (type 3) received from 0.0.0.0 to 255.255.255.255 on interface net1 Jul 04 17:45:55 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.leases.136533786449600] DHCP4_INIT_REBOOT [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0xa7b514ea: client is in INIT-REBOOT state and requests address 10.0.10.231 Jul 04 17:45:57 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533778056896] DHCP4_QUERY_LABEL received query: [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x4f87482f Jul 04 17:45:57 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533778056896] DHCP4_PACKET_RECEIVED [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x4f87482f: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface net1 Jul 04 17:45:57 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.leases.136533778056896] DHCP4_LEASE_OFFER [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x4f87482f: lease 10.0.10.231 will be offered Jul 04 17:45:57 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533778056896] DHCP4_PACKET_SEND [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x4f87482f: trying to send packet DHCPOFFER (type 2) from 10.0.10.110:67 to 10.0.10.231:68 on interface net1 Jul 04 17:45:57 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533761271488] DHCP4_QUERY_LABEL received query: [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x4f87482f Jul 04 17:45:57 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533761271488] DHCP4_PACKET_RECEIVED [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x4f87482f: DHCPREQUEST (type 3) received from 0.0.0.0 to 255.255.255.255 on interface net1 Jul 04 17:45:57 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.leases.136533761271488] DHCP4_LEASE_ALLOC [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x4f87482f: lease 10.0.10.231 has been allocated for 3600 seconds Jul 04 17:45:57 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533761271488] DHCP4_PACKET_SEND [hwtype=1 00:11:22:33:44:55], cid=[01:00:11:22:33:44:55], tid=0x4f87482f: trying to send packet DHCPACK (type 5) from 10.0.10.110:67 to 10.0.10.231:68 on interface net1</pre> <p> Dem Client wurde also die IP-Adresse <strong><code>10.0.10.231</code></strong> aus unserem Pool zugewiesen, da wir dessen MAC-Adresse <strong><code>00:11:22:33:44:55</code></strong> nicht kennen! </p> <p> Verbindet sich jedoch nun ein uns bekannter Client, dessen MAC-Adresse <strong><code>ac:1f:6b:00:d3:9a</code></strong> wir bei den <strong>Reservierungen</strong> der IP-Adresse <strong><code>10.0.10.2</code></strong> zugeordnet hatten, mit unserem Kea-Host, sehen wir im Journal entsprechend: </p> <pre class="code"> # journalctl -fu kea-dhcp4</pre> <pre class="code">Jul 04 17:55:51 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533778056896] DHCP4_QUERY_LABEL received query: [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0xaf0fd69a Jul 04 17:55:51 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533778056896] DHCP4_PACKET_RECEIVED [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0xaf0fd69a: DHCPREQUEST (type 3) received from 0.0.0.0 to 255.255.255.255 on interface net1 Jul 04 17:55:51 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.leases.136533778056896] DHCP4_INIT_REBOOT [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0xaf0fd69a: client is in INIT-REBOOT state and requests address 10.0.10.231 Jul 04 17:55:53 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533761271488] DHCP4_QUERY_LABEL received query: [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0x9d121859 Jul 04 17:55:53 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533761271488] DHCP4_PACKET_RECEIVED [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0x9d121859: DHCPDISCOVER (type 1) received from 0.0.0.0 to 255.255.255.255 on interface net1 Jul 04 17:55:53 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.leases.136533761271488] DHCP4_LEASE_OFFER [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0x9d121859: lease 10.0.10.2 will be offered Jul 04 17:55:53 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533761271488] DHCP4_PACKET_SEND [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0x9d121859: trying to send packet DHCPOFFER (type 2) from 10.0.10.110:67 to 10.0.10.2:68 on interface net1 Jul 04 17:55:53 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.dhcp4.136533769664192] DHCP4_QUERY_LABEL received query: [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0x9d121859 Jul 04 17:55:53 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533769664192] DHCP4_PACKET_RECEIVED [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0x9d121859: DHCPREQUEST (type 3) received from 0.0.0.0 to 255.255.255.255 on interface net1 Jul 04 17:55:53 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.leases.136533769664192] DHCP4_LEASE_ALLOC [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0x9d121859: lease 10.0.10.2 has been allocated for 3600 seconds Jul 04 17:55:53 vml000110 kea-dhcp4[1955]: INFO [kea-dhcp4.packets.136533769664192] DHCP4_PACKET_SEND [hwtype=1 ac:1f:6b:00:d3:9a], cid=[01:ac:1f:6b:00:d3:9a], tid=0x9d121859: trying to send packet DHCPACK (type 5) from 10.0.10.110:67 to 10.0.10.2:68 on interface net1</pre> <p> Der Host hat also seine vordefinierte <strong>feste IPv4-Adresse</strong> <strong><code>10.0.10.2</code></strong> vom <strong>kea-dhcp4</strong>-Damon erfolgreich zugewiesen bekommen! </p> </div> <h3 class="sectionedit22 page-header pb-3 mb-4 mt-5" id="stateful_dhcpv6_server">Stateful DHCPv6 Server</h3> <div class="level3"> <p> Ein <strong>Stateful DHCPv6-Server</strong> liefert neben IPv6-Adressen auch weitere Informationen, wie z.B. wie eine <abbr title="Domain Name System">DNS</abbr>-Serverliste und einen Domänennamen, an einen Host aus. Hosts. Dieser Stateful DHCPv6-Server behält auch den Status jeder Zuweisung im Auge, sprich er verfolgt die Verfügbarkeit des Adresspools und löst doppelte Adresskonflikte auf. Darüber hinaus protokolliert er jede Zuweisung und behält die Ablaufzeiten im Auge. Im Gegensatz zu IPv4 stellt ein Stateful DHCPv6-Server den Hosts keine Standard-Gateway-Adressen zur Verfügung, das kann bei IPv6 nur Router, die Router Advertisement-Nachrichten sendet wie z.B. unser <strong><a href="/doku.php/linux:radvd#router_advertisement_icmpv6-nachrichten_fuer_stateful_dhcpv6" class="wikilink1" title="linux:radvd" data-wiki-id="linux:radvd">radvd</a></strong>! </p> <p> Nun wollen wir uns eingehender mit der Konfiguration unseres DHCPv6-Daemons befassen. Die zugehörige Original-Dokumentation findet sich im Abschnitt <strong><a href="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#dhcpv6-server-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#dhcpv6-server-configuration" rel="ugc nofollow noopener">9.2. DHCPv6 Server Configuration</a></strong>. </p> </div> <h4 class="sectionedit23" id="konfigurationsoptionen_fuer_unseren_dhcpv6-daemon">Konfigurationsoptionen für unseren DHCPv6-Daemon</h4> <div class="level4"> <p> In unserer Betriebsumgebung haben wir folgende Rahmenbedingungen für unseren DHCPv6-Server: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#interface-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#interface-configuration" rel="ugc nofollow noopener">Netzwerkinterface</a></strong> : <br/> Unser DHCPv4-Daemon soll „nur“ auf dem Netzwerkinterface <strong><code>net1</code></strong> (<strong>intra</strong>) auf entsprechende Adressanfragen lauschen und entsprechend Adressen ausliefern.</div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#management-api-for-the-dhcpv6-server" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#management-api-for-the-dhcpv6-server" rel="ugc nofollow noopener">Management API</a></strong> : <br/> Die Verwaltungs-<abbr title="Application Programming Interface">API</abbr> ermöglicht die Ausgabe spezifischer Verwaltungsbefehle, wie z. B. das Abrufen von Statistiken, die Neukonfiguration oder das Herunterfahren. Die <abbr title="Application Programming Interface">API</abbr> soll unter dem <strong><code>socket-type</code></strong> = <strong><code>unix</code></strong> der unter dem Link <strong><code>socket-name</code></strong> = <strong><code>/var/lib/kea/kea6-ctrl-socket</code></strong> erreichbar sein.</div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#memfile-basic-storage-for-leases" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#memfile-basic-storage-for-leases" rel="ugc nofollow noopener">Leases</a></strong> : <br/> In unserer Beispielumgebung sollen die Leases unserer Clients in der Datei <strong><code>/var/lib/kea/dhcp6.leases</code></strong> vorgehalten werden. Optional wäre auch die Speicherung in einer <a href="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#lease-database-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#lease-database-configuration" rel="ugc nofollow noopener">MariaDB bzw. mySQL-Datenbank</a> oder in einer <a href="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#lease-database-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/dhcp6-srv.html#lease-database-configuration" rel="ugc nofollow noopener">PostgreSQL-Datenbank</a> denkbar. Aber im ersten Schritt wollen wir uns mal mit einer Ablage in einer Datei begnügen. Die Lease-Time soll eine Stunde, also <strong><code>3600</code></strong> Sekunden gelten. Nach 90% der max. Lease-Time soll der Daemon sein Lease-File aufräumen <strong>LFC</strong><sup><a href="#fn__9" id="fnt__9" class="fn_top">9)</a></sup> durchführt werden, also nach <strong><code>3200</code></strong> Sekunden <strong><code>lfc-interval</code></strong>. Dadurch werden redundante (historische) Informationen aus der Lease-Datei entfernt und die Grösse der Lease-Datei effektiv reduziert. Gibt es beim Laden des Lease-Files Fehler, soll der Server nach 100 Fehlern abbrechen und aufhören, zu versuchen die Lease-Datei zu laden.</div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/lease-expiration.html#lease-reclamation-configuration-parameters" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/lease-expiration.html#lease-reclamation-configuration-parameters" rel="ugc nofollow noopener">Lease Reclamation</a></strong> : <br/> Bei der Lease Reclamation, also der Rückforderung von Leases, bei dem abgelaufene Leases zurückgefordert und so anderen Clients wieder zur Verfügung gestellt werden. Hier übernehmen wir die vorgegebenen Default-Wertev von <strong><code>reclaim-timer-wait-time</code></strong> mit <strong><code>10</code></strong>, <strong><code>flush-reclaimed-timer-wait-time</code></strong> vomn <strong><code>25</code></strong>, <strong><code>hold-reclaimed-time</code></strong> von <strong><code>3600</code></strong>, <strong><code>max-reclaim-leases</code></strong> von <strong><code>100</code></strong>, <strong><code>max-reclaim-time</code></strong> von <strong><code>250</code></strong> und <strong><code>unwarned-reclaim-cycles</code></strong> von <strong><code>5</code></strong>.</div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/lease-expiration.html#lease-expiration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/lease-expiration.html#lease-expiration" rel="ugc nofollow noopener">Lease-Timer</a></strong> : <br/> Leases sollen eine Stunde, also <strong><code>valid-lifetime</code></strong> von <strong><code>3600</code></strong> Sekunden gelten. Nach <strong><code>1800</code></strong> Sekunden - das ist die 1/2 der <strong><code>valid-lifetime</code></strong> sollen die Clients nach einer Verlängerung der Lease fragen, also setzen wir <strong><code>renew-timer</code></strong> = <strong><code>1800</code></strong>. Die Clients sollen zusätzlich alle erreichbaren DHCP-Server fragen, ob die Lease noch einmal verlängert werden kann und dies nach <strong>90%</strong> der <strong><code>valid-lifetime</code></strong>, also setzen wir <strong><code>rebind-timer</code></strong> = <strong><code>3200</code></strong>. </div> </li> <li class="level1"><div class="li"> <strong><a href="https://kea.readthedocs.io/en/latest/arm/logging.html#logging-configuration" class="urlextern" target="_tab" title="https://kea.readthedocs.io/en/latest/arm/logging.html#logging-configuration" rel="ugc nofollow noopener">Logging</a></strong> : <br/> Da wir ein zentrales Logging und Auswertung mit Hilfe von <strong><a href="https://graylog.org/" class="urlextern" target="_tab" title="https://graylog.org/" rel="ugc nofollow noopener">Graylog</a></strong> einsetzen, lassen wir den DHCP4-Daemon <strong><em class="u">kein</em></strong> eigenes Logfile schreiben sondern nutzen unser zentrales syslog, welches der <strong><code>systemd-journald.service</code></strong> in unser <strong>Journal</strong> schreibt. Hierzu setzen wir die nötigen Parameter wie folgt: <strong><code>name</code></strong> gleich <strong><code>kea-dhcp4</code></strong>, <strong><code>output</code></strong> auf <strong><code>syslog</code></strong>, die <strong><code>severity</code></strong> gleich <strong><code>INFO</code></strong> und den <strong><code>debuglevel</code></strong> auf <strong><code>0</code></strong>.</div> </li> <li class="level1"><div class="li"> <strong>Name-Server</strong> : <br/> Der interne <abbr title="Domain Name System">DNS</abbr>-Daemon ist unter der IP-Adresse <strong><code>fd00::07:10:0:10.110</code></strong> erreichbar.</div> </li> <li class="level1"><div class="li"> <strong>Domain-Name</strong> : <br/> Der Name unserer Domain lautet <strong><code>nausch.org</code></strong>.</div> </li> <li class="level1"><div class="li"> <strong>Domain-Search-Liste</strong> : <br/> Auf Domain-Search-Listen wird bewusst verzichtet, da diese ein <a href="https://de.wikipedia.org/wiki/Anachronismus" class="urlextern" target="_tab" title="https://de.wikipedia.org/wiki/Anachronismus" rel="ugc nofollow noopener">Anachronismus</a> aus den Anfangszeiten des <abbr title="Domain Name System">DNS</abbr> sind und gerne alle Arten von Sicherheits- und Konfigurationsproblemen (DNSSEC, DNS64, QName-Minimization, <abbr title="Domain Name System">DNS</abbr>-Leakage von internen Konfigurationsdaten) erzeugen.</div> </li> <li class="level1"><div class="li"> <strong>Time-Server</strong> : <br/> Der interne Time-Server ist unter der IP-Adresse <strong><code>fd00::07:10:0:10.110</code></strong> erreichbar.</div> </li> <li class="level1 node"><div class="li"> <strong>Subnetz</strong> : <br/> Der DHCPv6-Server ist verantwortlich für das Sub-Netz <strong><code>fd00:0:0:7::/64</code></strong> der Zone <strong><code>intra</code></strong></div> <ul class=" fix-media-list-overlap"> <li class="level2"><div class="li"> <strong>Time-Server</strong> : <br/> Der interne Time-Server ist bei diesem Subnetz unter der IP-Adresse <strong><code>fd00::07:10:0:10.110</code></strong> erreichbar.</div> </li> <li class="level2"><div class="li"> <strong>Name-Server</strong> : <br/> Der interne <abbr title="Domain Name System">DNS</abbr>-Daemon ist unter der IP-Adresse <strong><code>fd00::07:10:0:10.110</code></strong> in diesem Subnetz erreichbar.</div> </li> <li class="level2"><div class="li"> <strong>Pool (dynamischer Adress-Bereich)</strong> : <br/> Dynamische IP-Adressen sollen aus dem Bereich von <strong><code>fd00:0:0:7:10:0:10:300/120</code></strong> vergeben werden. </div> </li> <li class="level2"><div class="li"> <strong>Reservierungen</strong> : <br/> Einige Hosts bekommen eine feste IP-Adresse, die der DHCP-Server an Hand der übermittelten DUID des Clients und seiner Netzwerkschnittstelle vergeben wird.</div> </li> </ul> </li> </ul> </div> <h4 class="sectionedit24" id="konfigurationsdatei_etc_kea-dhcp6conf">Konfigurationsdatei /etc/kea-dhcp6.conf</h4> <div class="level4"> <p> Bei der Installation unseres Kea-<span class="search_hit">Servers</span> wurde uns eine entsprechende Musterkonfigurations-Datei bereits mitgeliefert. </p> <pre class="code"> # less /etc/kea/kea-dhcp6.conf</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_4">/etc/kea/kea-dhcp6.conf </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_4"><dl class="file"> <dt><a href="/doku.php/linux:kea?do=export_code&codeblock=13" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/kea/kea-dhcp6.conf</a></dt> <dd><pre class="code file java"><span class="co1">// This is a basic configuration for the Kea DHCPv6 server. Subnet declarations</span> <span class="co1">// are mostly commented out and no interfaces are listed. Therefore, the <span class="search_hit">servers</span></span> <span class="co1">// will not listen or respond to any queries.</span> <span class="co1">// The basic configuration must be extended to specify interfaces on which</span> <span class="co1">// the <span class="search_hit">servers</span> should listen. There are a number of example options defined.</span> <span class="co1">// These probably don't make any sense in your network. Make sure you at least</span> <span class="co1">// update the following, before running this example in your network:</span> <span class="co1">// - change the network interface names</span> <span class="co1">// - change the subnets to match your actual network</span> <span class="co1">// - change the option values to match your network</span> <span class="co1">//</span> <span class="co1">// This is just a very basic configuration. Kea comes with large suite (over 30)</span> <span class="co1">// of configuration examples and extensive Kea User's Guide. Please refer to</span> <span class="co1">// those materials to get better understanding of what this software is able to</span> <span class="co1">// do. Comments in this configuration file sometimes refer to sections for more</span> <span class="co1">// details. These are section numbers in Kea User's Guide. The version matching</span> <span class="co1">// your software should come with your Kea package, but it is also available</span> <span class="co1">// in ISC's Knowledgebase (https://kea.readthedocs.io; the direct link for</span> <span class="co1">// the stable version is https://kea.readthedocs.io/).</span> <span class="co1">//</span> <span class="co1">// This configuration file contains only DHCPv6 server's configuration.</span> <span class="co1">// If configurations for other Kea services are also included in this file they</span> <span class="co1">// are ignored by the DHCPv6 server.</span> <span class="br0">{</span>   <span class="co1">// DHCPv6 configuration starts here. This section will be read by DHCPv6 server</span> <span class="co1">// and will be ignored by other components.</span> <span class="st0">"Dhcp6"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="co1">// Add names of your network interfaces to listen on.</span> <span class="st0">"interfaces-config"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="co1">// You typically want to put specific interface names here, e.g. eth0</span> <span class="co1">// but you can also specify unicast addresses (e.g. eth0/2001:db8::1) if</span> <span class="co1">// you want your server to handle unicast traffic in addition to</span> <span class="co1">// multicast. (DHCPv6 is a multicast based protocol).</span> <span class="st0">"interfaces"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">]</span> <span class="br0">}</span>,   <span class="co1">// Kea supports control channel, which is a way to receive management commands</span> <span class="co1">// while the server is running. This is a Unix domain socket that receives</span> <span class="co1">// commands formatted in JSON, e.g. config-set (which sets new configuration),</span> <span class="co1">// config-reload (which tells Kea to reload its configuration from file),</span> <span class="co1">// statistic-get (to retrieve statistics) and many more. For detailed</span> <span class="co1">// description, see Sections 9.12, 16 and 15.</span> <span class="st0">"control-socket"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"socket-type"</span><span class="sy0">:</span> <span class="st0">"unix"</span>, <span class="st0">"socket-name"</span><span class="sy0">:</span> <span class="st0">"/tmp/kea6-ctrl-socket"</span> <span class="br0">}</span>,   <span class="co1">// Use Memfile lease database backend to store leases in a CSV file.</span> <span class="co1">// Depending on how Kea was compiled, it may also support SQL databases</span> <span class="co1">// (MySQL and/or PostgreSQL). Those database backends require more</span> <span class="co1">// parameters, like name, host and possibly user and password.</span> <span class="co1">// There are dedicated examples for each backend. See Section 8.2.2 "Lease</span> <span class="co1">// Storage" for details.</span> <span class="st0">"lease-database"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="co1">// Memfile is the simplest and easiest backend to use. It's an in-memory</span> <span class="co1">// C++ database that stores its state in CSV file.</span> <span class="st0">"type"</span><span class="sy0">:</span> <span class="st0">"memfile"</span>, <span class="st0">"lfc-interval"</span><span class="sy0">:</span> <span class="nu0">3600</span> <span class="br0">}</span>,   <span class="co1">// Kea allows storing host reservations in a database. If your network is</span> <span class="co1">// small or you have few reservations, it's probably easier to keep them</span> <span class="co1">// in the configuration file. If your network is large, it's usually better</span> <span class="co1">// to use database for it. To enable it, uncomment the following:</span> <span class="co1">// "hosts-database": {</span> <span class="co1">// "type": "mysql",</span> <span class="co1">// "name": "kea",</span> <span class="co1">// "user": "kea",</span> <span class="co1">// "password": "kea",</span> <span class="co1">// "host": "localhost",</span> <span class="co1">// "port": 3306</span> <span class="co1">// },</span> <span class="co1">// See Section 8.2.3 "Hosts storage" for details.</span>   <span class="co1">// Setup reclamation of the expired leases and leases affinity.</span> <span class="co1">// Expired leases will be reclaimed every 10 seconds. Every 25</span> <span class="co1">// seconds reclaimed leases, which have expired more than 3600</span> <span class="co1">// seconds ago, will be removed. The limits for leases reclamation</span> <span class="co1">// are 100 leases or 250 ms for a single cycle. A warning message</span> <span class="co1">// will be logged if there are still expired leases in the</span> <span class="co1">// database after 5 consecutive reclamation cycles.</span> <span class="co1">// If both "flush-reclaimed-timer-wait-time" and "hold-reclaimed-time" are</span> <span class="co1">// not 0, when the client sends a release message the lease is expired</span> <span class="co1">// instead of being deleted from the lease storage.</span> <span class="st0">"expired-leases-processing"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"reclaim-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">10</span>, <span class="st0">"flush-reclaimed-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">25</span>, <span class="st0">"hold-reclaimed-time"</span><span class="sy0">:</span> <span class="nu0">3600</span>, <span class="st0">"max-reclaim-leases"</span><span class="sy0">:</span> <span class="nu0">100</span>, <span class="st0">"max-reclaim-time"</span><span class="sy0">:</span> <span class="nu0">250</span>, <span class="st0">"unwarned-reclaim-cycles"</span><span class="sy0">:</span> <span class="nu0">5</span> <span class="br0">}</span>,   <span class="co1">// These parameters govern global timers. Addresses will be assigned with</span> <span class="co1">// preferred and valid lifetimes being 3000 and 4000, respectively. Client</span> <span class="co1">// is told to start renewing after 1000 seconds. If the server does not</span> <span class="co1">// respond after 2000 seconds since the lease was granted, a client is</span> <span class="co1">// supposed to start REBIND procedure (emergency renewal that allows</span> <span class="co1">// switching to a different server).</span> <span class="st0">"renew-timer"</span><span class="sy0">:</span> <span class="nu0">1000</span>, <span class="st0">"rebind-timer"</span><span class="sy0">:</span> <span class="nu0">2000</span>, <span class="st0">"preferred-lifetime"</span><span class="sy0">:</span> <span class="nu0">3000</span>, <span class="st0">"valid-lifetime"</span><span class="sy0">:</span> <span class="nu0">4000</span>,   <span class="co1">// These are global options. They are going to be sent when a client requests</span> <span class="co1">// them, unless overwritten with values in more specific scopes. The scope</span> <span class="co1">// hierarchy is:</span> <span class="co1">// - global</span> <span class="co1">// - subnet</span> <span class="co1">// - class</span> <span class="co1">// - host</span> <span class="co1">//</span> <span class="co1">// Not all of those options make sense. Please configure only those that</span> <span class="co1">// are actually useful in your network.</span> <span class="co1">//</span> <span class="co1">// For a complete list of options currently supported by Kea, see</span> <span class="co1">// Section 8.2.9 "Standard DHCPv6 Options". Kea also supports</span> <span class="co1">// vendor options (see Section 7.2.10) and allows users to define their</span> <span class="co1">// own custom options (see Section 7.2.9).</span> <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="co1">// When specifying options, you typically need to specify</span> <span class="co1">// one of (name or code) and data. The full option specification</span> <span class="co1">// covers name, code, space, csv-format and data.</span> <span class="co1">// space defaults to "dhcp6" which is usually correct, unless you</span> <span class="co1">// use encapsulate options. csv-format defaults to "true", so</span> <span class="co1">// this is also correct, unless you want to specify the whole</span> <span class="co1">// option value as long hex string. For example, to specify</span> <span class="co1">// domain-name-<span class="search_hit">servers</span> you could do this:</span> <span class="co1">// {</span> <span class="co1">// "name": "dns-<span class="search_hit">servers</span>",</span> <span class="co1">// "code": 23,</span> <span class="co1">// "csv-format": "true",</span> <span class="co1">// "space": "dhcp6",</span> <span class="co1">// "data": "2001:db8:2::45, 2001:db8:2::100"</span> <span class="co1">// }</span> <span class="co1">// but it's a lot of writing, so it's easier to do this instead:</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"dns-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"2001:db8:2::45, 2001:db8:2::100"</span> <span class="br0">}</span>,   <span class="co1">// Typically people prefer to refer to options by their names, so they</span> <span class="co1">// don't need to remember the code names. However, some people like</span> <span class="co1">// to use numerical values. For example, DHCPv6 can optionally use</span> <span class="co1">// server unicast communication, if extra option is present. Option</span> <span class="co1">// "unicast" uses option code 12, so you can reference to it either</span> <span class="co1">// by "name": "unicast" or "code": 12. If you enable this option,</span> <span class="co1">// you really should also tell the server to listen on that address</span> <span class="co1">// (see interfaces-config/interfaces list above).</span> <span class="br0">{</span> <span class="st0">"code"</span><span class="sy0">:</span> <span class="nu0">12</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"2001:db8::1"</span> <span class="br0">}</span>,   <span class="co1">// String options that have a comma in their values need to have</span> <span class="co1">// it escaped (i.e. each comma is preceded by two backslashes).</span> <span class="co1">// That's because commas are reserved for separating fields in</span> <span class="co1">// compound options. At the same time, we need to be conformant</span> <span class="co1">// with JSON spec, that does not allow "\,". Therefore the</span> <span class="co1">// slightly uncommon double backslashes notation is needed.</span>   <span class="co1">// Legal JSON escapes are \ followed by "\/bfnrt character</span> <span class="co1">// or \u followed by 4 hexadecimal numbers (currently Kea</span> <span class="co1">// supports only \u0000 to \u00ff code points).</span> <span class="co1">// CSV processing translates '\\' into '\' and '\,' into ','</span> <span class="co1">// only so for instance '\x' is translated into '\x'. But</span> <span class="co1">// as it works on a JSON string value each of these '\'</span> <span class="co1">// characters must be doubled on JSON input.</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"new-posix-timezone"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"EST5EDT4<span class="es0">\\</span>,M3.2.0/02:00<span class="es0">\\</span>,M11.1.0/02:00"</span> <span class="br0">}</span>,   <span class="co1">// Options that take integer values can either be specified in</span> <span class="co1">// dec or hex format. Hex format could be either plain (e.g. abcd)</span> <span class="co1">// or prefixed with 0x (e.g. 0xabcd).</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"preference"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"0xf0"</span> <span class="br0">}</span>,   <span class="co1">// A few options are encoded in (length, string) tuples</span> <span class="co1">// which can be defined using only strings as the CSV</span> <span class="co1">// processing computes lengths.</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"bootfile-param"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"root=/dev/sda2, quiet, splash"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// Another thing possible here are hooks. Kea supports a powerful mechanism</span> <span class="co1">// that allows loading external libraries that can extract information and</span> <span class="co1">// even influence how the server processes packets. Those libraries include</span> <span class="co1">// additional forensic logging capabilities, ability to reserve hosts in</span> <span class="co1">// more flexible ways, and even add extra commands. For a list of available</span> <span class="co1">// hook libraries, see https://gitlab.isc.org/isc-projects/kea/wikis/Hooks-available.</span> <span class="co1">// "hooks-libraries": [</span> <span class="co1">// {</span> <span class="co1">// // Forensic Logging library generates forensic type of audit trail</span> <span class="co1">// // of all devices serviced by Kea, including their identifiers</span> <span class="co1">// // (like MAC address), their location in the network, times</span> <span class="co1">// // when they were active etc.</span> <span class="co1">// "library": "/usr/lib/kea/hooks/libdhcp_legal_log.so",</span> <span class="co1">// "parameters": {</span> <span class="co1">// "path": "/var/lib/kea",</span> <span class="co1">// "base-name": "kea-forensic6"</span> <span class="co1">// }</span> <span class="co1">// },</span> <span class="co1">// {</span> <span class="co1">// // Flexible identifier (flex-id). Kea software provides a way to</span> <span class="co1">// // handle host reservations that include addresses, prefixes,</span> <span class="co1">// // options, client classes and other features. The reservation can</span> <span class="co1">// // be based on hardware address, DUID, circuit-id or client-id in</span> <span class="co1">// // DHCPv4 and using hardware address or DUID in DHCPv6. However,</span> <span class="co1">// // there are sometimes scenario where the reservation is more</span> <span class="co1">// // complex, e.g. uses other options that mentioned above, uses part</span> <span class="co1">// // of specific options or perhaps even a combination of several</span> <span class="co1">// // options and fields to uniquely identify a client. Those scenarios</span> <span class="co1">// // are addressed by the Flexible Identifiers hook application.</span> <span class="co1">// "library": "/usr/lib/kea/hooks/libdhcp_flex_id.so",</span> <span class="co1">// "parameters": {</span> <span class="co1">// "identifier-expression": "relay6[0].option[37].hex"</span> <span class="co1">// }</span> <span class="co1">// }</span> <span class="co1">// ],</span>   <span class="co1">// Below an example of a simple IPv6 subnet declaration. Uncomment to enable</span> <span class="co1">// it. This is a list, denoted with [ ], of structures, each denoted with</span> <span class="co1">// { }. Each structure describes a single subnet and may have several</span> <span class="co1">// parameters. One of those parameters is "pools" that is also a list of</span> <span class="co1">// structures.</span> <span class="st0">"subnet6"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// This defines the whole subnet. Kea will use this information to</span> <span class="co1">// determine where the clients are connected. This is the whole</span> <span class="co1">// subnet in your network.</span>   <span class="co1">// Subnet identifier should be unique for each subnet.</span> <span class="st0">"id"</span><span class="sy0">:</span> <span class="nu0">1</span>,   <span class="co1">// This is mandatory parameter for each subnet.</span> <span class="st0">"subnet"</span><span class="sy0">:</span> <span class="st0">"2001:db8:1::/64"</span>,   <span class="co1">// Pools define the actual part of your subnet that is governed</span> <span class="co1">// by Kea. Technically this is optional parameter, but it's</span> <span class="co1">// almost always needed for DHCP to do its job. If you omit it,</span> <span class="co1">// clients won't be able to get addresses, unless there are</span> <span class="co1">// host reservations defined for them.</span> <span class="st0">"pools"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"pool"</span><span class="sy0">:</span> <span class="st0">"2001:db8:1::/80"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// Kea supports prefix delegation (PD). This mechanism delegates</span> <span class="co1">// whole prefixes, instead of single addresses. You need to specify</span> <span class="co1">// a prefix and then size of the delegated prefixes that it will</span> <span class="co1">// be split into. This example below tells Kea to use</span> <span class="co1">// 2001:db8:1::/56 prefix as pool and split it into /64 prefixes.</span> <span class="co1">// This will give you 256 (2^(64-56)) prefixes.</span> <span class="st0">"pd-pools"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"prefix"</span><span class="sy0">:</span> <span class="st0">"2001:db8:8::"</span>, <span class="st0">"prefix-len"</span><span class="sy0">:</span> <span class="nu0">56</span>, <span class="st0">"delegated-len"</span><span class="sy0">:</span> <span class="nu0">64</span>   <span class="co1">// Kea also supports excluded prefixes. This advanced option</span> <span class="co1">// is explained in Section 9.2.9. Please make sure your</span> <span class="co1">// excluded prefix matches the pool it is defined in.</span> <span class="co1">// "excluded-prefix": "2001:db8:8:0:80::",</span> <span class="co1">// "excluded-prefix-len": 72</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="co1">// You can specify additional options here that are subnet</span> <span class="co1">// specific. Also, you can override global options here.</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"dns-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"2001:db8:2::dead:beef, 2001:db8:2::cafe:babe"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// Host reservations can be defined for each subnet.</span> <span class="co1">//</span> <span class="co1">// Note that reservations are subnet-specific in Kea. This is</span> <span class="co1">// different than ISC DHCP. Keep that in mind when migrating</span> <span class="co1">// your configurations.</span> <span class="st0">"reservations"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="co1">// This is a simple host reservation. The host with DUID matching</span> <span class="co1">// the specified value will get an address of 2001:db8:1::100.</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"01:02:03:04:05:0A:0B:0C:0D:0E"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"2001:db8:1::100"</span> <span class="br0">]</span> <span class="br0">}</span>,   <span class="co1">// This is similar to the previous one, but this time the</span> <span class="co1">// reservation is done based on hardware/MAC address. The server</span> <span class="co1">// will do its best to extract the hardware/MAC address from</span> <span class="co1">// received packets (see 'mac-sources' directive for</span> <span class="co1">// details). This particular reservation also specifies two</span> <span class="co1">// extra options to be available for this client. If there are</span> <span class="co1">// options with the same code specified in a global, subnet or</span> <span class="co1">// class scope, the values defined at host level take</span> <span class="co1">// precedence.</span> <span class="br0">{</span> <span class="st0">"hw-address"</span><span class="sy0">:</span> <span class="st0">"00:01:02:03:04:05"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"2001:db8:1::101"</span> <span class="br0">]</span>, <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"dns-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"3000:1::234"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"nis-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"3000:1::234"</span> <span class="br0">}</span><span class="br0">]</span>,   <span class="co1">// This client will be automatically added to certain</span> <span class="co1">// classes.</span> <span class="st0">"client-classes"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"special_snowflake"</span>, <span class="st0">"office"</span> <span class="br0">]</span> <span class="br0">}</span>,   <span class="co1">// This is a bit more advanced reservation. The client with the</span> <span class="co1">// specified DUID will get a reserved address, a reserved prefix</span> <span class="co1">// and a hostname. This reservation is for an address that it</span> <span class="co1">// not within the dynamic pool. Finally, this reservation</span> <span class="co1">// features vendor specific options for CableLabs, which happen</span> <span class="co1">// to use enterprise-id 4491. Those particular values will be</span> <span class="co1">// returned only to the client that has a DUID matching this</span> <span class="co1">// reservation.</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"01:02:03:04:05:06:07:08:09:0A"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"2001:db8:1:0:cafe::1"</span> <span class="br0">]</span>, <span class="st0">"prefixes"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"2001:db8:2:abcd::/64"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"foo.example.com"</span>, <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"vendor-opts"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"4491"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"tftp-<span class="search_hit">servers</span>"</span>, <span class="st0">"space"</span><span class="sy0">:</span> <span class="st0">"vendor-4491"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"3000:1::234"</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span>,   <span class="co1">// This reservation is using flexible identifier. Instead of</span> <span class="co1">// relying on specific field, sysadmin can define an expression</span> <span class="co1">// similar to what is used for client classification,</span> <span class="co1">// e.g. substring(relay[0].option[17],0,6). Then, based on the</span> <span class="co1">// value of that expression for incoming packet, the reservation</span> <span class="co1">// is matched. Expression can be specified either as hex or</span> <span class="co1">// plain text using single quotes.</span>   <span class="co1">// Note: flexible identifier requires flex_id hook library to be</span> <span class="co1">// loaded to work.</span> <span class="br0">{</span> <span class="st0">"flex-id"</span><span class="sy0">:</span> <span class="st0">"'somevalue'"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"2001:db8:1:0:cafe::2"</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="co1">// More subnets can be defined here.</span> <span class="co1">// {</span> <span class="co1">// "subnet": "2001:db8:2::/64",</span> <span class="co1">// "pools": [ { "pool": "2001:db8:2::/80" } ]</span> <span class="co1">// },</span> <span class="co1">// {</span> <span class="co1">// "subnet": "2001:db8:3::/64",</span> <span class="co1">// "pools": [ { "pool": "2001:db8:3::/80" } ]</span> <span class="co1">// },</span> <span class="co1">// {</span> <span class="co1">// "subnet": "2001:db8:4::/64",</span> <span class="co1">// "pools": [ { "pool": "2001:db8:4::/80" } ]</span> <span class="co1">// }</span> <span class="br0">]</span>,   <span class="co1">// Client-classes can be defined here. See "client-classes" in Dhcp4 for</span> <span class="co1">// an example.</span>   <span class="co1">// DDNS information (how the DHCPv6 component can reach a DDNS daemon)</span>   <span class="co1">// Logging configuration starts here. Kea uses different loggers to log various</span> <span class="co1">// activities. For details (e.g. names of loggers), see Chapter 18.</span> <span class="st0">"loggers"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// This specifies the logging for kea-dhcp6 logger, i.e. all logs</span> <span class="co1">// generated by Kea DHCPv6 server.</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"kea-dhcp6"</span>, <span class="st0">"output-options"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// Specifies the output file. There are several special values</span> <span class="co1">// supported:</span> <span class="co1">// - stdout (prints on standard output)</span> <span class="co1">// - stderr (prints on standard error)</span> <span class="co1">// - syslog (logs to syslog)</span> <span class="co1">// - syslog:name (logs to syslog using specified name)</span> <span class="co1">// Any other value is considered a name of the file</span> <span class="st0">"output"</span><span class="sy0">:</span> <span class="st0">"/var/log/kea-dhcp6.log"</span>   <span class="co1">// Shorter log pattern suitable for use with systemd,</span> <span class="co1">// avoids redundant information</span> <span class="co1">// "pattern": "%-5p %m\n",</span>   <span class="co1">// This governs whether the log output is flushed to disk after</span> <span class="co1">// every write.</span> <span class="co1">// "flush": false,</span>   <span class="co1">// This specifies the maximum size of the file before it is</span> <span class="co1">// rotated.</span> <span class="co1">// "maxsize": 1048576,</span>   <span class="co1">// This specifies the maximum number of rotated files to keep.</span> <span class="co1">// "maxver": 8</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="co1">// This specifies the severity of log messages to keep. Supported values</span> <span class="co1">// are: FATAL, ERROR, WARN, INFO, DEBUG</span> <span class="st0">"severity"</span><span class="sy0">:</span> <span class="st0">"INFO"</span>,   <span class="co1">// If DEBUG level is specified, this value is used. 0 is least verbose,</span> <span class="co1">// 99 is most verbose. Be cautious, Kea can generate lots and lots</span> <span class="co1">// of logs if told to do so.</span> <span class="st0">"debuglevel"</span><span class="sy0">:</span> <span class="nu0">0</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">}</span></pre> </dd></dl> </div> <p> Bevor wir nun aber unseren Kea-DHCPv6-Daemon individuell nach unseren Bedürfnissen hin anpassen, werden wir zunächst die im Paket mitgelieferte Original-Konfigurationsdatei <strong><code>/etc/kea/kea-dhcp6.conf</code></strong> für spätere Referenzen sichern. </p> <pre class="code"> # cp -a /etc/kea/kea-dhcp6.conf /etc/kea/kea-dhcp6.conf.orig</pre> <p> So können wir später bei etwaigen Bedarf Vergleiche zur originalen Konfigurationsdatei mit einer neuen Version bei einem Update des KEA-Paketes anstreben, wie in diesem Beispiel hier: </p> <pre class="code"> # vimdiff /etc/kea/kea-dhcp6.conf.orig /etc/kea/kea-dhcp6.conf.pacnew</pre> <p> <img src="/lib/exe/fetch.php/linux:kea_vimdiff.png?w=900&tok=92a4fb" class="mediacenter img-responsive" loading="lazy" title="Bild: Bildschirmharcopy des Aufgrufes 'vimdiff /etc/kea/kea-dhcp6.conf.orig /etc/kea/kea-dhcp6.conf.pacnew'" alt="Bild: Bildschirmharcopy des Aufgrufes 'vimdiff /etc/kea/kea-dhcp6.conf.orig /etc/kea/kea-dhcp6.conf.pacnew'" width="900" /> </p> <p> Aus den oben genannten Konfigurationsparametern erstellen wir uns nun eine entsprechende Konfigurationsdatei <strong><code>/etc/kea/kea-dhcp6.conf</code></strong> für unseren Kea-DHCPv4-Daemon. </p> <pre class="code"> # vim /etc/kea/kea-dhcp6.conf</pre> <dl class="file"> <dt><a href="/doku.php/linux:kea?do=export_code&codeblock=14" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/kea/kea-dhcp6.conf</a></dt> <dd><pre class="code file java"><span class="co1">// This is our basic configuration for the Kea DHCPv6 server. See section</span> <span class="co1">// 9.2 DHCPv6 Server Configuration for detailed informations. the direct link</span> <span class="co1">// for the stable version is https://kea.readthedocs.io/).</span> <span class="co1">//</span> <span class="co1">// This configuration file contains only DHCPv6 server's configuration.</span> <span class="co1">// If configurations for other Kea services are also included in this file they</span> <span class="co1">// are ignored by the DHCPv6 server.</span> <span class="co1">//</span> <span class="co1">// DHCPv6 configuration starts here. This section will be read by DHCPv6 server</span> <span class="co1">// and will be ignored by other components.</span> <span class="br0">{</span> <span class="st0">"Dhcp6"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="co1">// See section 9.2.4 Interface Configuration for more details:</span> <span class="st0">"interfaces-config"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"interfaces"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"eth1"</span> <span class="br0">]</span> <span class="br0">}</span>,   <span class="co1">// Kea supports control channel, which is a way to receive management</span> <span class="co1">// commands while the server is running. For detailed description,</span> <span class="co1">// see Sections 9.14.</span> <span class="st0">"control-socket"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"socket-type"</span><span class="sy0">:</span> <span class="st0">"unix"</span>, <span class="st0">"socket-name"</span><span class="sy0">:</span> <span class="st0">"/var/lib/kea/kea6-ctrl-socket"</span> <span class="br0">}</span>, <span class="co1">// Use Memfile lease database backend to store leases in a CSV file.</span> <span class="co1">// See Section 9.2.2.1 Memfile - Basic Storage for Leases</span> <span class="st0">"lease-database"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"type"</span><span class="sy0">:</span> <span class="st0">"memfile"</span>, <span class="st0">"persist"</span><span class="sy0">:</span> <span class="kw2">true</span>, <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"/var/lib/kea/kea-leases6.csv"</span>, <span class="st0">"lfc-interval"</span><span class="sy0">:</span> <span class="nu0">3200</span>, <span class="st0">"max-row-errors"</span><span class="sy0">:</span> <span class="nu0">100</span> <span class="br0">}</span>,   <span class="co1">// Setup reclamation of the expired leases and leases affinity.</span> <span class="co1">// See section 11. Lease Expiration for more and detailed informations. </span> <span class="st0">"expired-leases-processing"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"reclaim-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">10</span>, <span class="st0">"flush-reclaimed-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">25</span>, <span class="st0">"hold-reclaimed-time"</span><span class="sy0">:</span> <span class="nu0">3600</span>, <span class="st0">"max-reclaim-leases"</span><span class="sy0">:</span> <span class="nu0">100</span>, <span class="st0">"max-reclaim-time"</span><span class="sy0">:</span> <span class="nu0">250</span>, <span class="st0">"unwarned-reclaim-cycles"</span><span class="sy0">:</span> <span class="nu0">5</span> <span class="br0">}</span>,   <span class="co1">// Global timers specified here apply to all subnets, unless there are</span> <span class="co1">// subnet specific values defined in particular subnets. See section</span> <span class="co1">// 9.2.1. Introduction.</span> <span class="st0">"valid-lifetime"</span><span class="sy0">:</span> <span class="nu0">3600</span>, <span class="st0">"renew-timer"</span><span class="sy0">:</span> <span class="nu0">1800</span>, <span class="st0">"rebind-timer"</span><span class="sy0">:</span> <span class="nu0">3200</span>, <span class="st0">"preferred-lifetime"</span><span class="sy0">:</span> <span class="nu0">3000</span>,   <span class="co1">// Many additional parameters can be specified here. Alle datails will be</span> <span class="co1">// found in following sections:</span> <span class="co1">// - 9.2.11. Standard DHCPv6 Options</span> <span class="co1">// - 9.2.14. Custom DHCPv4 Options</span> <span class="co1">// - 9.2.15. DHCPv6 Vendor-Specific Options </span> <span class="co1">// - 9.2.16. Nested DHCPv6 Options (Custom Option Spaces) </span> <span class="co1">// - 9.2.17. Unspecified Parameters for DHCPv6 Option Configuration</span> <span class="co1">//</span> <span class="co1">// For a complete list of options currently supported by Kea, see</span> <span class="co1">// Section 9.2.11 "Standard DHCPv6 Options". Kea also supports</span> <span class="co1">// vendor options (see Section 7.2.10) and allows users to define their</span> <span class="co1">// own custom options (see Section 7.2.9).</span> <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="co1">// Domain-Name-Server:</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"dns-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7:10:0:10:110"</span> <span class="br0">}</span>,   <span class="co1">// Domain-Search-Liste:</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-search"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"nausch.org"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// Finally, we list the subnets from which we will be leasing addresses.</span> <span class="co1">// See section 9.2.5 IPv6 Subnet Identifier and the following sections</span> <span class="co1">// for more details.</span> <span class="st0">"subnet6"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"interface"</span><span class="sy0">:</span> <span class="st0">"eth1"</span>,   <span class="co1">// This defines the whole subnet. Kea will use this information to</span> <span class="co1">// determine where the clients are connected. This is the whole</span> <span class="co1">// subnet in your network.</span>   <span class="co1">// Subnet identifier should be unique for each subnet.</span> <span class="co1">// Subnet identifier for zone intra</span> <span class="st0">"id"</span><span class="sy0">:</span> <span class="nu0">62</span>,   <span class="co1">// This is mandatory parameter for each subnet. </span> <span class="st0">"subnet"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7::/64"</span>,   <span class="co1">// Pools define the actual part of your subnet that is governed</span> <span class="co1">// by Kea.</span> <span class="st0">"pools"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"pool"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7:10:0:10:300/120"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="co1">// You can specify additional options here that are subnet</span> <span class="co1">// specific. Also, you can override global options here.</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"dns-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7:10:0:10:110"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"sntp-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7:10:0:10:110"</span> <span class="br0">}</span>   <span class="br0">]</span>,   <span class="co1">// Host reservations can be defined for each subnet.</span> <span class="co1">// Note that reservations are subnet-specific in Kea. This is</span> <span class="co1">// different than ISC DHCP. Keep that in mind when migrating</span> <span class="co1">// your configurations.</span> <span class="st0">"reservations"</span><span class="sy0">:</span> <span class="br0">[</span>   <span class="co1">// This are the reservations for specific DUID matchings.</span> <span class="co1">// "MNSS (C7)"</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:ac:1f:6b:00:d3:9b"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:2"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pml010002.intra.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// "WLAN Router Trendnet TEW-826DAP"</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:d8:eb:97:33:48:62"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:3"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pnc010003.intra.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// "Netzwerkswitch TP-Link T1600G-52PS (UG)"</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:64:66:b3:c9:98:7c"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:6"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pnc010006.intra.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// "Netzwerkswitch Netgear GS308E (DG)"</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:6c:cd:d6:b8:52:be"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:7"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pnc010007.intra.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// "TecVDR (19 Zoll Tischgerät)"</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:00:0b:6a:32:32:95"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:100"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pml010100.intra.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// "MNSS (ArchLinux)"</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:02:00:00:ab:11:3e:4a:0e:2c:c1:5b:e2:64"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:102"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pml010102.intra.nausch.org"</span> <span class="br0">}</span>,   <span class="co1">// "ArchLinux FWC"</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:52:54:00:41:11:02"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00::7:10:0:10:110"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml010110.intra.nausch.org"</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// Logging configuration starts here. Kea uses different loggers to log various</span> <span class="co1">//# activities. For details (e.g. names of loggers), see Chapter 19.</span> <span class="st0">"loggers"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// This specifies the logging for kea-dhcp6 logger, i.e. all logs</span> <span class="co1">// generated by Kea DHCPv6 server.</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"kea-dhcp6"</span>, <span class="st0">"output_options"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="co1">// Specifies the output file. There are several special values</span> <span class="co1">// supported:</span> <span class="co1">// - stdout (prints on standard output)</span> <span class="co1">// - stderr (prints on standard error)</span> <span class="co1">// - syslog (logs to syslog)</span> <span class="co1">// - syslog:name (logs to syslog using specified name)</span> <span class="co1">// Any other value is considered a name of the file</span> <span class="st0">"output"</span><span class="sy0">:</span> <span class="st0">"syslog"</span> <span class="br0">}</span> <span class="br0">]</span>,   <span class="co1">// This specifies the severity of log messages to keep. Supported values</span> <span class="co1">// are: FATAL, ERROR, WARN, INFO, DEBUG</span> <span class="st0">"severity"</span><span class="sy0">:</span> <span class="st0">"INFO"</span>,   <span class="co1">// If DEBUG level is specified, this value is used. 0 is least verbose,</span> <span class="co1">// 99 is most verbose. Be cautious, Kea can generate lots and lots</span> <span class="co1">// of logs if told to do so.</span> <span class="st0">"debuglevel"</span><span class="sy0">:</span> <span class="nu0">0</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">}</span></pre> </dd></dl> <p> Wollen wir die Kondfigurationsdate ohne die Kommentare sehen, grep'en wir einfach entsprechend danach. </p> <pre class="code"> # grep -Ev '(^.*//|^$)' /etc/kea/kea-dhcp6.conf</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_5">Beispielkonfigurationsdatei ohne Kommentare </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_5"><dl class="file"> <dt><a href="/doku.php/linux:kea?do=export_code&codeblock=15" title="Schnipsel herunterladen" class="mediafile mf_conf">/etc/kea/kea-dhcp6.conf</a></dt> <dd><pre class="code file java"><span class="br0">{</span> <span class="st0">"Dhcp6"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"interfaces-config"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"interfaces"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"eth1"</span> <span class="br0">]</span> <span class="br0">}</span>,   <span class="st0">"control-socket"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"socket-type"</span><span class="sy0">:</span> <span class="st0">"unix"</span>, <span class="st0">"socket-name"</span><span class="sy0">:</span> <span class="st0">"/var/lib/kea/kea6-ctrl-socket"</span> <span class="br0">}</span>, <span class="st0">"lease-database"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"type"</span><span class="sy0">:</span> <span class="st0">"memfile"</span>, <span class="st0">"persist"</span><span class="sy0">:</span> <span class="kw2">true</span>, <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"/var/lib/kea/kea-leases6.csv"</span>, <span class="st0">"lfc-interval"</span><span class="sy0">:</span> <span class="nu0">3200</span>, <span class="st0">"max-row-errors"</span><span class="sy0">:</span> <span class="nu0">100</span> <span class="br0">}</span>,   <span class="st0">"expired-leases-processing"</span><span class="sy0">:</span> <span class="br0">{</span> <span class="st0">"reclaim-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">10</span>, <span class="st0">"flush-reclaimed-timer-wait-time"</span><span class="sy0">:</span> <span class="nu0">25</span>, <span class="st0">"hold-reclaimed-time"</span><span class="sy0">:</span> <span class="nu0">3600</span>, <span class="st0">"max-reclaim-leases"</span><span class="sy0">:</span> <span class="nu0">100</span>, <span class="st0">"max-reclaim-time"</span><span class="sy0">:</span> <span class="nu0">250</span>, <span class="st0">"unwarned-reclaim-cycles"</span><span class="sy0">:</span> <span class="nu0">5</span> <span class="br0">}</span>,   <span class="st0">"valid-lifetime"</span><span class="sy0">:</span> <span class="nu0">3600</span>, <span class="st0">"renew-timer"</span><span class="sy0">:</span> <span class="nu0">1800</span>, <span class="st0">"rebind-timer"</span><span class="sy0">:</span> <span class="nu0">3200</span>, <span class="st0">"preferred-lifetime"</span><span class="sy0">:</span> <span class="nu0">3000</span>,   <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"dns-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7:10:0:10:110"</span> <span class="br0">}</span>,   <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"domain-search"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"nausch.org"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"subnet6"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"interface"</span><span class="sy0">:</span> <span class="st0">"eth1"</span>,   <span class="st0">"id"</span><span class="sy0">:</span> <span class="nu0">62</span>, <span class="st0">"subnet"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7::/64"</span>, <span class="st0">"pools"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"pool"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7:10:0:10:300/120"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"option-data"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"dns-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7:10:0:10:110"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"sntp-<span class="search_hit">servers</span>"</span>, <span class="st0">"data"</span><span class="sy0">:</span> <span class="st0">"fd00:0:0:7:10:0:10:110"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"reservations"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:ac:1f:6b:00:d3:9b"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:2"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pml010002.intra.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:d8:eb:97:33:48:62"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:3"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pnc010003.intra.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:64:66:b3:c9:98:7c"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:6"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pnc010006.intra.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:6c:cd:d6:b8:52:be"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:7"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pnc010007.intra.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:00:0b:6a:32:32:95"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:100"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pml010100.intra.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:02:00:00:ab:11:3e:4a:0e:2c:c1:5b:e2:64"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00:0:0:7:10:0:10:102"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"pml010102.intra.nausch.org"</span> <span class="br0">}</span>, <span class="br0">{</span> <span class="st0">"duid"</span><span class="sy0">:</span> <span class="st0">"00:03:00:01:52:54:00:41:11:02"</span>, <span class="st0">"ip-addresses"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="st0">"fd00::7:10:0:10:110"</span> <span class="br0">]</span>, <span class="st0">"hostname"</span><span class="sy0">:</span> <span class="st0">"vml010110.intra.nausch.org"</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"loggers"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"name"</span><span class="sy0">:</span> <span class="st0">"kea-dhcp6"</span>, <span class="st0">"output_options"</span><span class="sy0">:</span> <span class="br0">[</span> <span class="br0">{</span> <span class="st0">"output"</span><span class="sy0">:</span> <span class="st0">"syslog"</span> <span class="br0">}</span> <span class="br0">]</span>, <span class="st0">"severity"</span><span class="sy0">:</span> <span class="st0">"INFO"</span>, <span class="st0">"debuglevel"</span><span class="sy0">:</span> <span class="nu0">0</span> <span class="br0">}</span> <span class="br0">]</span> <span class="br0">}</span> <span class="br0">}</span></pre> </dd></dl> </div> <p> Bevor wir nun unseren <strong>kea-dhcp6</strong>-Daemon starten, führen wir noch einen Konfigurationstest durch. Wir prüfen also nun die Konfigurationsdatei unseres <strong>kea-dhcp6</strong> auf syntaktische Fehler. </p> <pre class="code"> # kea-dhcp6 -t /etc/kea/kea-dhcp6.conf</pre> <pre class="code">2024-10-19 11:42:46.735 INFO [kea-dhcp6.hosts/13028.126477756442496] HOSTS_BACKENDS_REGISTERED the following host backend types are available: mysql postgresql 2024-10-19 11:42:46.736 WARN [kea-dhcp6.dhcpsrv/13028.126477756442496] DHCPSRV_MT_DISABLED_QUEUE_CONTROL disabling dhcp queue control when multi-threading is enabled. 2024-10-19 11:42:46.736 WARN [kea-dhcp6.dhcp6/13028.126477756442496] DHCP6_RESERVATIONS_LOOKUP_FIRST_ENABLED Multi-threading is enabled and host reservations lookup is always performed first. 2024-10-19 11:42:46.736 INFO [kea-dhcp6.dhcpsrv/13028.126477756442496] DHCPSRV_CFGMGR_NEW_SUBNET6 a new subnet has been added to configuration: fd00:0:0:7::/64 with params: t1=1800, t2=3200, preferred-lifetime=3000, valid-lifetime=3600, rapid-commit is false 2024-10-19 11:42:46.738 INFO [kea-dhcp6.dhcpsrv/13028.126477756442496] DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type raw 2024-10-19 11:42:46.738 INFO [kea-dhcp6.dhcpsrv/13028.126477756442496] DHCPSRV_CFGMGR_ADD_IFACE listening on interface eth1</pre> </div> <h4 class="sectionedit25" id="start_des_kea-dhcp6">Start des kea-dhcp6</h4> <div class="level4"> <p> Nun können wir beruhigt und guten Mutes unseren <strong>kea-dhcp6</strong> Daemon starten. </p> <pre class="code"> # systemctl start kea-dhcp6.service</pre> <p> Im <strong>Journal</strong> wir der Start entsprechend dokumentiert. </p> <p> <pre class="code">Oct 19 11:49:48 vml000110 systemd[1]: Started ISC Kea IPv6 DHCP daemon. Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: 2024-10-19 11:49:49.027 INFO [kea-dhcp6.dhcp6/13092.138845348149120] DHCP6_STARTING Kea DHCPv6 server version 2.6.1 (stable) starting Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: 2024-10-19 11:49:49.030 INFO [kea-dhcp6.commands/13092.138845348149120] COMMAND_RECEIVED Received command 'config-set' Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.hosts.138845348149120] HOSTS_BACKENDS_REGISTERED the following host backend types are available: mysql postgresql Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: <font style="color: rgb(201, 214, 95)"><b>WARN [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_MT_DISABLED_QUEUE_CONTROL disabling dhcp queue control when multi-threading is enabled.</b></font> Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: <font style="color: rgb(201, 214, 95)"><b>WARN [kea-dhcp6.dhcp6.138845348149120] DHCP6_RESERVATIONS_LOOKUP_FIRST_ENABLED Multi-threading is enabled and host reservations lookup is always performed first.</b></font> Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_CFGMGR_NEW_SUBNET6 a new subnet has been added to configuration: fd00:0:0:7::/64 with params: t1=1800, t2=3200, preferred-lifetime=3000, valid-lifetime=3600, rapid-commit is false Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_CFGMGR_SOCKET_TYPE_SELECT using socket type raw Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_CFGMGR_ADD_IFACE listening on interface eth1 Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.commands.138845348149120] COMMAND_ACCEPTOR_START Starting to accept connections via unix domain socket bound to /var/lib/kea/kea6-ctrl-socket Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcp6.138845348149120] DHCP6_CONFIG_COMPLETE DHCPv6 server has completed configuration: added IPv6 subnets: 1; DDNS: disabled Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_MEMFILE_DB opening memory file lease database: lfc-interval=3200 max-row-errors=100 name=/var/lib/kea/kea-leases6.csv persist=true type=memfile universe=6 Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/kea-leases6.csv.2 Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_MEMFILE_LEASE_FILE_LOAD loading leases from file /var/lib/kea/kea-leases6.csv Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_MEMFILE_BUILD_EXTENDED_INFO_TABLES6 building extended info tables saw 13 leases, extended info sanity checks modified 0 leases and 0 leases were entered into tables Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_MEMFILE_LFC_SETUP setting up the Lease File Cleanup interval to 3200 sec Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcp6.138845348149120] DHCP6_USING_SERVERID server is using server-id 00:01:00:01:2d:c7:a3:0e:52:54:00:41:11:01 and stores in the file /var/lib/kea/kea-dhcp6-serverid Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for IA_NA leases in subnet fd00:0:0:7::/64 Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for IA_TA leases in subnet fd00:0:0:7::/64 Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcpsrv.138845348149120] DHCPSRV_CFGMGR_USE_ALLOCATOR using the iterative allocator for IA_PD leases in subnet fd00:0:0:7::/64 Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: <font style="color: rgb(201, 214, 95)"><b>WARN [kea-dhcp6.dhcp6.138845348149120] DHCP6_MULTI_THREADING_INFO enabled: yes, number of threads: 4, queue size: 64</b></font> Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcp6.138845348149120] DHCP6_STARTED Kea DHCPv6 server version 2.6.1 started</pre> </p> <p> Bei Bedarf können wir natürlich auch den Status unseres Daemons jederzeit abfragen. </p> <pre class="code"> # systemctl status kea-dhcp6.service</pre> <p> <pre class="code"> <font style="color: rgb(29, 180, 29)"><b>●</b></font> kea-dhcp6.service - ISC Kea IPv6 DHCP daemon Loaded: loaded (/usr/lib/systemd/system/kea-dhcp6.service; </font><font style="color: rgb(29, 180, 29)"><b>enabled</b></font>; preset: <font style="color: rgb(201, 214, 95)"><b>disabled</b></font>) Active:<font style="color: rgb(29, 180, 29)"><b>active (running)</b></font> since Sat 2024-10-19 11:49:48 CEST; 3min 16s ago Invocation: 0d82ea986a164eea91930cafef01d523 Docs: man:kea-dhcp6(8) Main PID: 13092 (kea-dhcp6) Tasks: 9 (limit: 9510) Memory: 3M (peak: 3.5M) CPU: 66ms CGroup: /system.slice/kea-dhcp6.service └─13092 /usr/bin/kea-dhcp6 -c /etc/kea/kea-dhcp6.conf Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: <font style="color: rgb(201, 214, 95)"><b>WARN [kea-dhcp4.dhcp4.136533820646528] DHCP4_MULTI_THREADING_INFO enabled: yes, number of threads: 4, queue size: 64</b></font> Oct 19 11:49:49 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcp6.138845348149120] DHCP6_STARTED Kea DHCPv6 server version 2.6.1 started Oct 19 11:50:00 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcp6.138845313959616] DHCP6_QUERY_LABEL received query: duid=[00:01:00:01:29:0f:e9:34:b8:27:eb:b2:56:1f], [no hwaddr info], tid=0x3e3337 Oct 19 11:50:00 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.packets.138845313959616] DHCP6_PACKET_RECEIVED duid=[00:01:00:01:29:0f:e9:34:b8:27:eb:b2:56:1f], [no hwaddr info], tid=0x3e3337: RENEW (type 5) received from fe80::a112:c604:f325:26dc to ff02::1:2 on interface eth1 Oct 19 11:50:00 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.leases.138845313959616] DHCP6_LEASE_RENEW duid=[00:01:00:01:29:0f:e9:34:b8:27:eb:b2:56:1f], [no hwaddr info], tid=0x3e3337: lease for address fd00::7:10:0:10:36 and iaid=3957113288 has been allocated Oct 19 11:50:00 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.packets.138845313959616] DHCP6_PACKET_SEND duid=[00:01:00:01:29:0f:e9:34:b8:27:eb:b2:56:1f], [no hwaddr info], tid=0x3e3337: trying to send packet REPLY (type 7) from [ff02::1:2]:547 to [fe80::a112:c604:f325:26dc]:546 on interface eth1 Oct 19 11:51:52 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.dhcp6.138845305566912] DHCP6_QUERY_LABEL received query: duid=[00:03:00:01:1c:ed:6f:bb:f3:9f], [no hwaddr info], tid=0xd5b5b1 Oct 19 11:51:52 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.packets.138845305566912] DHCP6_PACKET_RECEIVED duid=[00:03:00:01:1c:ed:6f:bb:f3:9f], [no hwaddr info], tid=0xd5b5b1: RENEW (type 5) received from fe80::1eed:6fff:febb:f39f to ff02::1:2 on interface eth1 Oct 19 11:51:52 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.leases.138845305566912] DHCP6_LEASE_RENEW duid=[00:03:00:01:1c:ed:6f:bb:f3:9f], [no hwaddr info], tid=0xd5b5b1: lease for address fd00::7:10:0:10:5 and iaid=1874588575 has been allocated Oct 19 11:51:52 vml000110 kea-dhcp6[13092]: INFO [kea-dhcp6.packets.138845305566912] DHCP6_PACKET_SEND duid=[00:03:00:01:1c:ed:6f:bb:f3:9f], [no hwaddr info], tid=0xd5b5b1: trying to send packet REPLY (type 7) from [ff02::1:2]:547 to [fe80::1eed:6fff:febb:f39f]:546 on interface eth1 </pre> </p> <p> Verbindet sich nun ein uns unbekannter Host und kontaktiert unseren <strong>kea-dhcp6</strong>-Daemon wird der erfolgreiche Handshake im <strong>Journal</strong> protokolliert. </p> <pre class="code"> # journalctl -fu kea-dhcp6</pre> <pre class="code">Oct 19 12:10:53 vml000110 kea-dhcp6[13178]: INFO [kea-dhcp6.dhcp6.136335342069440] DHCP6_QUERY_LABEL received query: duid=[00:01:00:01:2e:46:d3:f8:f4:a8:0d:20:b1:37], [no hwaddr info], tid=0x86bd1b Oct 19 12:10:53 vml000110 kea-dhcp6[13178]: INFO [kea-dhcp6.packets.136335342069440] DHCP6_PACKET_RECEIVED duid=[00:01:00:01:2e:46:d3:f8:f4:a8:0d:20:b1:37], [no hwaddr info], tid=0x86bd1b: RENEW (type 5) received from fe80::9ae3:7d16:5806:aff0 to ff02::1:2 on interface eth1 Oct 19 12:10:53 vml000110 kea-dhcp6[13178]: INFO [kea-dhcp6.leases.136335342069440] DHCP6_LEASE_RENEW duid=[00:01:00:01:2e:46:d3:f8:f4:a8:0d:20:b1:37], [no hwaddr info], tid=0x86bd1b: lease for address fd00::7:10:0:10:304 and iaid=170694673 has been allocated Oct 19 12:10:53 vml000110 kea-dhcp6[13178]: INFO [kea-dhcp6.packets.136335342069440] DHCP6_PACKET_SEND duid=[00:01:00:01:2e:46:d3:f8:f4:a8:0d:20:b1:37], [no hwaddr info], tid=0x86bd1b: trying to send packet REPLY (type 7) from [ff02::1:2]:547 to [fe80::9ae3:7d16:5806:aff0]:546 on interface eth1</pre> <p> Dem Client wurde also die IP-Adresse <strong><code>fd00::7:10:0:10:304</code></strong> aus unserem definierten Pool zugewiesen, da wir dessen DUID <strong><code>00:01:00:01:2e:46:d3:f8:f4:a8:0d:20:b1:37</code></strong> nicht kennen! </p> <p> Verbindet sich jedoch nun ein uns bekannter Client, dessen DUID <strong><code>00:03:00:01:d8:eb:97:33:48:62</code></strong> wir bei den <strong>Reservierungen</strong> der IP-Adresse <strong><code>fd00::7:10:0:10:3</code></strong> zugeordnet hatten, mit unserem Kea-Host, sehen wir im Journal entsprechend: </p> <pre class="code"> # journalctl -fu kea-dhcp4</pre> <pre class="code">Oct 19 12:11:14 vml000110 kea-dhcp6[13178]: INFO [kea-dhcp6.dhcp6.136335333676736] DHCP6_QUERY_LABEL received query: duid=[00:03:00:01:d8:eb:97:33:48:62], [no hwaddr info], tid=0xcec735 Oct 19 12:11:14 vml000110 kea-dhcp6[13178]: INFO [kea-dhcp6.packets.136335333676736] DHCP6_PACKET_RECEIVED duid=[00:03:00:01:d8:eb:97:33:48:62], [no hwaddr info], tid=0xcec735: RENEW (type 5) received from fe80::2e3a:fdff:fe2e:bd0b to ff02::1:2 on interface eth1 Oct 19 12:11:14 vml000110 kea-dhcp6[13178]: INFO [kea-dhcp6.alloc-engine.136335333676736] ALLOC_ENGINE_V6_HR_ADDR_GRANTED reserved address fd00::7:10:0:10:3 was assigned to client duid=[00:03:00:01:d8:eb:97:33:48:62], [no hwaddr info], tid=0xcec735 Oct 19 12:11:14 vml000110 kea-dhcp6[13178]: INFO [kea-dhcp6.leases.136335333676736] DHCP6_LEASE_RENEW duid=[00:03:00:01:d8:eb:97:33:48:62], [no hwaddr info], tid=0xcec735: lease for address fd00::7:10:0:10:4 and iaid=4247698699 has been allocated Oct 19 12:11:14 vml000110 kea-dhcp6[13178]: INFO [kea-dhcp6.packets.136335333676736] DHCP6_PACKET_SEND duid=[00:03:00:01:d8:eb:97:33:48:62], [no hwaddr info], tid=0xcec735: trying to send packet REPLY (type 7) from [ff02::1:2]:547 to [fe80::2e3a:fdff:fe2e:bd0b]:546 on interface eth1</pre> <p> Der Host hat also seine vordefinierte <strong>feste IPv6-Adresse</strong> <strong><code>fd00::7:10:0:10:3</code></strong> vom <strong>kea-dhcp4</strong>-Damon erfolgreich zugewiesen bekommen! </p> </div> <h2 class="sectionedit26 page-header pb-3 mb-4 mt-5" id="orchestrierung_-_installation_und_konfiguration_der_beiden_kea-daemon_mit_hilfe_von_ansible">Orchestrierung - Installation und Konfiguration der beiden Kea-Daemon mit Hilfe von Ansible</h2> <div class="level2"> </div> <h3 class="sectionedit27 page-header pb-3 mb-4 mt-5" id="aufgabenstellung">Aufgabenstellung</h3> <div class="level3"> <p> Natürlich wird man im Jahr 2024 nicht mehr ernsthaft, manuell Server aufsetzen und betreiben wollen. Vielmehr wird man auf ein Orchestrierungswerkzeug wie z.B. <strong><a href="/doku.php/linux:ansible:start" class="wikilink1" title="linux:ansible:start" data-wiki-id="linux:ansible:start">Ansible</a></strong> zurückgreifen. Setzen wir einen neue virtuellen Server unter Arch Linux neu auf, oder wollen wir bei einem bestehenden Host die Konfiguration aktualisieren, verwenden wir wie zuvor schon angeschnitten <a href="https://www.ansible.com/" class="urlextern" target="_tab" title="https://www.ansible.com/" rel="ugc nofollow noopener">Ansible</a> als Orchestrierungswerkzeug. So ist sichergestellt dass zum einen all unsere Hosts entsprechend gleich aufgebaut, konfiguriert und betrieben werden, es also keine Bastel-/Frickellösung geben wird. </p> <p> Wir werden uns nun nachfolgend die Server-Installation und -konfiguration genauer betrachten. </p> </div> <h3 class="sectionedit28 page-header pb-3 mb-4 mt-5" id="loesung">Lösung</h3> <div class="level3"> <div class="wrap_center wrap_round wrap_tip plugin_wrap" style="width: 80%;"> <p> Der ungeduldigen Leser kann auch direkt zur Tat schreiten und das manuelle Anlegen der Inventory-Hülle, des Playbooks und der zugehörigen Rolle überspringen und diese Aufgaben mit folgendem Befehl sozusagen auf einem Rutsch erledigen: </p> <pre class="code"> $ mkdir -p ~/devel/ansible ; wget https://gitlab.nausch.org/django/example_kea/-/archive/main/example_kea-main.tar.gz \ -O - | tar -xz --strip-components=1 -C ~/devel/ansible</pre> <p> Nach Anpassung der Daten im Inventory kann man anschliessend direkt <strong><a href="#ausfuehrung_-_playbooklauf" title="linux:kea ↵" class="wikilink1">zur Ausführung schreiten</a></strong>. </p> </div> </div> <h4 class="sectionedit31" id="vorbereitung_-_server-_daten_im_inventory">Vorbereitung - (Server-)Daten im Inventory</h4> <div class="level4"> <p> Bei unserem Konfigurationsbeispiel hier gehen wir von folgenden Host-Parametern aus: </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><code>zone: intra</code></strong></div> </li> <li class="level1"><div class="li"> <strong><code>hostname: vml010110</code></strong> </div> </li> </ul> <p> Die Konfigurationsdatei unseres <strong>inventory</strong> in unsere, Ansible-Verzeichnis beinhaltet demnach unter anderem: </p> <pre class="code"> $ vim inventories/production/hosts</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_6">inventories/production/hosts </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_6"><dl class="file"> <dt><a href="/doku.php/linux:kea?do=export_code&codeblock=20" title="Schnipsel herunterladen" class="mediafile mf_">inventories/production/hosts</a></dt> <dd><pre class="code file bash"><span class="co0"># Inventory Datei für die System-Umgebung im SOHO</span> <span class="co0">#</span> <span class="co0"># Hinweise:</span> <span class="co0"># - Kommentare beginnen mit einem '#'-Zeichen</span> <span class="co0"># - leere Zeilen werden ignoriert</span> <span class="co0"># - Host- und Gruppendefinitionen werden mit [] abgegrenzt</span> <span class="co0"># - Hosts können über ihren Hostnamen, FQN oder ihrer IP-Adresse definiert</span> <span class="co0"># - übergeordnete Gruppen werden durch [:children] abgegrenzt</span> <span class="co0">#</span> <span class="co0"># Host-Definitionen</span>   <span class="co0"># Hosts ohne Gruppenzuordnung</span> localhost   <span class="br0">[</span>edmz<span class="br0">]</span> vml000210   <span class="br0">[</span>idmz<span class="br0">]</span> vml000110   <span class="br0">[</span>intra<span class="br0">]</span> pnc010007 vml010110     <span class="co0"># Host-Gruppen-Definitionen </span> <span class="co0"># (zu welcher Gruppe gehören Untergruppen bzw. Hosts)</span>   <span class="br0">[</span>linux:children<span class="br0">]</span> intra edmz idmz</pre> </dd></dl> </div> <p> Die beiden Beispiel-Hosts aus der Gruppe|Zone <strong><code>intra</code></strong> in diesem Inventory symbolisieren folgende unterschiedlichen Knoten. </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> Der Host <strong><code>pnc010007</code></strong> steht exemplarisch für einen Client im Intranet. In dessen Inventory-File <strong><code>inventories/production/host_vars/pnc010007</code></strong> sind die ihn beschreibenden Dateien enthalten.</div> </li> <li class="level1"><div class="li"> Der Host <strong><code>vml010110</code></strong> ist in diesem Beispiel unser Server, der die Verbindung zwischen der Zone <strong><code>intra</code></strong> und der Aussenwelt herstellt. Auf diesem Konten läuft bereits ein <strong><a href="/doku.php/linux:ntp" class="wikilink1" title="linux:ntp" data-wiki-id="linux:ntp">Chrony Timeserver|</a></strong> wie auch eine Firewall auf Basis von <strong><a href="https://firewalld.org/" class="urlextern" target="_tab" title="https://firewalld.org/" rel="ugc nofollow noopener">firewalld</a></strong> der eine Zonendefinition <strong><code>intra</code></strong> besitzt, die die Regeln für diese Zone beinhalten. Sowohl Timeserver wie auch Firewall werden in diesem Beispiel hier nur erwähnt, da in dem Playbook bzw.genauer gesagt im Inventory darauf referenziert wird. </div> </li> </ul> <p> Wir legen uns also nun die Hostdefinitionsdatei für unseren Switch im SOHO an. </p> <pre class="code"> $ vim inventories/production/host_vars/pnc010007</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_7">inventories/production/host_vars/pnc010007 </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_7"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/inventories/production/host_vars/pnc010007" class="mediafile mf_">inventories/production/host_vars/pnc010007</a></dt> <dd><pre class="file">host_beschreibung: "Netzwerkswitch Netgear GS308E" host_alias: "switch" host_mac: "6c:cd:d6:b8:52:be" host_ipv4: "10.0.10.7" host_duid: "00:03:00:01:6c:cd:d6:b8:52:be" host_ipv6: "fd00:dead:b33f:0:10:0:10:7"</pre> </dd></dl></div> <p> Als nächstes legen wir die Datei für den KVM-Host, auf dem unser Kea-Daemon laufen soll an und definieren darin die zugehörigen Eigenschaften. </p> <pre class="code">$ vim inventories/production/host_vars/vml010110/kvm_vhost</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_8">inventories/production/host_vars/vml010110/kvm_vhost </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_8"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/inventories/production/host_vars/vml010110/kvm_vhost" class="mediafile mf_">inventories/production/host_vars/vml010110/kvm_vhost</a></dt> <dd><pre class="file">guest_nic_2: "eth1" guest_mask6_2: "/64" guest_ip6_ula_pfx_2: "fd00:dead:b33f:0::" guest_ip6_ula_2: "fd00:dead:b33f:0:10:0:10:110" guest_domain: "example.com" guest_zone_2: "intra" guest_ip4_net_2: "10.0.10.0" guest_mask4_2: "/24" guest_ip4_2: "10.0.10.110" guest_fw_services: - name: "dhcp aus intra" zone: '{{ guest_zone_2 }}' service: 'dhcp' - name: "dhcpv6 aus intra" zone: '{{ guest_zone_2 }}' service: 'dhcpv6'</pre> </dd></dl></div> <p> Die für die beiden <strong>kea-Daemon</strong> relevanten Konfigurationsparameter legen wir in der Inventrory-Datei <strong><code>inventories/production/host_vars/vml010110/kea</code></strong> ab. </p> <pre class="code"> $ vim inventories/production/host_vars/vml010110/kea </pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_9">inventories/production/host_vars/vml010110/kea </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_9"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/inventories/production/host_vars/vml010110/kea" class="mediafile mf_">inventories/production/host_vars/vml010110/kea</a></dt> <dd><pre class="file">dhcp4_interface_socket_type: raw dhcp4_dns: "10.0.10.110" dhcp4_domain: '{{ guest_domain }}' dhcp4_timeserver: '{{ dhcp4_dns }}' dhcp4_mgmt_socket_type: unix dhcp4_mgmt_socket_name: /var/lib/kea/kea4-ctrl-socket dhcp4_lease_db_type: memfile dhcp4_lease_db_persists: "true" dhcp4_lease_db_name: "/var/lib/kea/kea-leases4.csv" dhcp4_lease_lfc_interval: 3200 dhcp4_lease_max_errors: 100 dhcp4_reclaim_timer_wait_time: 10 dhcp4_flush_reclaimed_timer_wait_time: 25 dhcp4_hold_reclaimed_time: 3600 dhcp4_max_reclaim_leases: 100 dhcp4_max_reclaim_time: 250 dhcp4_unwarned_reclaim_cycles: 5 dhcp4_renew_timer: 1800 dhcp4_rebind_timer: 3200 dhcp4_valid_lifetime: 3600 dhcp4_timeoffset: "-18000" dhcp4_subnetid_1: 42 dhcp4_subnet_1: '{{ guest_ip4_net_2 }}{{ guest_mask4_2 }}' dhcp4_pool_1: "10.0.10.230 - 10.0.10.250" dhcp4_logger_name: kea-dhcp4 dhcp4_logger_output: syslog dhcp4_logger_severity: INFO dhcp4_logger_debug_level: 0 dhcp6_mgmt_socket_type: '{{ dhcp4_mgmt_socket_type }}' dhcp6_mgmt_socket_name: /var/lib/kea/kea6-ctrl-socket dhcp6_lease_db_type: '{{ dhcp4_lease_db_type }}' dhcp6_lease_db_persists: "{{ dhcp4_lease_db_persists }}" dhcp6_lease_db_name: "/var/lib/kea/kea-leases6.csv" dhcp6_lease_lfc_interval: '{{ dhcp4_lease_lfc_interval }}' dhcp6_lease_max_errors: '{{ dhcp4_lease_max_errors }}' dhcp6_reclaim_timer_wait_time: '{{ dhcp4_reclaim_timer_wait_time }}' dhcp6_flush_reclaimed_timer_wait_time: '{{ dhcp4_flush_reclaimed_timer_wait_time }}' dhcp6_hold_reclaimed_time: '{{ dhcp4_hold_reclaimed_time }}' dhcp6_max_reclaim_leases: '{{ dhcp4_max_reclaim_leases }}' dhcp6_max_reclaim_time: '{{ dhcp4_max_reclaim_time }}' dhcp6_unwarned_reclaim_cycles: '{{ dhcp4_unwarned_reclaim_cycles }}' dhcp6_valid_lifetime: '{{ dhcp4_valid_lifetime }}' dhcp6_renew_timer: '{{ dhcp4_renew_timer }}' dhcp6_rebind_timer: '{{ dhcp4_rebind_timer }}' dhcp6_preferred_lifetime: 3000 dhcp6_dns: "{{guest_ip6_ula_2}}" dhcp6_timeserver: '{{guest_ip6_ula_2}}' dhcp6_domain: '{{ guest_domain }}' dhcp6_subnetid_1: 62 dhcp6_subnet_1: '{{ guest_ip6_ula_pfx_2 }}{{ guest_mask6_2 }}' dhcp6_pool_1: "fd00:dead:b33f:0:10:0:10:300/120" dhcp6_logger_name: kea-dhcp6 dhcp6_logger_output: '{{ dhcp4_logger_output }}' dhcp6_logger_severity: '{{ dhcp4_logger_severity }}' dhcp6_logger_debug_level: '{{ dhcp4_logger_debug_level }}'</pre> </dd></dl></div> <p> Unser Beispiels-Inventory hat also nunmehr folgenden Aufbau: </p> <pre class="code">inventories/production/ ├── hosts └── host_vars ├── pnc010007 └── vml010110 ├── kea └── kvm_vhost 3 directories, 4 files</pre> </div> <h4 class="sectionedit32" id="playbook">Playbook</h4> <div class="level4"> <p> Unser Playbook zum Installieren und Konfigurieren der beiden Kea-Daemon <strong>kea-dhcp4</strong> und <strong>kea-dhcp6</strong>, ist wie immer schlank, unscheinbar und unspektakulär, beinhaltet aber Hinweise zur Aufgabe und wie es aufzurufen ist. </p> <pre class="code"> $ vim playbooks/kea_dhcp.yml</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_10">playbooks/kea_dhcp.yml </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_10"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/playbooks/kea_dhcp.yml" class="mediafile mf_yml">playbooks/kea_dhcp.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co1"># Ansible Playbook zum Installieren und Konfigiurieren deines IPv4-DHCP-<span class="search_hit">Servers</span> auf Basis Kea.</span> <span class="co1">#</span> <span class="co1"># Aufruf via:</span> <span class="co1"># $ ansible-playbook playbooks/kea-dhcp.yml</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Playbookname: kea_dhcp.yml"</span> <span class="co1"># Name des Playbooks</span><span class="co3"> hosts</span><span class="sy2">: </span>vml010110 <span class="co1"># Host bzw. Hostgruppen für die das Playbook gelten soll</span> <span class="co4"> roles</span>:<span class="co3"> - role</span><span class="sy2">: </span>kea_dhcp <span class="co1"># Kea-DHCP4|6 Daemon einrichten</span>   <span class="sy1">...</span></pre> </dd></dl></div> </div> <h4 class="sectionedit33" id="rolle">Rolle</h4> <div class="level4"> <p> Für die Konfiguration der <strong>kea</strong>-Daemon verwenden wir eine eigene Rolle <strong><code>kea_dhcp</code></strong>, die wir bei unserem zuvor angelegten Playbooks später einfach mit aufrufen werden. Hierzu kopieren wir uns zunächst die Mustervorlage <strong><code>common</code></strong>. </p> <pre class="code"> $ cp -avr roles/common/ roles/kea_dhcp</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_11">Ausgabe von cp -avr roles/common/ roles/kea_dhcp </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_11"><pre class="code">'roles/common/' -> 'roles/kea_dhcp' 'roles/common/defaults' -> 'roles/kea_dhcp/defaults' 'roles/common/defaults/.gitkeep' -> 'roles/kea_dhcp/defaults/.gitkeep' 'roles/common/files' -> 'roles/kea_dhcp/files' 'roles/common/files/.gitkeep' -> 'roles/kea_dhcp/files/.gitkeep' 'roles/common/handlers' -> 'roles/kea_dhcp/handlers' 'roles/common/handlers/.gitkeep' -> 'roles/kea_dhcp/handlers/.gitkeep' 'roles/common/library' -> 'roles/kea_dhcp/library' 'roles/common/library/.gitkeep' -> 'roles/kea_dhcp/library/.gitkeep' 'roles/common/lookup_plugins' -> 'roles/kea_dhcp/lookup_plugins' 'roles/common/lookup_plugins/.gitkeep' -> 'roles/kea_dhcp/lookup_plugins/.gitkeep' 'roles/common/meta' -> 'roles/kea_dhcp/meta' 'roles/common/meta/.gitkeep' -> 'roles/kea_dhcp/meta/.gitkeep' 'roles/common/module_utils' -> 'roles/kea_dhcp/module_utils' 'roles/common/module_utils/.gitkeep' -> 'roles/kea_dhcp/module_utils/.gitkeep' 'roles/common/tasks' -> 'roles/kea_dhcp/tasks' 'roles/common/tasks/main.yml' -> 'roles/kea_dhcp/tasks/main.yml' 'roles/common/templates' -> 'roles/kea_dhcp/templates' 'roles/common/templates/.gitkeep' -> 'roles/kea_dhcp/templates/.gitkeep' 'roles/common/vars' -> 'roles/kea_dhcp/vars' 'roles/common/vars/.gitkeep' -> 'roles/kea_dhcp/vars/.gitkeep'</pre> </div> <p> Bei Bedarf können wir uns die Struktur die somit angelegt wurde mit nachfolgendem Befehl anzeigen lassen. </p> <pre class="code"> $ tree roles/kea_dhcp/</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_12">Ausgabe von tree roles/kea_dhcp/ </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_12"><pre class="code">roles/kea_dhcp/ ├── defaults ├── files ├── handlers │   └── main.yml ├── library ├── lookup_plugins ├── meta ├── module_utils ├── tasks │   ├── dhcp4.yml │   ├── dhcp6.yml │   ├── firewalld.yml │   ├── main.yml │   └── vorbereitung.yml ├── templates │   ├── dhcp4.j2 │   └── dhcp6.j2 └── vars 11 directories, 8 files</pre> </div> <p> Wie wir sehen ist die Rolle durchaus überschaubar, im Task <strong><code>main.yaml</code></strong> verweisen wir lediglich auf die eigentlichen Tasks <strong><code>vorbereitung</code></strong>, <strong><code>dhcp4</code></strong>, <strong><code>dhcp6</code></strong> und <strong><code>firewalld</code></strong> </p> <pre class="code"> $ vim roles/kea_dhcp/tasks/main.yml</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_13">roles/kea_dhcp/tasks/main.yml </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_13"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/roles/kea_dhcp/tasks/main.yml" class="mediafile mf_yml">roles/kea_dhcp/tasks/main.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Installation des Kea DHCP-<span class="search_hit">Servers</span>."</span><span class="co4"> ansible.builtin.include_tasks</span>:<span class="co3"> file</span><span class="sy2">: </span>vorbereitung.yml<span class="co4"> apply</span>:<span class="co3"> tags</span><span class="sy2">: </span>vorbereitung <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Konfiguration des Kea DHCP4-<span class="search_hit">Servers</span>."</span><span class="co4"> ansible.builtin.include_tasks</span>:<span class="co3"> file</span><span class="sy2">: </span>dhcp4.yml<span class="co4"> apply</span>:<span class="co3"> tags</span><span class="sy2">: </span>dhcp4 <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Konfiguration des Kea DHCP6-<span class="search_hit">Servers</span>."</span><span class="co4"> ansible.builtin.include_tasks</span>:<span class="co3"> file</span><span class="sy2">: </span>dhcp6.yml<span class="co4"> apply</span>:<span class="co3"> tags</span><span class="sy2">: </span>dhcp6 <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Konfiguration der firewalld-Regeln für beide Kea Daemons."</span><span class="co4"> ansible.builtin.include_tasks</span>:<span class="co3"> file</span><span class="sy2">: </span>firewalld.yml<span class="co4"> apply</span>:<span class="co3"> tags</span><span class="sy2">: </span>firewalld   <span class="sy1">...</span></pre> </dd></dl></div> <p> Die Installation des Kea DHCP-<span class="search_hit">Servers</span> wird in der ersten Task-Gruppe mit dem tag <strong><code>vorbereitung</code></strong> vorgenommen. </p> <pre class="code"> $ vim roles/kea_dhcp/tasks/vorbereitung.yml</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_14">roles/kea_dhcp/tasks/vorbereitung.yml </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_14"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/roles/kea_dhcp/tasks/vorbereitung.yml" class="mediafile mf_yml">roles/kea_dhcp/tasks/vorbereitung.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Vorhandenes System aktualisieren."</span><span class="co4"> community.general.pacman</span>:<span class="co3"> update_cache</span><span class="sy2">: </span>true<span class="co3"> upgrade</span><span class="sy2">: </span>true <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Installation der benötigten kea Pakete."</span><span class="co4"> community.general.pacman</span>:<span class="co4"> name</span><span class="sy2">: </span> - kea<span class="co3"> state</span><span class="sy2">: </span>present   <span class="sy1">...</span></pre> </dd></dl></div> <p> Für die Konfiguration des Kea-DHCP4-Daemon werden die nötigen Schritte in der Task-Gruppe mit dem tag <strong><code>dhcp4</code></strong> definiert. </p> <pre class="code"> $ vim roles/kea_dhcp/tasks/dhcp4.yml</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_15">roles/kea_dhcp/tasks/dhcp4.yml </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_15"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/roles/kea_dhcp/tasks/dhcp4.yml" class="mediafile mf_yml">roles/kea_dhcp/tasks/dhcp4.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Checken ob es bereits eine Backupdatei der kea-dhcp4.conf gibt."</span><span class="co4"> ansible.builtin.stat</span>:<span class="co3"> path</span><span class="sy2">: </span>/etc/kea/kea-dhcp4.conf.orig<span class="co3"> register</span><span class="sy2">: </span>check_kea_config <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Backupdatei der Konfigurationsdatei kea-dhcp4.conf erstellen."</span><span class="co4"> ansible.builtin.copy</span>:<span class="co3"> remote_src</span><span class="sy2">: </span>true<span class="co3"> src</span><span class="sy2">: </span>/etc/kea/kea-dhcp4.conf<span class="co3"> dest</span><span class="sy2">: </span>/etc/kea/kea-dhcp4.conf.orig<span class="co3"> owner</span><span class="sy2">: </span>root<span class="co3"> group</span><span class="sy2">: </span>root<span class="co3"> mode</span><span class="sy2">: </span>'0644'<span class="co3"> when</span><span class="sy2">: </span>not check_kea_config.stat.exists <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Individuelle Konfigurationsdatei kea-dhcp4.conf erzeugen und kopieren."</span><span class="co4"> ansible.builtin.template</span>:<span class="co3"> src</span><span class="sy2">: </span>templates/dhcp4.j2<span class="co3"> dest</span><span class="sy2">: </span>/etc/kea/kea-dhcp4.conf<span class="co3"> owner</span><span class="sy2">: </span>root<span class="co3"> group</span><span class="sy2">: </span>root<span class="co3"> mode</span><span class="sy2">: </span>'0644'<span class="co3"> notify</span><span class="sy2">: </span>Restart dhcp4 <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Sicherstellen, dass der kea-dhcp4 Daemon reboot(-fest) startet."</span><span class="co4"> ansible.builtin.systemd</span>:<span class="co3"> name</span><span class="sy2">: </span>kea-dhcp4<span class="co3"> enabled</span><span class="sy2">: </span>true   <span class="sy1">...</span></pre> </dd></dl></div> <p> Der Kea-DHCP4-Daemon wird mit Hilfe der Task-Gruppe mit dem tag <strong><code>dhcp6</code></strong> konfiguriert. </p> <pre class="code"> $ vim roles/kea_dhcp/tasks/dhcp6.yml</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_16">roles/kea_dhcp/tasks/dhcp6.yml </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_16"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/roles/kea_dhcp/tasks/dhcp6.yml" class="mediafile mf_yml">roles/kea_dhcp/tasks/dhcp6.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Checken ob es bereits eine Backupdatei der kea-dhcp6.conf gibt."</span><span class="co4"> ansible.builtin.stat</span>:<span class="co3"> path</span><span class="sy2">: </span>/etc/kea/kea-dhcp6.conf.orig<span class="co3"> register</span><span class="sy2">: </span>check_kea_config <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Backupdatei der Konfigurationsdatei kea-dhcp6.conf erstellen."</span><span class="co4"> ansible.builtin.copy</span>:<span class="co3"> remote_src</span><span class="sy2">: </span>true<span class="co3"> src</span><span class="sy2">: </span>/etc/kea/kea-dhcp6.conf<span class="co3"> dest</span><span class="sy2">: </span>/etc/kea/kea-dhcp6.conf.orig<span class="co3"> owner</span><span class="sy2">: </span>root<span class="co3"> group</span><span class="sy2">: </span>root<span class="co3"> mode</span><span class="sy2">: </span>'0644'<span class="co3"> when</span><span class="sy2">: </span>not check_kea_config.stat.exists <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Individuelle Konfigurationsdatei kea-dhcp6.conf erzeugen und kopieren."</span><span class="co4"> ansible.builtin.template</span>:<span class="co3"> src</span><span class="sy2">: </span>templates/dhcp6.j2<span class="co3"> dest</span><span class="sy2">: </span>/etc/kea/kea-dhcp6.conf<span class="co3"> owner</span><span class="sy2">: </span>root<span class="co3"> group</span><span class="sy2">: </span>root<span class="co3"> mode</span><span class="sy2">: </span>'0644'<span class="co3"> notify</span><span class="sy2">: </span>Restart dhcp6 <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Sicherstellen, dass der kea-dhcp4 Daemon reboot(-fest) startet."</span><span class="co4"> ansible.builtin.systemd</span>:<span class="co3"> name</span><span class="sy2">: </span>kea-dhcp6<span class="co3"> enabled</span><span class="sy2">: </span>true   <span class="sy1">...</span></pre> </dd></dl></div> <p> Nun brauchen wir noch eine Beschreibung der Aufgaben für die Konfiguration der firewalld-Regeln für beide Kea Daemons. </p> <pre class="code"> $ vim roles/kea_dhcp/tasks/firewalld.yml</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_17">roles/kea_dhcp/tasks/firewalld.yml </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_17"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/roles/kea_dhcp/tasks/firewalld.yml" class="mediafile mf_yml">roles/kea_dhcp/tasks/firewalld.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Konfiguration der firewalld Regeln in Zone_2 für die Kea-Daemon."</span><span class="co4"> ansible.posix.firewalld</span>:<span class="co3"> zone</span><span class="sy2">: </span>'<span class="br0">{</span><span class="br0">{</span> guest_zone_2 <span class="br0">}</span><span class="br0">}</span>'<span class="co3"> service</span><span class="sy2">: </span>'<span class="br0">{</span><span class="br0">{</span> item.service <span class="br0">}</span><span class="br0">}</span>'<span class="co3"> immediate</span><span class="sy2">: </span>true<span class="co3"> permanent</span><span class="sy2">: </span>true<span class="co3"> state</span><span class="sy2">: </span>enabled<span class="co3"> with_items</span><span class="sy2">: </span>'<span class="br0">{</span><span class="br0">{</span> guest_fw_services <span class="br0">}</span><span class="br0">}</span>' <span class="co3"> - name</span><span class="sy2">: </span><span class="st0">"Zum Schluss den aktuellen permanenten Regelsatz final neu laden."</span><span class="co4"> ansible.builtin.service</span>:<span class="co3"> name</span><span class="sy2">: </span>firewalld<span class="co3"> state</span><span class="sy2">: </span>reloaded   <span class="sy1">...</span></pre> </dd></dl></div> <p> Sollte bei der Abarbeitung des Playbook eine oder beide Konfigurationsdateien <strong><code>kea-dhcp4.conf</code></strong> und <strong><code>kea-dhcp6.conf</code></strong> verändert werden, ist natürlich hierbei ein Restart der betreffenden Kea-Daemon notwendig. Hierzu verwenden wir die <strong><a href="https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html" class="urlextern" target="_tab" title="https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_handlers.html" rel="ugc nofollow noopener">Ansible Playbook Handlers</a></strong>. Diese Handler werden in den beiden Tasks zur Erstellung der Kea-Konfigurationsdateien mit Hilfe eines <strong>handler</strong>-Calls aufgerufen, sofern sich die Datei verändert hat. </p> <p> Zu guter Letzt brauchen wir noch eine Konfiguration der Aufgaben die bei einem <strong><code>notify</code></strong> abgearbeitet werden sollen. </p> <pre class="code"> $ vim roles/kea_dhcp/handlers/main.yml</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_18">roles/kea_dhcp/handlers/main.yml </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_18"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/roles/kea_dhcp/handlers/main.yml" class="mediafile mf_yml">roles/kea_dhcp/handlers/main.yml</a></dt> <dd><pre class="code file yaml"><span class="sy1">---</span> <span class="co3"> - name</span><span class="sy2">: </span>Restart dhcp4<span class="co4"> ansible.builtin.service</span>:<span class="co3"> name</span><span class="sy2">: </span>kea-dhcp4<span class="co3"> state</span><span class="sy2">: </span>restarted <span class="co3"> - name</span><span class="sy2">: </span>Restart dhcp6<span class="co4"> ansible.builtin.service</span>:<span class="co3"> name</span><span class="sy2">: </span>kea-dhcp6<span class="co3"> state</span><span class="sy2">: </span>restarted   <span class="sy1">...</span></pre> </dd></dl></div> <p> Für die Erstellung der jeweiligen Konfigurationsdateien <strong><code>/etc/kea/kea-dhcp4.conf</code></strong> und <strong><code>/etc/kea/kea-dhcp6.conf</code></strong> brauchen wir nun noch jeweils ein <strong><a href="https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_templating.html" class="urlextern" target="_tab" title="https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_templating.html" rel="ugc nofollow noopener">Jinja2</a></strong> Templates. Mit Hilfe dieser beiden Templates und der darin enthaltenen Schleifendefinitionen werden dann mit Hilfe der Daten aus dem Inventory die zuvor genannten Konfigurationsdateien erzeugt. </p> <pre class="code"> $ vim roles/kea_dhcp/templates/dhcp4.j2</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_19">roles/kea_dhcp/templates/dhcp4.j2 </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_19"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/roles/kea_dhcp/templates/dhcp4.j2" class="mediafile mf_j2">roles/kea_dhcp/templates/dhcp4.j2</a></dt> <dd><pre class="code file j2">// // *** Ansible managed configuration file, do not modify manually! *** // // This is a basic configuration for the Kea DHCPv4 server. See section // 8.2. DHCPv4 Server Configuration for detailed informations; the direct link // for the stable version is https://kea.readthedocs.io/en/latest/. // // This configuration file contains only DHCPv4 server's configuration. // If configurations for other Kea services are also included in this file they // are ignored by the DHCPv4 server. // // DHCPv4 configuration starts here. This section will be read by DHCPv4 server // and will be ignored by other components. { "Dhcp4": { // See section 8.2.4 Interface Configuration for more details: "interfaces-config": { "interfaces": [ "{{ guest_nic_2 }}" ], "dhcp-socket-type": "{{ dhcp4_interface_socket_type }}" },   // See section 8.9. Management API for the DHCPv4 Server for more details. "control-socket": { "socket-type": "{{ dhcp4_mgmt_socket_type }}", "socket-name": "{{ dhcp4_mgmt_socket_name }}" },   // See Section 8.2.2.1. Memfile - Basic Storage for Leases for details. "lease-database": { "type": "{{ dhcp4_lease_db_type }}", "persist": {{ dhcp4_lease_db_persists }}, "name": "{{ dhcp4_lease_db_name }}", "lfc-interval": {{ dhcp4_lease_lfc_interval }}, "max-row-errors": {{ dhcp4_lease_max_errors }} },   // Setup reclamation of the expired leases and leases affinity. // See section 11. Lease Expiration for more and detailed informations. "expired-leases-processing": { "reclaim-timer-wait-time": {{ dhcp4_reclaim_timer_wait_time }}, "flush-reclaimed-timer-wait-time": {{ dhcp4_flush_reclaimed_timer_wait_time }}, "hold-reclaimed-time": {{ dhcp4_hold_reclaimed_time }}, "max-reclaim-leases": {{ dhcp4_max_reclaim_leases }}, "max-reclaim-time": {{ dhcp4_max_reclaim_time }}, "unwarned-reclaim-cycles": {{ dhcp4_unwarned_reclaim_cycles }} },   // Global timers specified here apply to all subnets, unless there are // subnet specific values defined in particular subnets. See section // 8.2.1. Introduction ans section 8.2.9. Sending T1 (Option 58) and T2 // (Option 59) for details. "renew-timer": {{ dhcp4_renew_timer }}, "rebind-timer": {{ dhcp4_rebind_timer }}, "valid-lifetime": {{ dhcp4_valid_lifetime }},   // Many additional parameters can be specified here. Alle datails will be // found in following sections: // - 8.2.10. Standard DHCPv4 Options // - 8.2.11. Custom DHCPv4 Options // - 8.2.12. DHCPv4 Private Options // - 8.2.13. DHCPv4 Vendor-Specific Options // - 8.2.14. Nested DHCPv4 Options (Custom Option Spaces) // - 8.2.15. Unspecified Parameters for DHCPv4 Option Configuration // - 8.2.16. Support for Long Options "option-data": [ // Domain-Name-Server: { "name": "domain-name-<span class="search_hit">servers</span>", "data": "{{ dhcp4_dns }}" },   // Domain-Name: { "name": "domain-name", "data": "{{ dhcp4_domain }}" },   // Time-Server: { "name": "ntp-<span class="search_hit">servers</span>", "data": "{{ dhcp4_timeserver }}" },   // Time-Offset ( Eastern Standard Time): { "name": "time-offset", "data": "{{ dhcp4_timeoffset }}" } ],   // Finally, we list the subnets from which we will be leasing addresses. // See section 8.2.6. IPv4 Subnet Identifier and the following sections // for more details. "subnet4": [ { // This defines the whole subnet. Kea will use this information to // determine where the clients are connected. This is the whole // subnet in your network.   // Subnet identifier should be unique for each subnet. // Subnet identifier for zone {{ guest_zone_1 }} "id": {{ dhcp4_subnetid_1 }},   // This is mandatory parameter for each subnet. "subnet": "{{ dhcp4_subnet_1 }}",   // Pools define the actual part of your subnet that is governed // by Kea. "pools": [ { "pool": "{{ dhcp4_pool_1 }}" } ],   // These are options that are subnet specific. "option-data": [ { // Router for the IPv4 subnet. "name": "routers", "data": "{{ guest_ip4_2 }}" },   { // Time-Server: "name": "ntp-<span class="search_hit">servers</span>", "data": "{{ dhcp4_timeserver }}" },   { // Domain-Name-Server: "name": "domain-name-<span class="search_hit">servers</span>", "data": "{{ dhcp4_dns }}" }   ],   // Kea offers host reservations mechanism. Kea supports reservations // by several different types of identifiers: hw-address // (hardware/MAC address of the client), duid (DUID inserted by the // client), client-id (client identifier inserted by the client) and // circuit-id (circuit identifier inserted by the relay agent). "reservations": [   // This are the reservations for a specific hardware/MAC addresses. {% for host in groups['intra'] %} // "{{ hostvars[host]['host_beschreibung'] }}" { "hw-address": "{{ hostvars[host]['host_mac'] }}", "ip-address": "{{ hostvars[host]['host_ipv4'] }}", "hostname": "{{ host }}.{{ guest_zone_2 }}.{{ guest_domain }}" },   {% endfor %} // Dummy entry - example definition { "hw-address": "00:00:00:00:00:00", "ip-address": "10.0.10.254", "hostname": "dummy.{{ guest_zone_2 }}.{{ guest_domain }}" } ] } ],   // See Section 19.1. Logging Configuration for details. // Logging configuration starts here. Kea uses different loggers to log various // activities. For details (e.g. names of loggers), see Chapter 18. "loggers": [ { // This section affects kea-dhcp4, which is the base logger for DHCPv4 // component. It tells DHCPv4 server to write all log messages (on // severity INFO or more) to a file. "name": "{{ dhcp4_logger_name }}", "output_options": [ { // Specifies the output file. There are several special values // supported: // - stdout (prints on standard output) // - stderr (prints on standard error) // - syslog (logs to syslog) // - syslog:name (logs to syslog using specified name) // Any other value is considered a name of the file "output": "{{ dhcp4_logger_output }}" } ],   // This specifies the severity of log messages to keep. Supported values // are: FATAL, ERROR, WARN, INFO, DEBUG "severity": "{{ dhcp4_logger_severity }}",   // If DEBUG level is specified, this value is used. 0 is least verbose, // 99 is most verbose. Be cautious, Kea can generate lots and lots // of logs if told to do so. "debuglevel": {{ dhcp4_logger_debug_level }} } ] } }</pre> </dd></dl></div><pre class="code"> $ vim roles/kea_dhcp/templates/dhcp6.j2</pre> <p><a class="folder" href="#folded_f0924c0cc010c4e1f04a46a726b1073a_20">roles/kea_dhcp/templates/dhcp6.j2 </a></p><div class="folded hidden" id="folded_f0924c0cc010c4e1f04a46a726b1073a_20"><dl class="file"> <dt><a href="https://gitlab.nausch.org/django/example_kea/-/blob/main/roles/kea_dhcp/templates/dhcp6.j2" class="mediafile mf_j2">roles/kea_dhcp/templates/dhcp6.j2</a></dt> <dd><pre class="code file j2">// // *** Ansible managed configuration file, do not modify manually! *** // // This is our basic configuration for the Kea DHCPv6 server. See section // 9.2 DHCPv6 Server Configuration for detailed informations. the direct link // for the stable version is https://kea.readthedocs.io/). // // This configuration file contains only DHCPv6 server's configuration. // If configurations for other Kea services are also included in this file they // are ignored by the DHCPv6 server. // // DHCPv6 configuration starts here. This section will be read by DHCPv6 server // and will be ignored by other components. { "Dhcp6": { // See section 9.2.4 Interface Configuration for more details: "interfaces-config": { "interfaces": [ "{{ guest_nic_2 }}" ] },   // Kea supports control channel, which is a way to receive management // commands while the server is running. For detailed description, // see Sections 9.14. "control-socket": { "socket-type": "{{ dhcp6_mgmt_socket_type }}", "socket-name": "{{ dhcp6_mgmt_socket_name }}" }, // Use Memfile lease database backend to store leases in a CSV file. // See Section 9.2.2.1 Memfile - Basic Storage for Leases "lease-database": { "type": "{{ dhcp6_lease_db_type }}", "persist": {{ dhcp6_lease_db_persists }}, "name": "/var/lib/kea/kea-leases6.csv", "lfc-interval": {{ dhcp6_lease_lfc_interval }}, "max-row-errors": {{ dhcp6_lease_max_errors }} },   // Setup reclamation of the expired leases and leases affinity. // See section 11. Lease Expiration for more and detailed informations. "expired-leases-processing": { "reclaim-timer-wait-time": {{ dhcp6_reclaim_timer_wait_time }}, "flush-reclaimed-timer-wait-time": {{ dhcp6_flush_reclaimed_timer_wait_time }}, "hold-reclaimed-time": {{ dhcp6_hold_reclaimed_time }}, "max-reclaim-leases": {{ dhcp6_max_reclaim_leases }}, "max-reclaim-time": {{ dhcp6_max_reclaim_time }}, "unwarned-reclaim-cycles": {{ dhcp6_unwarned_reclaim_cycles }} },   // Global timers specified here apply to all subnets, unless there are // subnet specific values defined in particular subnets. See section // 9.2.1. Introduction. "valid-lifetime": {{ dhcp6_valid_lifetime }}, "renew-timer": {{ dhcp6_renew_timer }}, "rebind-timer": {{ dhcp6_rebind_timer }}, "preferred-lifetime": {{ dhcp6_preferred_lifetime }},   // Many additional parameters can be specified here. Alle datails will be // found in following sections: // - 9.2.11. Standard DHCPv6 Options // - 9.2.14. Custom DHCPv4 Options // - 9.2.15. DHCPv6 Vendor-Specific Options // - 9.2.16. Nested DHCPv6 Options (Custom Option Spaces) // - 9.2.17. Unspecified Parameters for DHCPv6 Option Configuration // // For a complete list of options currently supported by Kea, see // Section 9.2.11 "Standard DHCPv6 Options". Kea also supports // vendor options (see Section 7.2.10) and allows users to define their // own custom options (see Section 7.2.9). "option-data": [ // Domain-Name-Server: { "name": "dns-<span class="search_hit">servers</span>", "data": "{{ dhcp6_dns }}" },   // Domain-Search-Liste: { "name": "domain-search", "data": "{{ dhcp6_domain }}" } ],   // Finally, we list the subnets from which we will be leasing addresses. // See section 9.2.5 IPv6 Subnet Identifier and the following sections // for more details. "subnet6": [ { "interface": "{{ guest_nic_2 }}",   // This defines the whole subnet. Kea will use this information to // determine where the clients are connected. This is the whole // subnet in your network.   // Subnet identifier should be unique for each subnet. // Subnet identifier for zone {{ guest_zone_2 }} "id": {{ dhcp6_subnetid_1 }},   // This is mandatory parameter for each subnet. "subnet": "{{ dhcp6_subnet_1 }}",   // Pools define the actual part of your subnet that is governed // by Kea. "pools": [ { "pool": "{{ dhcp6_pool_1 }}" } ],   "option-data": [ // You can specify additional options here that are subnet // specific. Also, you can override global options here. { "name": "dns-<span class="search_hit">servers</span>", "data": "{{ dhcp6_dns }}" }, { "name": "sntp-<span class="search_hit">servers</span>", "data": "{{ dhcp6_dns }}" }   ],   // Host reservations can be defined for each subnet. // Note that reservations are subnet-specific in Kea. This is // different than ISC DHCP. Keep that in mind when migrating // your configurations. "reservations": [   // This are the reservations for specific DUID matchings. {% for host in groups['intra'] %} // "{{ hostvars[host]['host_beschreibung'] }}" { "duid": "{{ hostvars[host]['host_duid'] }}", "ip-addresses": [ "{{ hostvars[host]['host_ipv6'] }}" ], "hostname": "{{ host }}.{{ guest_zone_2 }}.{{ guest_domain }}" },   {% endfor %} // Dummy entry - example definition { "duid": "00:00:00:00:00:00:00:00:00:00", "ip-addresses": [ "fd00:0:0:7:10:0:10:9999" ], "hostname": "dummy.{{ guest_zone_2 }}.{{ guest_domain }}" } ] } ],   // Logging configuration starts here. Kea uses different loggers to log various //# activities. For details (e.g. names of loggers), see Chapter 19. "loggers": [ { // This specifies the logging for kea-dhcp6 logger, i.e. all logs // generated by Kea DHCPv6 server. "name": "{{ dhcp6_logger_name }}", "output_options": [ { // Specifies the output file. There are several special values // supported: // - stdout (prints on standard output) // - stderr (prints on standard error) // - syslog (logs to syslog) // - syslog:name (logs to syslog using specified name) // Any other value is considered a name of the file "output": "{{ dhcp6_logger_output }}" } ],   // This specifies the severity of log messages to keep. Supported values // are: FATAL, ERROR, WARN, INFO, DEBUG "severity": "{{ dhcp6_logger_severity }}",   // If DEBUG level is specified, this value is used. 0 is least verbose, // 99 is most verbose. Be cautious, Kea can generate lots and lots // of logs if told to do so. "debuglevel": {{ dhcp6_logger_debug_level }} } ] } }</pre> </dd></dl></div> </div> <h4 class="sectionedit34" id="ausfuehrung_-_playbooklauf">Ausführung - Playbooklauf</h4> <div class="level4"> <p> Die orchestrierte Variante der Installation und Konfiguration unserer <strong>kea</strong>-Daemon gestaltet sich ab sofort sehr einfach, brauchen wir doch lediglich die Konfigurationswerte im Inventory zu hinterlegen und zu pflegen und letztendlich das Playbook entsprechend aufzurufen, wenn z.B. ein Client im Intranet hinzugefügt, entfernt oder ausgetauscht wird: </p> <pre class="code"> $ ansible-playbook playbooks/kea_dhcp.yml</pre> <p> <pre class="code"> <font style="color: rgb(0, 0, 0)">[16:43:13] Gathering Facts</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 2.19s</font> <font style="color: rgb(0, 0, 0)">[16:43:15] kea-dhcp : Installation des Kea DHCP-<span class="search_hit">Servers</span>.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 7ms</font> <font style="color: rgb(0, 0, 0)">[16:43:15] ↳ vorbereitung: Vorhandenes System aktualisieren.</font> <font style="color: rgb(196, 160, 0)">↳ vml010110 | CHANGED | 2.45s</font> <font style="color: rgb(0, 0, 0)">[16:43:17] ↳ vorbereitung: Installation der benötigten kea Pakete.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 1.63s</font> <font style="color: rgb(0, 0, 0)">[16:43:19] kea-dhcp : Konfiguration des Kea DHCP4-<span class="search_hit">Servers</span>.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 12ms</font> <font style="color: rgb(0, 0, 0)">[16:43:19] ↳ dhcp4: Checken ob es bereits eine Backupdatei der kea-dhcp4.conf gibt.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 609ms</font> <font style="color: rgb(0, 0, 0)">[16:43:19] ↳ dhcp4: Backupdatei der Konfigurationsdatei kea-dhcp4.conf erstellen.</font> <font style="color: rgb(3, 99, 84)">vml010110 | SKIPPED | 9ms</font> <font style="color: rgb(0, 0, 0)">[16:43:20] ↳ dhcp4: Individuelle Konfigurationsdatei kea-dhcp4.conf erzeugen und kopieren.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 1.19s</font> <font style="color: rgb(0, 0, 0)">[16:43:21] ↳ dhcp4: Sicherstellen, dass der kea-dhcp4 Daemon reboot(-fest) startet.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 918ms<font> <font style="color: rgb(0, 0, 0)">[16:43:22] kea-dhcp : Konfiguration des Kea DHCP6-<span class="search_hit">Servers</span>.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 10ms<font> <font style="color: rgb(0, 0, 0)">[16:43:22] ↳ dhcp6: Checken ob es bereits eine Backupdatei der kea-dhcp6.conf gibt.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 524ms<font> <font style="color: rgb(0, 0, 0)">[16:43:22] ↳ dhcp6: Backupdatei der Konfigurationsdatei kea-dhcp6.conf erstellen.</font> <font style="color: rgb(3, 99, 84)">vml010110 | SKIPPED | 14ms<font> <font style="color: rgb(0, 0, 0)">[16:43:22] ↳ dhcp6: Individuelle Konfigurationsdatei kea-dhcp6.conf erzeugen und kopieren.</font> <font style="color: rgb(196, 160, 0)">↳ vml010110 | CHANGED | 1.31s<font> <font style="color: rgb(0, 0, 0)">[16:43:24] ↳ dhcp6: Sicherstellen, dass der kea-dhcp4 Daemon reboot(-fest) startet.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 826ms</font> <font style="color: rgb(0, 0, 0)">[16:43:24] kea-dhcp : Konfiguration der firewalld-Regeln für beide Kea Daemons.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 27ms</font> <font style="color: rgb(0, 0, 0)">[16:43:24] ↳ firewalld: Konfiguration der firewalld Regeln in Zone_1 für die Kea-Daemon.</font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 5.09s</font> <font style="color: rgb(0, 0, 0)">[16:43:30] ↳ firewalld: Konfiguration der firewalld Regeln in Zone_2 für die Kea-Daemon./font> <font style="color: rgb(25, 100, 5)">↳ vml010110 | SUCCESS | 5.12s</font> <font style="color: rgb(0, 0, 0)">[16:43:35] ↳ firewalld: Zum Schluss den aktuellen permanenten Regelsatz final neu laden.</font> <font style="color: rgb(196, 160, 0)">↳ vml010110 | CHANGED | 918ms</font> <font style="color: rgb(25, 100, 5)">triggering handler | kea-dhcp : Restart dhcp6</font> <font style="color: rgb(196, 160, 0)">↳ vml010110 | CHANGED | 1.76s</font> <font style="color: rgb(0, 0, 0)">[16:43:36] system</font> <font style="color: rgb(25, 100, 5)">-- Play recap --</font> <font style="color: rgb(196, 160, 0)">vml010110 </font><font style="color: rgb(0, 0, 0)">: </font><font style="color: rgb(25, 100, 5)">ok=17 </font><font style="color: rgb(196, 160, 0)">changed=4 </font>unreachable=0 failed=0 <font style="color: rgb(3, 99, 84)">skipped=2</font> <font style="color: rgb(0, 0, 0)">rescued=0 ignored=0</font> </pre> </p> </div> <h3 class="sectionedit35 page-header pb-3 mb-4 mt-5" id="ergebniskontrolle">Ergebniskontrolle</h3> <div class="level3"> <p> Ob die Konfigurationsdateien valide erstellt und auch von den Kea-Daemons erfolgreich geladen worden sind, kontrollieren wir zum Beispiel auf dem Zielhost mit einem Blick in die betreffenden Konfigurationsdateien, mit Hilfe der Option <strong><code>-t</code></strong> beim jeweiligen kea-binarys, oder mit Hilfe der <strong><code>status</code></strong>-Abfrage des betreffenden Kea-Daemons. </p> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong>kea-dhcp4</strong> <pre class="code"> # bat /etc/kea/kea-dhcp4.conf</pre> <pre class="code"> # kea-dhcp4 -t /etc/kea/kea-dhcp4.conf</pre> <pre class="code"> # systemctl status kea-dhcp4</pre> </div> </li> <li class="level1"><div class="li"> <strong>kea-dhcp6</strong> <pre class="code"> # bat /etc/kea/kea-dhcp6.conf</pre> <pre class="code"> # kea-dhcp6 -t /etc/kea/kea-dhcp6.conf</pre> <pre class="code"> # systemctl status kea-dhcp6</pre> </div> </li> </ul> </div> <h1 class="sectionedit36 page-header pb-3 mb-4 mt-5" id="links">Links</h1> <div class="level1"> <ul class=" fix-media-list-overlap"> <li class="level1"><div class="li"> <strong><a href="/doku.php/linux:ansible:detail" class="wikilink1" title="linux:ansible:detail" data-wiki-id="linux:ansible:detail">zurück zum Kapitel "Ansible - Erweiterte Konfigurationsbeispiele"</a> ⇐ </strong></div> </li> <li class="level1"><div class="li"> <strong>⇒ <a href="/doku.php/linux:dhcpd" class="wikilink1" title="linux:dhcpd" data-wiki-id="linux:dhcpd">weiter zum Kapitel "DNS Server für IPv4|6 unter Arch Linux einrichten und nutzen"</a> ⇐ </strong></div> </li> <li class="level1"><div class="li"> <strong><a href="/doku.php/linux:start#ansible" class="wikilink1" title="linux:start" data-wiki-id="linux:start">Zurück zur "Ansible"-Übersicht</a></strong></div> </li> <li class="level1"><div class="li"> <strong><a href="/doku.php/wiki:start" class="wikilink1" title="wiki:start" data-wiki-id="wiki:start">Zurück zu >>Projekte und Themenkapitel<<</a></strong></div> </li> <li class="level1"><div class="li"> <strong><a href="http://dokuwiki.nausch.org/doku.php/" class="urlextern" target="_tab" title="http://dokuwiki.nausch.org/doku.php/" rel="ugc nofollow noopener">Zurück zur Startseite</a></strong></div> </li> </ul> </div> <hr/><div class="footnotes"> <div class="fn"><sup><a href="#fnt__1" id="fn__1" class="fn_bot">1)</a></sup> <div class="content"><strong>D</strong>ynamic <strong>H</strong>ost <strong>C</strong>onfiguration <strong>P</strong>rotocol</div></div> <div class="fn"><sup><a href="#fnt__2" id="fn__2" class="fn_bot">2)</a></sup> <div class="content">Bootstrap Protocol</div></div> <div class="fn"><sup><a href="#fnt__3" id="fn__3" class="fn_bot">3)</a></sup> <div class="content"><strong>P</strong>reboot e<strong>X</strong>ecution <strong>E</strong>nvironment</div></div> <div class="fn"><sup><a href="#fnt__4" id="fn__4" class="fn_bot">4)</a></sup> <div class="content"><strong>U</strong>nreliable <strong>D</strong>atagram <strong>P</strong>rotocol</div></div> <div class="fn"><sup><a href="#fnt__5" id="fn__5" class="fn_bot">5)</a></sup> <div class="content"><strong>M</strong>edia <strong>A</strong>ccess <strong>C</strong>ontrol</div></div> <div class="fn"><sup><a href="#fnt__6" id="fn__6" class="fn_bot">6)</a></sup> <div class="content"><strong>R</strong>outer <strong>A</strong>dvertisement</div></div> <div class="fn"><sup><a href="#fnt__7" id="fn__7" class="fn_bot">7)</a></sup> <div class="content"><strong>D</strong>uplicate <strong>A</strong>ddress <strong>D</strong>etection</div></div> <div class="fn"><sup><a href="#fnt__8" id="fn__8" class="fn_bot">8)</a></sup> , <sup><a href="#fnt__9" id="fn__9" class="fn_bot">9)</a></sup> <div class="content"><strong>L</strong>ease <strong>F</strong>ile <strong>C</strong>leanup</div></div> </div> <div class="cookielaw-banner cookielaw-bottom">Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.<button>OK</button><a href="https://de.wikipedia.org/wiki/Cookie" target="_blank">Weitere Information</a></div></div><!-- /content --></div> </div> </div> <div class="small text-right"> <span class="docInfo"> <ul class="list-inline"><li><span class="iconify text-muted" data-icon="mdi:file-document-outline"></span> <span title="linux/kea.txt">linux/kea.txt</span></li><li><span class="iconify text-muted" data-icon="mdi:calendar"></span> Zuletzt geändert: <span title="14.03.2025 13:17. ">14.03.2025 13:17. </span></li><li class="text-muted">von <bdi><img src="/lib/exe/fetch.php/user:django.png" alt="" width="16" height="16" class="img-rounded" /> <bdi>django<bdi></bdi></li></ul> </span> </div> </article> </div> </main> <footer id="dw__footer" class="dw-container py-5 dokuwiki container-fluid"> <!-- footer --> <div class="dw-container small container-fluid mx-5"> <div class="footer-dw-title"> <div class="media"> <div class="media-left"> <img src="/lib/exe/fetch.php/logo.png" alt="Linux - Wissensdatenbank" class="media-object" style="height:32px" /> </div> <div class="media-body"> <div class="row"> <div class="col-sm-2"> <h4 class="media-heading">Linux - Wissensdatenbank</h4> <p> </p> </div> <div class="col-sm-10"> </div> </div> </div> </div> </div> <div class="footer-license row"> <hr/> <div id="dw__license" class="col-sm-6"> <p> <a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de" title="CC Attribution-Share Alike 4.0 International" target="_tab" itemscope itemtype="http://schema.org/CreativeWork" itemprop="license" rel="license" class="license"><img src="/lib/tpl/bootstrap3/images/license/cc.png" width="24" height="24" alt="cc" /> <img src="/lib/tpl/bootstrap3/images/license/by.png" width="24" height="24" alt="by" /> <img src="/lib/tpl/bootstrap3/images/license/sa.png" width="24" height="24" alt="sa" /> </a> </p> <p class="small"> Falls nicht anders bezeichnet, ist der Inhalt dieses Wikis unter der folgenden Lizenz veröffentlicht:<br/><a href="https://creativecommons.org/licenses/by-sa/4.0/deed.de" title="CC Attribution-Share Alike 4.0 International" target="_tab" itemscope itemtype="http://schema.org/CreativeWork" itemprop="license" rel="license" class="license">CC Attribution-Share Alike 4.0 International</a> </p> </div> <div class="col-sm-6"> <!-- badges --> <div class="text-right"> <ul id="dw__badges" class="list-inline hidden-print"> <li> <a href="https://www.dokuwiki.org/template:bootstrap3" title="Bootstrap template for DokuWiki" target="_tab"> <img src="/lib/tpl/bootstrap3/images/bootstrap.png" width="20" alt="Bootstrap template for DokuWiki" /> </a> </li> <li> <a href="https://www.php.net" title="Powered by PHP" target="_tab"> <img src="/lib/tpl/bootstrap3/images/php.png" width="20" alt="Powered by PHP" /> </a> </li> <li> <a href="http://validator.w3.org/check/referer" title="Valid HTML5" target="_tab"> <img src="/lib/tpl/bootstrap3/images/html5.png" width="20" alt="Valid HTML5" /> </a> </li> <li> <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3" title="Valid CSS" target="_tab"> <img src="/lib/tpl/bootstrap3/images/css3.png" width="20" alt="Valid CSS" /> </a> </li> <li> <a href="https://www.dokuwiki.org/" title="Driven by DokuWiki" target="_tab"> <img src="/lib/tpl/bootstrap3/images/logo.png" width="20" alt="Driven by DokuWiki" /> </a> </li> </ul> </div> <!-- /badges --> </div> </div> </div> <!-- /footer --> </footer> <a href="#dokuwiki__top" class="back-to-top hidden-print btn btn-default" title="zum Inhalt springen" accesskey="t"> <span class="iconify" data-icon="mdi:chevron-up"></span> </a> <div id="screen__mode"> <span class="visible-xs-block"></span> <span class="visible-sm-block"></span> <span class="visible-md-block"></span> <span class="visible-lg-block"></span> </div> <img src="/lib/exe/taskrunner.php?id=linux%3Akea&1743792711" width="2" height="1" alt="" /> </div> </body> </html>