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 ) ),
44 algorithm HMAC-MD5.SIG-ALG.REG.INT;
48 default-lease-time 14400;
52 subnet 194.0.254.0 netmask 255.255.255.0 {
56 subnet 194.0.255.0 netmask 255.255.255.0 {
59 zone 0.194.in-addr.arpa. {
67 my $domain = $netnames{$net};
69 my ($netmask, $numpc);
70 if ($netmasks{$net} == 24) {
71 $netmask = "255.255.255.0";
73 } elsif ($netmasks{$net} == 25) {
74 $netmask = "255.255.255.128";
76 } elsif ($netmasks{$net} == 26) {
77 $netmask = "255.255.255.192";
80 die "Unknown netmask /$netmasks{$net}";
83 $net =~ /(\d+)\.(\d+)/ or die "Unknown net $net";
84 my ($majorsubnet,$minorsubnet) = ($1,$2);
86 my $gw = "194.0.$majorsubnet." . ($minorsubnet + 1);
87 my $rangestart = "194.0.$majorsubnet." . ($minorsubnet + 10);
88 my $rangeend = "194.0.$majorsubnet." . ($minorsubnet + $numpc - 2);
90 if ($domain =~ /^split:(.*)/) {
91 my @domains = split /,/, $1;
92 for my $d (@domains) {
94 zone $d.tg06.gathering.org. {
101 subnet 194.0.$net netmask $netmask {
106 my $numpc_sub = int($numpc / scalar(@domains));
107 for my $d (@domains) {
110 match if substring ( option agent.circuit-id, 2, extract-int ( substring ( option agent.circuit-id, 3, 1 ), 8 ) ) = "$d";
116 for my $d (@domains) {
117 my $rangestart = "194.0.$majorsubnet." . ($minorsubnet + $i * $numpc_sub + 10);
118 my $rangeend = "194.0.$majorsubnet." . ($minorsubnet + $i * $numpc_sub + $numpc_sub - 2);
122 allow members of "$d";
123 range $rangestart $rangeend;
124 option domain-name "$d.tg06.gathering.org";
125 ddns-domainname "$.tg06.gathering.org";
126 ignore client-updates;
133 zone $domain.tg06.gathering.org. {
137 subnet 194.0.$net netmask $netmask {
141 range $rangestart $rangeend;
142 option domain-name "$domain.tg06.gathering.org";
143 ddns-domainname "$domain.tg06.gathering.org";
144 ignore client-updates;
148 # if ($net eq '250.0') {
151 # hardware ethernet 00:0e:0c:36:a7:66;
152 # filename "/pxelinux.0";
153 # next-server 194.0.254.89;