Fortigate Troubleshooting Commands - Itsecworks
Fortigate Troubleshooting Commands - Itsecworks
1/19
25/10/2016
0.0
4.5
cmdbsvr
23
0.0
6.8
zebos_launcher
27
0.0
4.7
uploadd
28
0.0
4.6
miglogd
29
0.0
5.9
miglogd
30
0.0
4.6
httpsd
31
0.0
7.0
nsm
32
0.0
1.1
ripd
33
0.0
0.9
ripngd
34
0.0
0.9
ospfd
35
0.0
0.9
proxyd
36
0.0
4.6
wad_diskd
37
0.0
4.6
scanunitd
38
S<
0.0
4.9
ospf6d
39
0.0
0.9
https://itsecworks.com/2011/07/18/fortigate-basic-troubleshooting-commands/#CheckTheTunnelState
2/19
25/10/2016
bgpd
40
0.0
1.0
isisd
41
0.0
0.9
proxyacceptor
42
0.0
0.7
proxyworker
43
0.0
1.8
getty
44
S<
0.0
4.6
3/19
25/10/2016
set hb-interval 2
set hb-lost-threshold 6
set helo-holddown 20
set arps 5
set arps-interval 8
set session-pickup enable
set link-failed-signal disable
set uninterruptable-upgrade enable
set vcluster2 disable
set override enable
set priority 254
set monitor "port4" "port5" "port6"
unset pingserver-monitor-interface
set pingserver-failover-threshold 0
set pingserver-flip-timeout 60
end
with the diagnose command the state again:
myfirewall1 # diagnose sys ha status
HA information
Statistics
traffic.local = s:2096712 p:2541238162 b:1972123729708
traffic.total = s:9497465 p:2541238496 b:1972123977459
activity.fdb = c:0 q:0
Model=311, Mode=2 Group=0 Debug=0
nvcluster=1, ses_pickup=1
HA group member information: is_manage_master=1.
FG311B1111111111, 0. Master:254 myfirewall1
FG311B1111111112, 1. Slave:128 myfirewall2
vcluster 1, state=work, master_ip=10.0.0.1, master_id=0:
FG311B1111111111, 0. Master:254 myfirewall1(prio=0, rev=0)
FG311B1111111112, 1. Slave:128 myfirewall2(prio=1, rev=1)
The secondary cluster unit is off:
myfirewall1 # diagnose sys ha status
HA information
Statistics
traffic.local = s:286117 p:7759897825 b:3064522035872
traffic.total = s:205341071 p:7759897825 b:3064522035872
activity.fdb = c:0 q:0
Model=300, Mode=2 Group=0 Debug=0
nvcluster=1, ses_pickup=1
https://itsecworks.com/2011/07/18/fortigate-basic-troubleshooting-commands/#CheckTheTunnelState
4/19
25/10/2016
misc info:
5/19
25/10/2016
state=local
statistic(bytes/packets/allow_err): org=5095/76/1 reply=8757/75/1 tuples=2
orgin->sink: org out->post, reply pre->in dev=10->12/12->10
gwy=0.0.0.0/192.168.227.97
hook=out dir=org act=noop 192.168.227.97:54223->65.39.139.53:53(0.0.0.0:0)
hook=in dir=reply act=noop 65.39.139.53:53->192.168.227.97:54223(0.0.0.0:0)
misc=0 policy_id=0 auth_info=0 chk_client_info=0 vd=0 serial=0047c5b4 tos=ff/ff
imp2p=0 app=0
dd_type=0 dd_rule_id=0
total session 7
You can lter to the session that you looking for (example):
myfirewall1 # diagnose sys session filter src 192.168.227.129
myfirewall1 # diag sys session list
6/19
25/10/2016
Check the MAC and the state of the interfaces. The name of the interface in the example below is
internal.
Here you can see following in the output
Interface name
MAC
Link state
Speed
Duplex
MTU
Packet and Byte counters
Errors
myfirewall1 # diagnose hardware deviceinfo nic internal
Description
ip175c-vdev
Part_Number
N/A
Driver_Name
ip175c
Driver_Version
1.01
System_Device_Name
internal
Current_HWaddr
00:09:0f:d6:c0:ac
Permanent_HWaddr
00:09:0f:d6:c0:ac
Link
up
Speed
100
Duplex
full
State
up (0x00001003)
Port_no
-1
Port_Bits
0x7
Link_Bits
0x1
MTU_Size
1500
Rx_Packets
694
Tx_Packets
Rx_Bytes
80348
Tx_Bytes
214
Rx_Errors
Tx_Errors
Rx_Dropped
Tx_Dropped
Multicast
Collisions
Rx_Length_Errors
Rx_Over_Errors
Rx_CRC_Errors
Rx_Frame_Errors
Rx_FIFO_Errors
Rx_Missed_Errors
Tx_Aborted_Errors
Tx_Carrier_Errors
https://itsecworks.com/2011/07/18/fortigate-basic-troubleshooting-commands/#CheckTheTunnelState
7/19
25/10/2016
Tx_FIFO_Errors
Tx_Heartbeat_Errors
Tx_Window_Errors
Age(min)
Hardware Addr
Interface
4.4.4.66
00:08:da:52:33:b6 port4
4.4.4.74
16
00:21:9b:94:38:44 port2
4.4.4.131
00:00:0c:07:ac:23 port6
4.4.4.150
00:09:0f:09:01:3b port6
4.4.3.3
02:00:5e:47:c1:a3 port5
8/19
25/10/2016
The most signicant part for vpn is the time on the devices. The check the time use the following command:
myfirewall1 # get sys status
Version: Fortigate-50B v4.0,build0632,120705 (MR3 Patch 8)
Virus-DB: 14.00000(2011-08-24 17:17)
Extended DB: 14.00000(2011-08-24 17:09)
IPS-DB: 3.00150(2012-02-15 23:15)
FortiClient application signature package: 1.131(2012-07-05 20:54)
Serial-Number: FGT50B1234567891
BIOS version: 04000010
Log hard disk: Not available
Hostname: myfirewall1
Operation Mode: NAT
Current virtual domain: root
Max number of virtual domains: 10
Virtual domains status: 1 in NAT mode, 0 in TP mode
Virtual domain configuration: disable
FIPS-CC mode: disable
Current HA mode: standalone
Distribution: International
Branch point: 632
Release Version Information: MR3 Patch 8
System time: Fri Nov 16 17:31:03 2012
Change the tunnel state
Bring up a vpn tunnel manually. No trafc required.
myfirewall # diag vpn tunnel up phase2-name phase1-name
Shut down a vpn tunnel manually.
myfirewall # diag vpn tunnel down phase2-name phase1-name
Check the tunnel state
If there is no SA that means the tunnel is down and does not work. To see if the tunnel is up we need to check
if any SA exist.
To see if the tunnel is up you can use the diagnose vpn tunnel list name or diagnose vpn tunnel dumpsa
command.
Tunnel state is down
Tunnel does not exist if there is no output of the commands below:
myfirewall1 # diagnose vpn tunnel list name myphase1
list ipsec tunnel by names in vd 0
https://itsecworks.com/2011/07/18/fortigate-basic-troubleshooting-commands/#CheckTheTunnelState
9/19
25/10/2016
https://itsecworks.com/2011/07/18/fortigate-basic-troubleshooting-commands/#CheckTheTunnelState
10/19
25/10/2016
11/19
25/10/2016
des:
3des:
335
196
aes:
null:
md5:
sha1:
335
196
sha256: 0
sha384: 0
sha512: 0
SOFTWARE:
null:
des:
3des:
aes:
null:
md5:
sha1:
sha256: 0
sha384: 0
sha512: 0
12/19
25/10/2016
5.0 sniffertrace
The basic command is diagnose sniffer packet, after that you have to dene the interface* (or the keyword
any):
myfirewall1 # diagnose sniffer packet
the network interface to sniff (or "any")
*Looks like you cannot lter explicitly on tunnel interface, you have to use any in that case and dene a lter
string.
https://itsecworks.com/2011/07/18/fortigate-basic-troubleshooting-commands/#CheckTheTunnelState
13/19
25/10/2016
And the tcpdump like lter string (or the keyword none):
myfirewall1 # diagnose sniffer packet any
flexible logical filters for sniffer (or "none").
For example: To print udp 1812 traffic between forti1 and either forti2 or
forti3
'udp and port 1812 and host forti1 and \( forti2 or forti3 \)'
And the output format you expect (I use always the 4)
myfirewall1 # diagnose sniffer packet any none
1: print header of packets
2: print header and data from ip of packets
3: print header and data from ethernet of packets (if available)
4: print header of packets with interface name
5: print header and data from ip of packets with interface name
6: print header and data from ethernet of packets (if available) with intf name
myfirewall1 # diagnose sniffer packet any none 4
sniffer count
myfirewall1 # diagnose sniffer packet any none 4 4
interfaces=[any]
filters=[none]
0.914475 wan1 in 10.250.19.159.63929 -> 3.3.3.127.61784: 689103397 ack 64745307
0.915067 wan1 out 3.3.3.3.22 -> 10.20.100.10.57499: psh 3728577301 ack
1697425175
0.915079 eth0 out 3.3.3.3.22 -> 10.20.100.10.57499: psh 3728577301 ack
1697425175
0.915452 wan1 out 3.3.3.3.22 -> 10.20.100.10.57499: psh 3728577433 ack
1697425175
The 2. parameter after port6 arp 1? is the number of packets to be sniffered. In this example it is set to 2.
myfirewall # diagnose sniffer packet port6 arp 1 2
interfaces=[port6]
filters=[arp]
0.907592 arp who-has 3.3.3.3 tell 3.3.3.5
1.907597 arp who-has 3.3.3.3 tell 3.3.3.5
myfirewall #
If the sniffer should be analysed with Wireshark, the following pl script should be used:
fgt2eth.pl
14/19
25/10/2016
There are some elds that you wont ever see in webui as in the column setting you cannot choose them. Just
an example for this is a false pre-shared key, the eld that tells you what the problem is, called error_reason.
The buffer size is limited and if the buffer is full the old logs will be overwritten.
To check your buffer size issue the following command:
myfirewall # get log memory global-setting
full-final-warning-threshold: 95
full-first-warning-threshold: 75
full-second-warning-threshold: 90
max-size : 98304
Congure logging
To view the logs on the CLI issue the following commands (it is better to use a syslog server as checking the
logs from memory, it is slow).
myfirewall # execute log filter device memory
myfirewall # execute log filter start-line 1
myfirewall # execute log filter view-lines 10
myfirewall # execute log filter category event
Check if that is correct for you.
myfirewall # execute log filter dump
category: event
device: memory
roll: 0
start-line: 1
view-lines: 10
Viewing the logs
In this example we can sse a failed vpn session as the preshared key is not identical on the vpn peers. The
logs are not in every cases so talkative, for example the logs for different encryption trafc failure refer to
nothing usefull.
Logs for preshared key failure:
myfirewall3 # execute log display
874 logs found.
10 logs returned.1: 2011-08-31 17:02:33 log_id=0101037127 type=event
subtype=ipsec pri=notice fwver=040003 vd="root" msg="progress IPsec phase 1"
action="negotiate" rem_ip=1.1.1.1 loc_ip=3.3.3.3 rem_port=500 loc_port=500
out_intf="wan1" cookies="26fb9f49765a425f/a1da24b19fb1f8ce" user="N/A"
group="N/A" xauth_user="N/A" xauth_group="N/A" vpn_tunnel="fortigw-311b"
status=success init=local mode=main dir=outbound stage=3 role=initiator
result=OK2: 2011-08-31 17:02:33 log_id=0101037127 type=event subtype=ipsec
https://itsecworks.com/2011/07/18/fortigate-basic-troubleshooting-commands/#CheckTheTunnelState
15/19
25/10/2016
16/19
25/10/2016
17/19
25/10/2016
https://itsecworks.com/2011/07/18/fortigate-basic-troubleshooting-commands/#CheckTheTunnelState
18/19
25/10/2016
end
end
Thats all folks!
https://itsecworks.com/2011/07/18/fortigate-basic-troubleshooting-commands/#CheckTheTunnelState
19/19