4 my $date = `date --rfc-2822`;
8 open NAMES, "switches.txt"
9 or die "switches.txt: $!";
12 /87\.76\.(\d+\.\d+)\s+(\d+)\s+(\S+)/ or next;
21 # Autogenerated by make-dhcpd.pl at $date. Do not edit manually!
23 option domain-name "tg07.gathering.org";
24 option domain-name-servers 87.76.254.2, 87.76.255.2;
27 next-server 87.76.255.18;
28 filename "/pxelinux.0";
30 ddns-update-style interim;
33 # dnssec-keygen -a HMAC-MD5 -b 128 -n HOST DHCP_UPDATER
35 algorithm HMAC-MD5.SIG-ALG.REG.INT;
36 secret F388UOhaIIKHRH9TDE5PTA==;
39 default-lease-time 14400;
43 subnet 87.76.254.0 netmask 255.255.255.0 {
47 subnet 87.76.255.0 netmask 255.255.255.0 {
48 range 87.76.255.240 87.76.255.254;
51 zone 76.87.in-addr.arpa. {
59 my $domain = $net->{name};
61 my ($netmask, $numpc);
62 if ($net->{netmask} == 24) {
63 $netmask = "255.255.255.0";
65 } elsif ($net->{netmask} == 25) {
66 $netmask = "255.255.255.128";
68 } elsif ($net->{netmask} == 26) {
69 $netmask = "255.255.255.192";
72 die "Unknown netmask /" . $net->{netmask};
75 $net->{net} =~ /(\d+)\.(\d+)/ or die "Unknown net $net";
76 my ($majorsubnet,$minorsubnet) = ($1,$2);
78 # FIXME: Should use Net::CIDR
79 my $gw = "87.76.$majorsubnet." . ($minorsubnet + 1);
80 my $rangestart = "87.76.$majorsubnet." . ($minorsubnet + 10);
81 my $rangeend = "87.76.$majorsubnet." . ($minorsubnet + $numpc - 2);
84 zone $domain.tg07.gathering.org. {
88 subnet 87.76.$net->{net} netmask $netmask {
92 range $rangestart $rangeend;
93 option domain-name "$domain.tg07.gathering.org";
94 ddns-domainname "$domain.tg07.gathering.org";
95 ignore client-updates;