diff options
Diffstat (limited to 'bootstrap/make-dhcpd6.pl')
-rwxr-xr-x | bootstrap/make-dhcpd6.pl | 79 |
1 files changed, 56 insertions, 23 deletions
diff --git a/bootstrap/make-dhcpd6.pl b/bootstrap/make-dhcpd6.pl index e27e0f4..328190a 100755 --- a/bootstrap/make-dhcpd6.pl +++ b/bootstrap/make-dhcpd6.pl @@ -15,20 +15,13 @@ $base = $ARGV[0] if $#ARGV > -1; $base .= "/" if not $base =~ m/\/$/ and not $base eq ""; my $dhcpd_base = $base . "dhcp/"; -my $dhcpd_conf = $dhcpd_base . "dhcpd.conf"; +my $dhcpd_conf = $dhcpd_base . "dhcpd6.conf"; my $dhcpd_pxeconf = $dhcpd_base . "v6-pxe-boot.conf"; my $dhcpd_wlc_conf = $dhcpd_base . "v6-wlc.conf"; my $dhcpd_voip_conf = $dhcpd_base . "v6-voip.conf"; -# primary -my $pri_range = Net::IP->new($nms::config::pri_net) or die ("pri_range fail"); -my $pri_mask = $pri_range->mask(); -my $pri_net = $pri_range->ip(); - -# secondary -my $sec_range = Net::IP->new($nms::config::sec_net) or die ("sec_range fail"); -my $sec_mask = $sec_range->mask(); -my $sec_net = $sec_range->ip(); +my $sec_net = Net::IP->new($nms::config::sec_net_v6)->short(); +my ($sec_first, $sec_last) = ("5000", "9999"); # Create PXE-boot configuration file for DHCP if ( not -f $dhcpd_conf ) @@ -37,26 +30,66 @@ if ( not -f $dhcpd_conf ) open DHCPDFILE, ">" . $dhcpd_conf or die ( $! . " " . $dhcpd_conf); print DHCPDFILE <<"EOF"; -# GENERATED BY make-dhcpd.pl -# -# Central concept: as little config in the main .conf, -# include almost everything from separate files.. -# -# log-facility local7; -option domain-name "$nms::config::tgname.gathering.org"; -option domain-name-servers $nms::config::pri_v4, $nms::config::sec_v4; -default-lease-time 3600; -max-lease-time 7200; +# GENERATED BY make-dhcpd6.pl + +# IPv6 address valid lifetime +# (at the end the address is no longer usable by the client) +# (set to 30 days, the usual IPv6 default) +default-lease-time 2592000; + +# IPv6 address preferred lifetime +# (at the end the address is deprecated, i.e., the client should use +# other addresses for new connections) +# (set to 7 days, the usual IPv6 default) +preferred-lifetime 604800; + +# T1, the delay before Renew +# (default is 1/2 preferred lifetime) +# (set to 1 hour) +option dhcp-renewal-time 3600; + +# T2, the delay before Rebind (if Renews failed) +# (default is 3/4 preferred lifetime) +# (set to 2 hours) +option dhcp-rebinding-time 7200; + +# Enable RFC 5007 support +allow leasequery; + +# Set preference to 255 (maximum) in order to avoid waiting for +# additional servers when there is only one +option dhcp6.preference 255; + +# Server side command to enable rapid-commit (2 packet exchange) +option dhcp6.rapid-commit; + +# The delay before information-request refresh +# (minimum is 10 minutes, maximum one day, default is to not refresh) +# (set to 6 hours) +option dhcp6.info-refresh-time 21600; + +# Don't let clients set their own FQDN +ignore client-updates; + +# disable ddns +ddns-update-style none; + +# make server authorative authoritative; -ddns-update-style interim; +# Global definitions for name server address(es) and domain search list +option domain-name "$nms::config::tgname.gathering.org"; +option domain-name-servers $nms::config::pri_v6, $nms::config::sec_v6; + key DHCP_UPDATER { algorithm HMAC-MD5.SIG-ALG.REG.INT; secret $nms::config::ddns_key; } -subnet $pri_net netmask $pri_mask {} -subnet $sec_net netmask $sec_mask {} +subnet6 $nms::config::pri_net_v6 {} +subnet6 $nms::config::sec_net_v6 { + range6 ${sec_net}${sec_first} ${sec_net}${sec_last}; +} include "/etc/dhcp/v6-generated-include.conf"; include "$dhcpd_pxeconf"; |