KEA DHCP NTP-Konfiguration - Netzwerk und Serveradministration
Zur Navigation springen
Zur Suche springen
NTP-Server via Kea DHCP verteilen
Übersicht
Kea DHCP kann NTP-Server-Informationen an DHCP-Clients verteilen. Dies ermöglicht eine zentrale Zeitserver-Konfiguration für alle Netzwerkgeräte.
DHCP-Option für NTP
- Option 42 (DHCPv4): NTP Servers
- Format: Liste von IPv4-Adressen
Konfiguration
Globale NTP-Konfiguration
NTP-Server für alle Subnetze:
- sudo vim /etc/kea/kea-dhcp4.conf
{
"Dhcp4": {
"interfaces-config": {
"interfaces": [ "enp0s3" ]
},
"control-socket": {
"socket-type": "unix",
"socket-name": "/run/kea/kea4-ctrl-socket"
},
"lease-database": {
"type": "memfile",
"persist": true,
"name": "/var/lib/kea/kea-leases4.csv"
},
"valid-lifetime": 7200,
"option-data": [
{ "name": "domain-name-servers", "data": "10.88.2XX.21" },
{ "name": "domain-name", "data": "it2XX.int" },
{ "name": "domain-search", "data": "it2XX.int" },
{ "name": "ntp-servers", "data": "ntp.it2XX.int" }
],
"subnet4": [
{
"id": 1,
"subnet": "172.26.2XX.0/24",
"pools": [ { "pool": "172.26.2XX.100 - 172.26.2XX.200" } ],
"option-data": [ { "name": "routers", "data": "172.26.2XX.1" } ],
"reservations": [
{ "hw-address": "08:00:27:5d:76:5d", "ip-address": "172.26.2XX.99", "hostname": "client" }
]
},
{
"id": 2,
"subnet": "10.88.2XX.0/24",
"pools": [ { "pool": "10.88.2XX.50 - 10.88.2XX.100" } ],
"option-data": [ { "name": "routers", "data": "10.88.2XX.1" } ]
},
{
"id": 3,
"subnet": "10.2XX.1.0/24",
"pools": [ { "pool": "10.2XX.1.50 - 10.2XX.1.100" } ],
"option-data": [ { "name": "routers", "data": "10.2XX.1.1" } ]
}
],
"loggers": [
{
"name": "kea-dhcp4",
"output_options": [ { "output": "/var/log/kea/kea-dhcp4.log" } ],
"severity": "INFO"
}
]
}
}
Dienst neu starten
- Konfiguration testen
- sudo kea-dhcp4 -t /etc/kea/kea-dhcp4.conf
- Dienst neu starten
- sudo systemctl restart kea-dhcp4-server
- Status prüfen
- sudo systemctl status kea-dhcp4-server
Überprüfung auf dem Client
Linux Client
- DHCP-Informationen anzeigen
- cat /var/lib/dhcp/dhclient.leases
oder
- ip addr show
- NTP-Status prüfen (wenn systemd-timesyncd verwendet wird)
- timedatectl status
Erwartete Ausgabe:
Local time: Mo 2025-10-20 15:30:45 CET
Universal time: Mo 2025-10-20 13:30:45 UTC
RTC time: Mo 2025-10-20 13:30:45
Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
- Konfigurierte NTP-Server anzeigen
- timedatectl show-timesync --all
Windows Client
- PowerShell als Administrator öffnen
- ipconfig /all
Im Output nach "DHCP-Server" und unter "Optionen" suchen.
- NTP-Konfiguration prüfen
- w32tm /query /status