Merge branch 'master' of srvgitgnv:/gitstore/g_tr65/debian6500
[debian6500.git] / master / root / bin / conf_switch_integration
CommitLineData
57f52f76
TPVT
1#!/usr/bin/expect
2
3set sub [lrange $argv 0 0]
4if { $sub == "" } { set sub "1" }
3a8d2b2f 5spawn telnet sw1
57f52f76
TPVT
6
7expect {
6ded6f01
TPVT
8 "Password:" { send "thales\r" }
9 incorrect { send_user "invalid password or account\n"; exit }
10 timeout { send_user "connection to $sub timed out\n"; exit }
11 eof { send_user "connection to host failed\n"; exit }
57f52f76
TPVT
12}
13expect -exact ">" { send "enable\r" }
14expect "Password:" { send "thales\r" }
15
16expect -exact "#" { send "config terminal\r" }
17
18expect -exact "#" { send "vlan 192\r" }
19expect -exact "#" { send "name Integration\r" }
20expect -exact "#" { send "exit\r" }
3a8d2b2f 21f
6ded6f01 22expect -exact "#" { send "interface gigabitEthernet 1/47\r" }
57f52f76
TPVT
23expect -exact "#" { send "switchport mode access\r" }
24expect -exact "#" { send "switchport access vlan 192\r" }
25expect -exact "#" { send "exit\r" }
26
27expect -exact "#" { send "interface vlan 192\r" }
28expect -exact "#" { send "ip address 192.168.$sub.231 255.255.255.0\r" }
29expect -exact "#" { send "ip pim dense-mode\r" }
30expect -exact "#" { send "no shutdown\r" }
31expect -exact "#" { send "exit\r" }
32
33expect -exact "#" { send "ip route 192.168.$sub.0 255.255.255.0 Vlan192\r" }
14037e7d
LM
34#expect -exact "#" { send "ip route 192.168.$sub.160 255.255.255.255 10.133.26.160\r" }
35expect -exact "#" { send "ip route 192.168.$sub.160 255.255.255.255 10.133.28.160\r" }
57f52f76
TPVT
36expect -exact "#" { send "ip route 192.168.$sub.101 255.255.255.255 Vlan10\r" }
37expect -exact "#" { send "ip route 192.168.0.0 255.255.255.0 192.168.$sub.230\r" }
38expect -exact "#" { send "exit\r" }
39
40expect -exact "#" { send "exit\r" }
41