-
Notifications
You must be signed in to change notification settings - Fork 7
/
day0-fortigate.exp
61 lines (42 loc) · 920 Bytes
/
day0-fortigate.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
53
54
55
56
57
58
59
60
61
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 "login:"
send "admin\n"
expect "Password"
send "\n"
expect "FortiGate-"
send "config system global\n"
expect "FortiGate-"
send "set hostname $hostname\n"
expect "FortiGate-"
send "end\n"
expect "$hostname"
send "config system interface\n"
expect "$hostname"
send "edit port1\n"
expect "$hostname"
send "set mode static\n"
expect "$hostname"
send "set ip $mgmt_ip\n"
expect "$hostname"
send "end\n"
expect "$hostname"
send "config router static\n"
expect "$hostname"
send "edit 0\n"
expect "$hostname"
send "set device port1\n"
expect "$hostname"
send "set dst 0.0.0.0/0\n"
expect "$hostname"
send "set gateway $mgmt_gw\n"
expect "$hostname"
send "end\n"
expect "$hostname"
send "exit\n"