aboutsummaryrefslogtreecommitdiffstats
path: root/dlink-ng/make-dlink-config.pl
diff options
context:
space:
mode:
Diffstat (limited to 'dlink-ng/make-dlink-config.pl')
-rwxr-xr-xdlink-ng/make-dlink-config.pl71
1 files changed, 0 insertions, 71 deletions
diff --git a/dlink-ng/make-dlink-config.pl b/dlink-ng/make-dlink-config.pl
deleted file mode 100755
index 7a20820..0000000
--- a/dlink-ng/make-dlink-config.pl
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/usr/bin/perl -I /root/tgmanage/
-use strict;
-use warnings;
-use lib '..';
-BEGIN {
- require "include/config.pm";
- eval {
- require "include/config.local.pm";
- };
-}
-
-unless (@ARGV > 0) {
- print "No arguments. Need switches.txt and patchlist.txt.\n";
- exit 1;
-}
-
-my $s = open(SWITCHES, "$ARGV[0]") or die ("Cannot open switches.txt");
-my $p = open(PATCH, "$ARGV[1]") or die ("Cannot open patchlist.txt");
-
-my $portchannel_start = 10;
-my %portchannels;
-my $letter = "a";
-
-my %switches;
-while(<SWITCHES>) {
- chomp;
- my ($network, $netmask, $switchname, $mngmt_ip) = split; # $mngmt_ip is unused
- $switches{$switchname} = {
- network => $network,
- netmask => $netmask,
- };
-}
-while (<PATCH>) {
- chomp;
- my ($switchname, $coregw, @ports) = split;
- my $network = $switches{$switchname}{network};
- my $netmask = $switches{$switchname}{netmask};
- my ($o1, $o2, $o3, $o4) = split(/\./, $network);
-
- # portchannel per distro
- if($coregw =~ m/distro0/){
- # TG14-fix for distro0
- $portchannels{$coregw} = 15 unless ($portchannels{$coregw} && defined($portchannels{$coregw}));
- } else {
- $portchannels{$coregw} = $portchannel_start unless ($portchannels{$coregw} && defined($portchannels{$coregw}));
- }
-
- if ($o4 eq "0") {
- $letter = "a";
- } elsif ($o4 eq "64") {
- $letter = "b";
- } elsif ($o4 eq "128") {
- $letter = "c";
- } elsif ($o4 eq "192") {
- $letter = "d";
- }
-
- my $v6addr = $nms::config::base_ipv6net . $o3 . $letter ."::1/64";
-
- $o4 += 1;
- my $gateway_addr = "$o1.$o2.$o3.$o4";
- $o4 += 1;
- my $switch_addr = "$o1.$o2.$o3.$o4";
-
- print "$switchname $coregw $portchannels{$coregw} $network/$netmask $switch_addr $gateway_addr $v6addr " . join(' ', @ports) . "\n";
-
- # increase portchannel
- $portchannels{$coregw}++;
-
- die("NO MORE ETHERCHANNELS!") if($portchannels{$coregw} > 64); # IOS-XE 4500 only supports 64 portchannels
-}