-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathday0-nxos.exp
More file actions
55 lines (38 loc) · 913 Bytes
/
day0-nxos.exp
File metadata and controls
55 lines (38 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
set gns3_host [lindex $argv 0];
set port [lindex $argv 1];
set hostname [lindex $argv 2];
set mgmt_ip [lindex $argv 3];
set mgmt_gw [lindex $argv 4];
set timeout 600
log_user 0
spawn telnet $gns3_host $port
expect "POAP-2-POAP_DHCP_DISCOVER_START"
send "y\n"
expect "Do you want to enforce secure password standard"
send "n\n"
expect "Enter the password"
send "admin\n"
expect "Confirm the password"
send "admin\n"
expect "Would you like to enter the basic configuration dialog"
send "n\n"
expect "login:"
send "admin\n"
expect "Password:"
send "admin\n"
expect "switch#"
send "conf t\n"
expect "switch"
send "hostname $hostname\n"
expect "$hostname"
send "interface mgmt0\n"
expect "$hostname"
send "ip address $mgmt_ip\n"
expect "$hostname"
send "vrf context management\n"
expect "$hostname"
send "ip route 0.0.0.0/0 $mgmt_gw\n"
expect "$hostname"
send "end\n"
expect "$hostname"
send "exit\n"