Add conf_swm_integration script
authorThomas Pérennou (Viveris Technologie) <thomas.perennou@external.thalesgroup.com>
Tue, 6 Jan 2015 16:41:13 +0000 (17:41 +0100)
committerThomas Pérennou (Viveris Technologie) <thomas.perennou@external.thalesgroup.com>
Tue, 6 Jan 2015 16:41:13 +0000 (17:41 +0100)
master/root/bin/conf_swm_integration.tcl [new file with mode: 0755]

diff --git a/master/root/bin/conf_swm_integration.tcl b/master/root/bin/conf_swm_integration.tcl
new file mode 100755 (executable)
index 0000000..a2e3a68
--- /dev/null
@@ -0,0 +1,40 @@
+#!/usr/bin/expect
+
+set sub [lrange $argv 0 0]
+if { $sub == "" } { set sub "1" }
+spawn telnet swm
+
+expect {
+       "Password:" { send "thales\r" }
+       incorrect { send_user "invalid password or account\n"; exit }
+               timeout { send_user "connection to $sub timed out\n"; exit }
+               eof { send_user "connection to host failed\n"; exit }
+}
+expect -exact ">" { send "enable\r" }
+expect "Password:" { send "thales\r" }
+
+expect -exact "#" { send "config terminal\r" }
+
+expect -exact "#" { send "vlan 192\r" }
+expect -exact "#" { send "name Integration\r" }
+expect -exact "#" { send "exit\r" }
+
+expect -exact "#" { send "interface gigabitEthernet 1/45\r" }
+expect -exact "#" { send "switchport mode access\r" }
+expect -exact "#" { send "switchport access vlan 192\r" }
+expect -exact "#" { send "exit\r" }
+
+expect -exact "#" { send "interface vlan 192\r" }
+expect -exact "#" { send "ip address 192.168.$sub.231 255.255.255.0\r" }
+expect -exact "#" { send "ip pim dense-mode\r" }
+expect -exact "#" { send "no shutdown\r" }
+expect -exact "#" { send "exit\r" }
+
+expect -exact "#" { send "ip route 192.168.$sub.0 255.255.255.0 Vlan192\r" }
+expect -exact "#" { send "ip route 192.168.$sub.160 255.255.255.255 Vlan1\r" }
+expect -exact "#" { send "ip route 192.168.$sub.101 255.255.255.255 Vlan10\r" }
+expect -exact "#" { send "ip route 192.168.0.0 255.255.255.0 192.168.$sub.230\r" }
+expect -exact "#" { send "exit\r" }
+
+expect -exact "#" { send "exit\r" }
+