From a991c7ba87414d8ee491f9ef3c5e1641a5b607ab Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Thu, 26 Nov 2015 16:09:04 +0100 Subject: [PATCH] switch configuration for iter mode --- .../alias.d/50-trc6500-master-file.csv | 10 +- master/opt/script/check_switches | 2 +- master/opt/script/configure_switch | 1 + master/opt/script/configure_switch_bootstrap | 1 + master/opt/tftp/sw.txt | 403 ++++++++++++++++++ 5 files changed, 413 insertions(+), 4 deletions(-) create mode 100644 master/opt/tftp/sw.txt diff --git a/master/etc/webconfig/alias.d/50-trc6500-master-file.csv b/master/etc/webconfig/alias.d/50-trc6500-master-file.csv index 77ee816..ad666cc 100644 --- a/master/etc/webconfig/alias.d/50-trc6500-master-file.csv +++ b/master/etc/webconfig/alias.d/50-trc6500-master-file.csv @@ -30,16 +30,19 @@ sw2-boot;/usr/share/webconfig;;Bootstrap switch SW2;/opt/script/configure_switch swg1-boot;/usr/share/webconfig;;Bootstrap switch SWG1;/opt/script/configure_switch_bootstrap swg1 swg2-boot;/usr/share/webconfig;;Bootstrap switch SWG2;/opt/script/configure_switch_bootstrap swg2 swm-boot;/usr/share/webconfig;;Bootstrap switch SWM;/opt/script/configure_switch_bootstrap swm +sw-boot;/usr/share/webconfig;;Bootstrap switch SW;/opt/script/configure_switch_bootstrap sw sw1;/usr/share/webconfig;;Configure switch SW1;/opt/script/configure_switch sw1 sw2;/usr/share/webconfig;;Configure switch SW2;/opt/script/configure_switch sw2 swg1;/usr/share/webconfig;;Configure switch SWG1;/opt/script/configure_switch swg1 swg2;/usr/share/webconfig;;Configure switch SWG2;/opt/script/configure_switch swg2 swm;/usr/share/webconfig;;Configure switch SWM;/opt/script/configure_switch swm +sw;/usr/share/webconfig;;Configure switch SW;/opt/script/configure_switch sw sw1-restart;/usr/share/webconfig;;Restart switch SW1;/opt/script/connect_switch -c reload sw1 sw2-restart;/usr/share/webconfig;;Restart switch SW2;/opt/script/connect_switch -c reload sw2 swg1-restart;/usr/share/webconfig;;Restart switch SWG1;/opt/script/connect_switch -c reload swg1 swg2-restart;/usr/share/webconfig;;Restart switch SWG2;/opt/script/connect_switch -c reload swg2 swm-restart;/usr/share/webconfig;;Restart switch SWM;/opt/script/connect_switch -c reload swm +sw-restart;/usr/share/webconfig;;Restart switch SW;/opt/script/connect_switch -c reload sw ;;;Blade maintenance actions; bios;/usr/share/webconfig;;Configure BIOS for all Supermicro blades;sudo /opt/script/check_network -c '/opt/bios/update_bios_cfg.sh -y -Y' -o ipmi;/usr/share/webconfig;;Configure IPMI for all Supermicro blades;sudo /opt/script/check_network -c '/opt/ipmi/update_blade_cfg.sh -y -Y' -o @@ -56,11 +59,12 @@ http://10.133.28.160:8140;/usr/share/webconfig;;FE306-4;:goto: http://10.133.26.160:8140;/usr/share/webconfig;;FE306-4 (lite);:goto: http://10.133.28.160:8150;/usr/share/webconfig;;FE306-5;:goto: http://10.133.26.160:8150;/usr/share/webconfig;;FE306-5 (lite);:goto: -http://10.133.28.231;/usr/share/webconfig;;Switch Monitoring;:goto: http://10.133.28.160:8231;/usr/share/webconfig;;Switch Gonio 1;:goto: -http://10.133.26.160:8231;/usr/share/webconfig;;Switch 1 (lite);:goto: +http://10.133.26.231;/usr/share/webconfig;;Switch 1;:goto: http://10.133.28.160:8232;/usr/share/webconfig;;Switch Gonio 2;:goto: -http://10.133.26.160:8232;/usr/share/webconfig;;Switch 2 (lite);:goto: +http://10.133.26.232;/usr/share/webconfig;;Switch 2;:goto: +http://10.133.28.231;/usr/share/webconfig;;Switch Monitoring;:goto: +http://10.133.26.231;/usr/share/webconfig;;Switch Sensor;:goto: http://10.133.28.254;/usr/share/webconfig;;GPS;:goto: http://10.133.26.254;/usr/share/webconfig;;GPS (lite);:goto: ;;;TRC6500 MIB; diff --git a/master/opt/script/check_switches b/master/opt/script/check_switches index c5347c8..f98b628 100755 --- a/master/opt/script/check_switches +++ b/master/opt/script/check_switches @@ -43,7 +43,7 @@ while [ $# -gt 0 ]; do done # list -[ "$list" ] || list=$(awk '{sub(/#.*/, "")} /sw[gm]/ {print $2}' /etc/hosts) +[ "$list" ] || list=$(awk '{sub(/#.*/, "")} /sw/ {print $2}' /etc/hosts) list=$(echo $list" ") # timeout diff --git a/master/opt/script/configure_switch b/master/opt/script/configure_switch index 0a7785e..9a4ff87 100755 --- a/master/opt/script/configure_switch +++ b/master/opt/script/configure_switch @@ -23,6 +23,7 @@ if { $host == "swg2" } { set tftpserver "10.133.26.160" } if { $host == "swm" } { set tftpserver "10.133.28.160" } if { $host == "sw1" } { set tftpserver "10.133.26.160" } if { $host == "sw2" } { set tftpserver "10.133.26.160" } +if { $host == "sw" } { set tftpserver "10.133.26.160" } if { $tftpserver == "" } { puts "unknown switch '$host'"; exit } set date [ exec date +%Y%m%d-%H:%m:%S ] diff --git a/master/opt/script/configure_switch_bootstrap b/master/opt/script/configure_switch_bootstrap index f7b9da8..ec6e481 100755 --- a/master/opt/script/configure_switch_bootstrap +++ b/master/opt/script/configure_switch_bootstrap @@ -12,6 +12,7 @@ if { $host == "swg2" } { set ipaddress "10.133.26.232" } if { $host == "swm" } { set ipaddress "10.133.28.231" } if { $host == "sw1" } { set ipaddress "10.133.26.231" } if { $host == "sw2" } { set ipaddress "10.133.26.232" } +if { $host == "sw" } { set ipaddress "10.133.26.231" } if { $ipaddress == "" } { puts "unknown switch '$host'""; exit 1 } spawn screen -c . /dev/ttyUSB0 diff --git a/master/opt/tftp/sw.txt b/master/opt/tftp/sw.txt new file mode 100644 index 0000000..f3eed1a --- /dev/null +++ b/master/opt/tftp/sw.txt @@ -0,0 +1,403 @@ + +! +! Last configuration change at 12:23:15 UTC Mon Sep 1 2014 +! NVRAM config last updated at 17:38:50 UTC Fri Jul 11 2014 +! +version 12.2 +no service pad +service timestamps debug datetime msec +service timestamps log datetime msec +service password-encryption +service compress-config +service sequence-numbers +! +hostname SW +! +boot-start-marker +boot system flash bootflash:cat4500-ipbase-mz.122-54.SG1.bin +boot system flash bootflash:cat4500e-ipbase-mz.122-54.SG1.bin +boot-end-marker +! +enable secret 5 $1$OMTZ$xM5SrEPag4m7MGrV1u86/0 +! +! +macro name VERSION +macro description 2.4 +@ +! +no aaa new-model +ip subnet-zero +no ip domain-lookup +! +! +ip vrf mgmtVrf +! +ip routing +ip multicast-routing +ip igmp snooping vlan 1 immediate-leave +vtp mode transparent +! +power redundancy-mode redundant +! +! +! +! +spanning-tree mode rapid-pvst +spanning-tree extend system-id +! +vlan internal allocation policy ascending +! +vlan 10 + name SWITCH-IS +! +vlan 26 + name FE-306 +! +! +! +interface FastEthernet1 + ip vrf forwarding mgmtVrf + no ip address + speed auto + duplex auto +! +interface GigabitEthernet1/1 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/2 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/3 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/4 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/5 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/6 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/7 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/8 + switchport access vlan 10 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/9 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/10 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/11 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/12 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/13 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/14 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/15 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/16 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/17 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/18 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/19 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/20 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/21 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/22 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/23 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/24 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/25 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/26 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/27 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/28 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/29 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/30 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/31 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/32 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/33 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/34 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/35 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/36 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/37 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/38 + switchport access vlan 26 + switchport mode access + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/39 + speed 100 + duplex full + spanning-tree portfast +! +interface GigabitEthernet1/40 + speed 100 + duplex full + spanning-tree portfast +! +interface GigabitEthernet1/41 + speed 100 + duplex full + spanning-tree portfast +! +interface GigabitEthernet1/42 + speed 100 + duplex full + spanning-tree portfast +! +interface GigabitEthernet1/43 + speed 100 + duplex full + spanning-tree portfast +! +interface GigabitEthernet1/44 + speed 100 + duplex full + spanning-tree portfast +! +interface GigabitEthernet1/45 + media-type rj45 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/46 + media-type rj45 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/47 + media-type rj45 + speed auto + duplex auto + spanning-tree portfast +! +interface GigabitEthernet1/48 + media-type rj45 + speed auto + duplex auto + spanning-tree portfast +! +interface TenGigabitEthernet1/49 +! +interface TenGigabitEthernet1/50 +! +interface TenGigabitEthernet1/51 +! +interface TenGigabitEthernet1/52 +! +interface Vlan1 + ip address 10.133.28.231 255.255.255.0 + ip pim sparse-mode +! +interface Vlan10 + ip address 100.100.100.100 255.255.255.0 + ip pim sparse-mode +! +interface Vlan26 + ip address 10.133.26.230 255.255.255.0 + ip pim dense-mode +! +ip forward-protocol udp echo +ip route 0.0.0.0 0.0.0.0 100.100.100.101 +ip http server +ip pim rp-address 100.100.100.100 +! +ip http server +! +access-list 101 permit udp host 10.133.28.160 any eq echo +! +control-plane +! +! +snmp-server community public RO +! +! +line con 0 + password 7 01070E05570E15 + logging synchronous + login + stopbits 1 +line vty 0 4 + password 7 071B294D420C0A + login +line vty 5 15 + password 7 120D0D161E0E1F + login +! +ntp clock-period 17180156 +ntp server 10.133.26.160 +ntp server 10.133.28.160 +ntp server 10.133.28.254 +end -- 2.30.2