Samba-ad-dc-ddns-doker/v6/dhcpd.conf

53 lines
2.1 KiB
Plaintext

#-------------------------------
# Global options
#-------------------------------
authoritative;
option dhcp6.domain-search "example.net";
option dhcp6.name-servers fdaa:aaaa:aaaa:aaaa::4;
option dhcp6.sntp-servers fdaa:aaaa:aaaa:aaaa::4;
default-lease-time 86400; # 24 hours.
max-lease-time 604800; # 7 days.
lease-file-name "/var/lib/dhcp/dhcpd.leases";
#log-facility syslog;
#-------------------------------
# Subnet
#-------------------------------
subnet6 fdaa:aaaa:aaaa:aaaa::/64 {
range6 fdaa:aaaa:aaaa:aaaa::1:0100 fdaa:aaaa:aaaa:aaaa::1:0199;
}
#-------------------------------
# Fixed address
#-------------------------------
host party {
host-identifier option dhcp6.client-id 00:03:00:01:00:0c:29:14:6e:24;
fixed-address6 fdaa:aaaa:aaaa:aaaa::12;
on commit { execute("/usr/local/bin/dhcp-dyndns.sh", "add", "fdaa:aaaa:aaaa:aaaa::12", "no", "party", "-IPv6-"); }
on release { execute("/usr/local/bin/dhcp-dyndns.sh", "delete", "fdaa:aaaa:aaaa:aaaa::12", "no", "party", "-IPv6-"); }
on expiry { execute("/usr/local/bin/dhcp-dyndns.sh", "delete", "fdaa:aaaa:aaaa:aaaa::12", "no", "party", "-IPv6-"); }
}
host work {
host-identifier option dhcp6.client-id 00:03:00:01:00:0c:29:0a:83:af;
fixed-address6 fdaa:aaaa:aaaa:aaaa::3;
on commit { execute("/usr/local/bin/dhcp-dyndns.sh", "add", "fdaa:aaaa:aaaa:aaaa::3", "no", "work", "-IPv6-"); }
on release { execute("/usr/local/bin/dhcp-dyndns.sh", "delete", "fdaa:aaaa:aaaa:aaaa::3", "no", "work", "-IPv6-"); }
on expiry { execute("/usr/local/bin/dhcp-dyndns.sh", "delete", "fdaa:aaaa:aaaa:aaaa::3", "no", "work", "-IPv6-"); }
}
#-------------------------------
# Dynamic DNS
#-------------------------------
on commit {
set ClientIP = binary-to-ascii(16, 16, ":", substring(option dhcp6.ia-na, 16, 16));
set ClientName = option fqdn.hostname;
execute("/usr/local/bin/dhcp-dyndns.sh", "add", ClientIP, "no", ClientName, "-IPv6-");
}
on release { execute("/usr/local/bin/dhcp-dyndns.sh", "delete", ClientIP, "no", ClientName, "-IPv6-"); }
on expiry { execute("/usr/local/bin/dhcp-dyndns.sh", "delete", ClientIP, "no", ClientName, "-IPv6-"); }