Skip to content

Commit

Permalink
Merge pull request #492 from socallinuxexpo/owen_19x_patch10
Browse files Browse the repository at this point in the history
[READY] Multiple updates
  • Loading branch information
sarcasticadmin authored Jul 29, 2022
2 parents ffa7e8b + 3c11743 commit c01db16
Show file tree
Hide file tree
Showing 16 changed files with 188 additions and 144 deletions.
2 changes: 1 addition & 1 deletion switch-configuration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lint: .lint
../facts/secrets/jroot_pw:
echo "$(JROOT_SECRET)" > ../facts/secrets/jroot_pw

.secrets: .lint ../facts/secrets/jroot_pw
.secrets: .lint ../facts/secrets/jroot_pw ../facts/keys/*
echo "Using $JROOT_SECRET as secret"
touch .secrets

Expand Down
4 changes: 4 additions & 0 deletions switch-configuration/config/scripts/build_switch_configs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@
}
foreach $file (@outputs)
{
open TMP, ">>$file";
close TMP;
unlink($file) || die "Failed to delete $file: $!\n";
debug(3, "Deleted $file from output directory\n");
}
foreach $file (@maps)
{
open TMP, ">>$file";
close TMP;
unlink($file) || die "Failed to delete $file: $!\n";
debug(3, "Deleted $file from output directory\n");
}
Expand Down
8 changes: 4 additions & 4 deletions switch-configuration/config/scripts/bulk_local_load_switches
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ EOF
if ($opt_l) # If -l is specified, install configuration via directly attached management port
{
my $result;
if($result = system("scp \"output/$Name.conf\" admin\@$IP".":/tmp/new_config.conf"))
if($result = system("scp \"output/$Name.conf\" owen\@$IP".":/tmp/new_config.conf"))
{
while ($result == 1 || $result == 256)
{
# Connection error, probably switch isn't fully online
print STDERR "Switch didn't accept SCP, retrying in 5 seconds.\n";
sleep 5;
$result = system("scp \"output/$Name.conf\" admin\@$IP".":/tmp/new_config.conf");
$result = system("scp \"output/$Name.conf\" owen\@$IP".":/tmp/new_config.conf");
}
if ($result)
{
Expand All @@ -182,11 +182,11 @@ EOF
print STDERR "Activating...\n";
if ($opt_l) # If -l is specified, activate configuration via directly attached management port
{
open(JUNIPER, "| ssh admin\@$IP");
open(JUNIPER, "| ssh owen\@$IP");
}
else
{
open(JUNIPER, "| ssh admin\@$Name");
open(JUNIPER, "| ssh owen\@$Name");
}
print JUNIPER $SWITCH_COMMANDS;
print STDERR "Finished sending commands to switch...\n";
Expand Down
9 changes: 7 additions & 2 deletions switch-configuration/config/scripts/override_switches
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,14 @@ if ($opt_i)
my %errors=();
foreach my $switch (@list)
{
my ($Name, $Num, $MgtVL, $IPv6Addr, $Type);
my ($Name, $Num, $MgtVL, $IPv6Addr, $Type, $hierarchy);
print "Looking up switch $switch\n";
($Name, $Num, $MgtVL, $IPv6Addr, $Type) = (get_switchtype($switch));
($Name, $Num, $MgtVL, $IPv6Addr, $Type, $hierarchy) = (get_switchtype($switch));
if ($hierarchy =~ /^Z/)
{
print STDERR "Skipping switch $Name in hierarchy $hierarchy.\n";
next;
}
die("Error: Couldn't get type for $switch (got $Name)\n") unless $Name eq $switch;
print "Got Entry: $Name, $Num, $MgtVL, $IPv6Addr, $Type for $switch\n";

Expand Down
71 changes: 51 additions & 20 deletions switch-configuration/config/scripts/switch_template.pl
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,17 @@ sub VV_init_firewall
my $VV_firewall = <<EOF;
family inet {
filter only_to_internet {
term ping {
from {
destination-address {
10.0.0.0/8;
}
protocol icmp;
}
then {
accept;
}
}
term dns {
from {
destination-address {
Expand Down Expand Up @@ -937,20 +948,31 @@ sub VV_init_firewall
term dns {
from {
destination-address {
2001:470:f325:103::/64;
2001:470:f325:503::/64;
2001:470:f0fb:103::/64;
2001:470:f0fb:503::/64;
}
destination-port domain;
}
then {
accept;
}
}
term ping {
from {
destination-address {
2001:470:f0fb::/48
}
icmp-type [ echo-reply echo-request packet-too-big time-exceeded ];
}
then {
accept;
}
}
term dhcp {
from {
destination-address {
2001:470:f325:103::/64;
2001:470:f325:503::/64;
2001:470:f0fb:103::/64;
2001:470:f0fb:503::/64;
}
destination-port [ bootps dhcp ];
}
Expand All @@ -961,7 +983,7 @@ sub VV_init_firewall
term no-local {
from {
destination-address {
2001:470:f325::/48;
2001:470:f0fb::/48;
fc00::/7;
}
}
Expand All @@ -984,8 +1006,8 @@ sub VV_init_firewall
term dns {
from {
source-address {
2001:470:f325:103::/64;
2001:470:f325:503::/64;
2001:470:f0fb:103::/64;
2001:470:f0fb:503::/64;
}
source-port domain;
}
Expand All @@ -996,8 +1018,8 @@ sub VV_init_firewall
term dhcp {
from {
source-address {
2001:470:f325:103::/64;
2001:470:f325:503::/64;
2001:470:f0fb:103::/64;
2001:470:f0fb:503::/64;
}
source-port [ bootps dhcp ];
}
Expand All @@ -1008,7 +1030,7 @@ sub VV_init_firewall
term no-local {
from {
source-address {
2001:470:f325::/48;
2001:470:f0fb::/48;
fc00::/7;
}
}
Expand Down Expand Up @@ -1224,15 +1246,15 @@ sub build_vendor_from_config
}
elsif ($cmd eq "VVBB")
{
$VV_vlans = <<EOF;
$VV_vlans .= <<EOF;
vendor_backbone {
description "Vendor Backbone";
vlan-id 499;
l3-interface vlan.499;
}
EOF
my $ipv4_suffix = $VV_COUNT + 10;
$VV_vlans_l3 = <<EOF;
$VV_vlans_l3 .= <<EOF;
unit 499 {
family inet {
address 10.1.0.$ipv4_suffix/24;
Expand All @@ -1243,7 +1265,9 @@ sub build_vendor_from_config
}
# Finish up strings that need to be terminated (currently just $VV_vlans_l3)
# Finalize DHCP Forwarder configuration
my $active_srv_grp = ($MgtVL < 500) ? "Expo" : "Conference";
##FIXME## Hack for Hilton
#my $active_srv_grp = ($MgtVL < 500) ? "Expo" : "Conference";
my $active_srv_grp = ($MgtVL < 500) ? "Hilton" : "Conference";
$VV_dhcp = <<EOF;
forwarding-options {
dhcp-relay {
Expand All @@ -1264,13 +1288,16 @@ sub build_vendor_from_config
}
server-group {
Conference {
2001:470:f325:503::5;
2001:470:f0fb:503::5;
}
Expo {
2001:470:f325:103::5;
2001:470:f0fb:103::5;
}
Hilton {
2001:470:f0fb:103::5;
}
AV {
2001:470:f325:105::10;
2001:470:f0fb:105::10;
}
}
active-server-group $active_srv_grp;
Expand All @@ -1282,6 +1309,9 @@ sub build_vendor_from_config
Expo {
10.0.3.5;
}
Hilton {
10.0.3.5;
}
AV {
10.0.5.10;
}
Expand Down Expand Up @@ -1317,8 +1347,8 @@ sub build_vendor_from_config
$VV_protocols .= <<EOF;
interface $_ {
other-stateful-configuration;
dns-server-address 2001:470:f325:103::5;
dns-server-address 2001:470:f325:503::5;
dns-server-address 2001:470:f0fb:103::5;
dns-server-address 2001:470:f0fb:103::15;
prefix $pfx {
on-link;
autonomous;
Expand All @@ -1330,6 +1360,7 @@ sub build_vendor_from_config
}
ospf {
area 0.0.0.0 {
interface vlan.103;
interface vlan.499;
EOF
foreach (@VV_intlist)
Expand Down Expand Up @@ -1465,8 +1496,8 @@ sub build_config_from_template
community Junitux {
authorization read-only;
clients {
2001:470:f325:103::/64;
2001:470:f325:503::/64;
2001:470:f0fb:103::/64;
2001:470:f0fb:503::/64;
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions switch-configuration/config/switchtypes
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ SanLorenzoC 27 103 2001:470:f0fb:103::200:27 hiRoom D.9 Normal ex4200-48p 2c:
ExpoA2 28 103 2001:470:f0fb:103::200:28 hiBooth L.2 Loud ex4200-48p 00:26:88:6e:c6:ff
ExpoB2 29 103 2001:470:f0fb:103::200:29 hiBooth L.2 Loud ex4200-48p 28:c0:da:33:38:7f
SanLorenzoD 30 103 2001:470:f0fb:103::200:30 hiRoom D.9 Normal ex4200-48p 00:26:88:7e:36:7f
SpareG 31 103 2001:470:f0fb:103::200:31 hiRoom Z.9 Quiet ex4200-48p 00:26:88:7d:f5:ff
ExpoSignFront 31 103 2001:470:f0fb:103::200:31 hiRoom L.9 Quiet ex4200-48p 00:26:88:7d:f5:ff
RegDesk 32 103 2001:470:f0fb:103::200:32 hiRegistration D.9 Normal ex4200-48p 00:26:88:7a:76:ff
ExpoC2 33 103 2001:470:f0fb:103::200:33 hiBooth L.2 Normal ex4200-48p 00:26:88:7d:f8:7f
ExpoD1 34 103 2001:470:f0fb:103::200:34 hiBooth L.2 Loud ex4200-48p 00:26:88:6f:1e:7f
ExpoD2 35 103 2001:470:f0fb:103::200:35 hiBooth L.2 Loud ex4200-48p 00:19:e2:56:23:3f
ExpoE1 36 103 2001:470:f0fb:103::200:36 hiBooth L.2 Normal ex4200-48p 2c:6b:f5:39:cf:ff
SantaMonicaB 37 103 2001:470:f0fb:103::200:37 hiRoom D.9 Quiet ex4200-48p 2c:6b:f5:37:cd:7f
ExpoE2 38 103 2001:470:f0fb:103::200:38 hiBooth L.2 Normal ex4200-48p 00:26:88:7e:1b:ff
ExpoB4 39 103 2001:470:f0fb:103::200:39 hiBooth L.2 Normal ex4200-48p 00:26:88:70:d6:7f
ExpoB4 39 103 2001:470:f0fb:103::200:39 hiBooth Z.2 Normal ex4200-48p 00:26:88:70:d6:7f
SantaMonicaC 40 103 2001:470:f0fb:103::200:40 hiRoom D.9 Quiet ex4200-48p b0:c6:9a:64:85:ff
ExpoC4 41 103 2001:470:f0fb:103::200:41 hiBooth L.2 Normal ex4200-48p 00:26:88:70:bb:7f
ExpoA5 42 103 2001:470:f0fb:103::200:42 hiBooth L.2 Normal ex4200-48p 00:26:88:60:40:7f
ExpoB5 43 103 2001:470:f0fb:103::200:43 hiBooth L.2 Normal ex4200-48p 00:26:88:7d:1b:ff
ExpoSignRear 41 103 2001:470:f0fb:103::200:41 hiRoom L.2 Normal ex4200-48p 00:26:88:70:bb:7f
ExpoA5 42 103 2001:470:f0fb:103::200:42 hiBooth Z.2 Normal ex4200-48p 00:26:88:60:40:7f
ExpoB5 43 103 2001:470:f0fb:103::200:43 hiBooth Z.2 Normal ex4200-48p 00:26:88:7d:1b:ff
BelAir 44 103 2001:470:f0fb:103::200:44 hiRoom E.9 Loud ex4200-48p 00:26:88:7c:41:7f
SanLorenzoA 45 103 2001:470:f0fb:103::200:45 hiRoom D.9 Normal ex4200-48p 00:26:88:6e:b1:ff
SanLorenzoE 46 103 2001:470:f0fb:103::200:46 hiRoom D.9 Loud ex4200-48p 00:26:88:7f:0e:7f
Expand Down
1 change: 1 addition & 0 deletions switch-configuration/config/types/Booth
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ TRUNK ge-0/0/17 exInfra,exSCALE-SLOW,exSCALE-FAST,exStaff // AP
RSRVD 6
VVLAN 16 // Dynamically assigned Vendor VLAN ports
RSRVD 8
VVBB
16 changes: 8 additions & 8 deletions switch-configuration/config/types/hiAV
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// Room Switch Template -- AV Room Switch
TRUNK ge-0/0/0 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/1 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/2 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/3 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/4 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/5 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/6 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/7 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/0 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/1 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/2 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/3 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/4 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/5 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/6 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/7 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
VLAN hiSigns 4 // ge-0/0/{8-11}
VLAN hiAVLAN 36 // ge-0/0/{12-47}

25 changes: 13 additions & 12 deletions switch-configuration/config/types/hiBooth
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
// Expo Booth Area switch Template
TRUNK ge-0/0/0 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/1 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/0 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/1 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
RSRVD 6
TRUNK ge-0/0/8 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/9 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/10 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/11 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/12 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/13 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/14 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/15 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/16 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/17 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall
TRUNK ge-0/0/8 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/9 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/10 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/11 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/12 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/13 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/14 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/15 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/16 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
TRUNK ge-0/0/17 hiSCALE-SLOW,hiSCALE-FAST,hiSpeaker,hiInfra,hiAVLAN,hiSigns,hiStaff,hiRegistration,hiNOC,hiInstall,vendor_backbone
RSRVD 6
VVLAN 16 // Dynamically assigned Vendor VLAN ports
RSRVD 8
VVBB
Loading

0 comments on commit c01db16

Please sign in to comment.