Installation
vmls4:
sudo apt update
sudo apt -y install isc-dhcp-server
Konfiguration DHCP
vmls4:
/etc/dhcp/dhcpd.conf:
...
option domain-name "smartlearn.lan.";
option domain-name-servers ns.smartlearn.dmz;
authoritative;
subnet 192.168.210.0 netmask 255.255.255.0 {
range 192.168.210.100 192.168.210.110;
option domain-name-servers 192.168.220.13;
option domain-name "smartlearn.lan.";
option domain-search "smartlearn.lan", "smartlearn.dmz";
option subnet-mask 255.255.255.0;
option routers 192.168.210.1;
default-lease-time 120;
max-lease-time 300;
}
host vmls5 {
hardware ethernet 00:50:56:00:24:33;
fixed-address 192.168.210.65;
option host-name "vmls5";
}
...
Neustart der Dienste
vmls4:
sudo systemctl restart isc-dhcp-server
Konfiguration DDNS
Generation vom rndc key
vmls3:
sudo rndc-confgen -a -b 512
sudo cp /etc/bind/rndc.key ~/rndc.key # Vorbereitung für scp
sudo chown vmadmin:vmadmin ~/rndc.key # Vorbereitung für scp
Generiert eine Datei /etc/bind/rndc.key.
Anpassung DNS Update
vmls3: /etc/bind/named.conf.local:
...
include "/etc/bind/rndc.key";
...
zone "smartlearn.lan" IN {
...
allow-update {
key "rndc-key";
};
};
zone "210.168.192.in-addr.arpa" IN {
...
allow-update {
key "rndc-key";
};
};
...
Anpassung DNS Zone
vmls3: /etc/bind/db.lan.smartlearn:
...
;vmwp1 IN A 192.168.210.11
...
;vmlp1 IN A 192.168.210.31
...
;vmls5 IN A 192.168.210.65
...
Anpassung DNS
Verschieben der DNS Zonen
vmls3:
sudo cp /etc/bind/db.lan.smartlearn /etc/bind/db.lan.smartlearn.bak
sudo cp /etc/bind/db.168.210 /etc/bind/db.168.210.bak
sudo mv /etc/bind/db.lan.smartlearn /var/cache/bind/
sudo mv /etc/bind/db.168.210 /var/cache/bind/
sudo chown root:bind /var/cache/bind/db.lan.smartlearn
sudo chown root:bind /var/cache/bind/db.168.210
Zonenpfade anpassen
vmls3: /etc/bind/named.conf.local:
...
zone "smartlearn.lan" IN {
...
file "/var/cache/bind/db.lan.smartlearn";
...
};
zone "210.168.192.in-addr.arpa" IN {
...
file "/var/cache/bind/db.168.210";
...
};
...
Übertragung rndc key
vmls4:
sudo scp vmadmin@vmls3:~/rndc.key /etc/dhcp/ddns-keys/rndc.key
Anpassung DHCP
vmls4: /etc/dhcp/dhcpd.conf:
...
ddns-update-style standard;
ddns-updates on;
ignore client-updates;
update-static-leases on;
...
include "/etc/dhcp/ddns-keys/rndc.key";
...
zone smartlearn.lan. {
primary vmls3.smartlearn.dmz.;
key rndc-key;
}
zone 210.168.192.in-addr.arpa. IN {
primary vmls3.smartlearn.dmz.;
key rndc-key;
}
...
Neustart der Dienste
vmls3:
sudo systemctl restart apparmor
sudo systemctl restart named
vmls4:
sudo systemctl restart isc-dhcp-server
Test
sudo apt update
sudo apt -y install dhcpcd5
sudo dhcpcd -T eth0
sudo journalctl -u isc-dhcp-server -f -n 100 # Server
cat /var/lib/dhcp/dhcpd.leases # Server
cat /var/lib/dhcp/dhclient.leases # Client