8 open NAMES, "switches.txt"
9 or die "switches.txt: $!";
12 /194\.0\.(\d+\.\d+)\s+(\d+)\s+(\S+)/ or next;
19 # Autogenerated by make-dhcpd.pl. Do not edit manually!
21 option domain-name "tg06.gathering.org";
22 option domain-name-servers 194.0.254.2;
24 # ddns-update-style none;
25 ddns-update-style interim;
27 # extra logging for option 82
28 if exists agent.circuit-id
33 "option-82 info for ", binary-to-ascii (16, 8, ":", hardware),
34 ": interface ", binary-to-ascii (10, 8, "/", suffix ( option agent.circuit-id, 2)),
35 ", VLAN ", binary-to-ascii (10, 16, "", substring( option agent.circuit-id, 2, 2)),
36 ", switch '", substring( option agent.remote-id, 2, 6),
37 "', port-name '", substring ( option agent.circuit-id, 2, extract-int ( substring ( option agent.circuit-id, 3, 1 ), 8 ) ),
43 # dnssec-keygen -a HMAC-MD5 -b 128 -n HOST DHCP_UPDATER
45 algorithm HMAC-MD5.SIG-ALG.REG.INT;
46 secret 5Yz1azvh7mE0IRGffTvtKg==;
49 default-lease-time 14400;
53 subnet 194.0.254.0 netmask 255.255.255.0 {
57 subnet 194.0.255.0 netmask 255.255.255.0 {
60 zone 0.194.in-addr.arpa. {
68 my $domain = $netnames{$net};
70 my ($netmask, $numpc);
71 if ($netmasks{$net} == 24) {
72 $netmask = "255.255.255.0";
74 } elsif ($netmasks{$net} == 25) {
75 $netmask = "255.255.255.128";
77 } elsif ($netmasks{$net} == 26) {
78 $netmask = "255.255.255.192";
81 die "Unknown netmask /$netmasks{$net}";
84 $net =~ /(\d+)\.(\d+)/ or die "Unknown net $net";
85 my ($majorsubnet,$minorsubnet) = ($1,$2);
87 my $gw = "194.0.$majorsubnet." . ($minorsubnet + 1);
88 my $rangestart = "194.0.$majorsubnet." . ($minorsubnet + 10);
89 my $rangeend = "194.0.$majorsubnet." . ($minorsubnet + $numpc - 2);
91 if ($domain =~ /^split:(.*)/) {
92 my @domains = split /,/, $1;
93 for my $d (@domains) {
95 zone $d.tg06.gathering.org. {
102 subnet 194.0.$net netmask $netmask {
107 my $numpc_sub = int($numpc / scalar(@domains));
108 for my $d (@domains) {
111 match if substring ( option agent.circuit-id, 2, extract-int ( substring ( option agent.circuit-id, 3, 1 ), 8 ) ) = "$d";
117 for my $d (@domains) {
118 my $rangestart = "194.0.$majorsubnet." . ($minorsubnet + $i * $numpc_sub + 10);
119 my $rangeend = "194.0.$majorsubnet." . ($minorsubnet + $i * $numpc_sub + $numpc_sub - 2);
123 allow members of "$d";
124 range $rangestart $rangeend;
125 option domain-name "$d.tg06.gathering.org";
126 ddns-domainname "$.tg06.gathering.org";
127 ignore client-updates;
134 zone $domain.tg06.gathering.org. {
138 subnet 194.0.$net netmask $netmask {
142 range $rangestart $rangeend;
143 option domain-name "$domain.tg06.gathering.org";
144 ddns-domainname "$domain.tg06.gathering.org";
145 ignore client-updates;
149 # if ($net eq '250.0') {
152 # hardware ethernet 00:0e:0c:36:a7:66;
153 # filename "/pxelinux.0";
154 # next-server 194.0.254.89;