-
Notifications
You must be signed in to change notification settings - Fork 7
/
day0-vqfx.exp
52 lines (36 loc) · 878 Bytes
/
day0-vqfx.exp
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
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 1
spawn telnet $gns3_host $port
expect "login:"
send "root\n"
expect "root@:RE"
send "cli\n"
expect "root>"
send "conf\n"
expect "root#"
send "set system root-authentication plain-text-password\n"
expect "New password"
send "Juniper\n"
expect "Retype new password"
send "Juniper\n"
expect "root#"
send "set system host-name $hostname\n"
expect "root#"
send "set interfaces em0 unit 0 family inet address $mgmt_ip\n"
expect "root#"
send "set routing-options static route 0.0.0.0/0 next-hop $mgmt_gw\n"
expect "root#"
send "set system services ssh root-login allow\n"
expect "root#"
send "commit\n"
expect "root#"
send "exit\n"
expect "root>"
send "exit\n"
expect "root@:RE"
send "exit\n"