KEA DHCP DDNS Netzwerk und Serveradministration

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen

Auf unserem Nameserver

Key erzeugen
  • cd /etc/bind
  • tsig-keygen -a HMAC-SHA256 it213.key >> /etc/bind/named.conf.local
Keys zuweisen
  • cat /etc/bind/named.conf.local
//tsig-keygen -a HMAC-SHA256 it213.key 
key "it213.key" {
    algorithm hmac-sha256;
    secret "Y8zioRKf3L0lWlhZ5FReSdegcnWVD53IIqT9PPle5cU=";
}; 

zone "it213.int" {
    type master;
    file "/var/cache/bind/it213.int";
    allow-update { key "it213.key"; };
}; 

zone "213.88.10.in-addr.arpa" {
    type master;
    file "/var/cache/bind/213.88.10.in-addr.arpa";
    allow-update { key "it213.key"; };
}; 

zone "213.26.172.in-addr.arpa" {
    type master;
    file "/var/cache/bind/213.26.172.in-addr.arpa";
    allow-update { key "it213.key"; };
};
Name neustarten
  • systemctl restart named

Auf dem Kea Server

Wenn noch nicht geschehen installation de ddns servers
  • sudo apt update
  • sudo apt install kea-dhcp-ddns-server
kea-dhcp4.conf anpassen.
  • cat 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"
    },
    "dhcp-ddns": {
      "enable-updates": true,
      "server-ip": "127.0.0.1",
      "server-port": 53001
    },
    "ddns-send-updates": true,
    "ddns-override-no-update": true,
    "ddns-override-client-update": true,
    "ddns-update-on-renew": true,
    "ddns-qualifying-suffix": "it213.int",
    "valid-lifetime": 7200,
    "option-data": [
      { "name": "domain-name-servers", "data": "10.88.213.21" },
      { "name": "domain-name", "data": "it213.int" },
      { "name": "domain-search", "data": "it213.int" }
    ],
    "subnet4": [
      {
        "id": 1,
        "subnet": "172.26.213.0/24",
        "pools": [ { "pool": "172.26.213.100 - 172.26.213.200" } ],
        "option-data": [ { "name": "routers", "data": "172.26.213.1" } ],
        "reservations": [
          {
            "hw-address": "08:00:27:5d:76:5d",
            "ip-address": "172.26.213.99",
            "hostname": "client"
          }
        ]
      },
      {
        "id": 2,
        "subnet": "10.88.213.0/24",
        "pools": [ { "pool": "10.88.213.50 - 10.88.213.100" } ],
        "option-data": [ { "name": "routers", "data": "10.88.213.1" } ]
      },
      {
        "id": 3,
        "subnet": "10.213.1.0/24",
        "pools": [ { "pool": "10.213.1.50 - 10.213.1.100" } ],
        "option-data": [ { "name": "routers", "data": "10.213.1.1" } ]
      }
    ],
    "loggers": [
      {
        "name": "kea-dhcp4",
        "output_options": [ { "output": "/var/log/kea/kea-dhcp4.log" } ],
        "severity": "DEBUG",
        "debuglevel": 99
      }
    ]
  }
}