]> git.sesse.net Git - nms/blobdiff - config/make-port-config.pl
Added Chillout.
[nms] / config / make-port-config.pl
index 4ab50026d6651151ce76e2d52a94b06f8c2d6aa7..6b3ba3319143df16aff25fa37809cf3a580bae5a 100755 (executable)
@@ -1,7 +1,8 @@
 #! /usr/bin/perl
 open PATCHLIST, "<patchlist.txt"
        or die "patchlist.txt: $!";
-my %distros = ();
+my %vlans = ();
+my %ports = ();
 
 while (<PATCHLIST>) {
        chomp;
@@ -28,23 +29,27 @@ while (<PATCHLIST>) {
        my $vlan = "$row$switch";
        my $ipv6 = sprintf "F%02u%u", $row, $switch;
 
-       $distros{$distro} .= <<"EOF";
+       $vlans{$distro} .= <<"EOF";
 vlan $vlan
   name $name
 !
+EOF
+       $ports{$distro} .= <<"EOF";
 default interface vlan $vlan
 interface vlan $vlan
   description $name
   ip address $ip 255.255.255.192
-  ip directed-broadcast 10
+  ip directed-broadcast 101
   ip helper-address 87.76.254.2
   no ip proxy-arp
   ip access-group great-wall-of-tg in
   ipv6 address 2001:16D8:FFFF:${ipv6}::1/64
-  ip igmp version 3
+  ip igmp version 2
+  ip pim sparse-mode
   no shutdown
+  exit
 !
 default interface $port
 interface $port
  description $name
@@ -56,14 +61,20 @@ interface $port
 
  storm-control broadcast level 2
  no shutdown
+ exit
 !
 EOF
 }
 
-for my $distro (keys %distros) {
+for my $distro (keys %vlans) {
        open DISTRO, ">$distro-config"
                or die "$distro-config: $!";
-       print DISTRO $distros{$distro};
+       print DISTRO <<"EOF";
+access-list 101 remark ip directed broadcast
+access-list 101 permit ip any any dscp cs7
+EOF
+       print DISTRO $vlans{$distro};
+       print DISTRO $ports{$distro};
        print DISTRO "end\n";
        close DISTRO;
 }