Troubleshooting
Troubleshooting
Technical Documentation
docs.fortinet.com
Knowledge Base
kb.fortinet.com
support.fortinet.com
Training Services
training.fortinet.com
FortiGuard
fortiguard.com
Document Feedback
Contents
Introduction........................................................................................................7
Before you begin....................................................................................................... 7
How this guide is organized...................................................................................... 7
Page 3
Page 4
FortiGuard troubleshooting..................................................................................... 56
Troubleshooting process for FortiGuard updates............................................. 56
FortiGuard server settings ................................................................................ 57
FortiGuard URL rating....................................................................................... 57
................................................................................................................................ 57
................................................................................................................................ 57
Page 5
Index .................................................................................................................95
Page 6
Introduction
Welcome and thank you for selecting Fortinet products for your network protection.
This guide is intended for administrators who need guidance on different network needs and
information on basic and advanced troubleshooting.
This chapter contains the following topics:
Before you begin
How this guide is organized
Page 7
Life of a Packet
Directed by security policies, a FortiGate unit screens network traffic from the IP layer up
through the application layer of the TCP/IP stack. This chapter provides a general, high-level
description of what happens to a packet as it travels through a FortiGate security system.
The FortiGate unit performs three types of security inspection:
stateful inspection, that provides individual packet-based security within a basic session
state
flow-based inspection, that buffers packets and uses pattern matching to identify security
threats
proxy-based inspection, that reconstructs content passing through the FortiGate unit and
inspects the content for security threats.
Each inspection component plays a role in the processing of a packet as it traverses the
FortiGate unit in route to its destination. To understand these inspections is the first step to
understanding the flow of the packet.
This section contains the following topics:
Stateful inspection
Flow inspection
Proxy inspection
Comparison of inspection layers
FortiOS functions and security layers
Packet flow
Example 1: client/server connection
Example 2: Routing table update
Example 3: Dialup IPsec VPN with application control
Stateful inspection
With stateful inspection, the FortiGate unit looks at the first packet of a session to make a
security decision. Common fields inspected include TCP SYN and FIN flags to identity the start
and end of a session, the source/destination IP, source/destination port and protocol. Other
checks are also performed on the packed payload and sequence numbers to verify it as a valid
communication and that the data is not corrupted or poorly formed.
What makes it stateful is that one or both ends must save information about the session history
in order to communicate. In stateless communication, only independent requests and
responses are used, that do not depend on previous data. For example, UDP is stateless by
nature because it has no provision for reliability, ordering, or data integrity.
The FortiGate unit makes the decision to drop, pass or log a session based on what is found in
the first packet of the session. If the FortiGate unit decides to drop or block the first packet of a
session, then all subsequent packets in the same session are also dropped or blocked without
being inspected. If the FortiGate unit accepts the first packet of a session, then all subsequent
packets in the same session are also accepted without being inspected.
Page 8
What is a session?
A session is established on an existing connection, for a defined period of time, using a
determined type of communication or protocol. Sessions can have specific bandwidth , and
time to live (TTL) parameters.
You can compare a session to a conversation. A session is established when one end point
initiates a request by establishing a TCP connection on a particular port, the receiving end is
listening on that port, and replies. You could telnet to port 80 even though telnet normally uses
port 23, because at this level, the application being used cannot be determined.
However, the strong points of sessions and stateful protocols can also be their weak points.
Denial of service (DoS) attacks involve creating so many sessions that the connection state
information tables are full and the unit will not accept additional sessions.
Page 9
1
3
nt
Se et
ck
Pa
SY
N,
IP,
TC
1
P
2
3
1
3
ed
eiv t
c
Re cke
Pa
Flow inspection
With flow inspection (also called flow-based inspection), the FortiGate unit samples multiple
packets in a session and multiple sessions, and uses a pattern matching engine to determine
the kind of activity that the session is performing and to identify possible attacks or viruses. For
example, if application control is operating, flow inspection can sample network traffic and
identify the application that is generating the activity. Flow inspection using IPS samples
network traffic and determines if the traffic constitutes an attack. Flow inspection can also be
used for antivirus protection, web filtering, and data leak protection (DLP). Flow inspection
occurs as the data is passing from its source to its destination. Flow inspection identifies and
blocks security threats in real time as they are identified.
Figure 2: Flow inspection of packets through the FortiGate unit
IPS
,
Ap Flow
p C -AV
ont ,
rol
2
3
2
nt
Se et
ck
Pa
1
2
ed
eiv t
c
Re cke
Pa
Flow inspection typically requires less processing than proxy inspection, and therefore flow
antivirus, web filtering, and DLP inspection performance can be better than proxy inspection
performance. However, some threats can only be detected when a complete copy of the
payload (for example a complete email attachment) is obtained so, proxy inspection tends to be
more accurate and complete than flow inspection.
Page 10
Proxy inspection
Proxy inspection examines the content contained in content protocol sessions for security
threats. Content protocols include HTTP, FTP, and email protocols. Security threats can be
found in files and other content downloaded using these protocols. With proxy inspection, the
FortiGate unit downloads the entire payload of a content protocol session and re-constructs it.
For example, proxy inspection can reconstruct an email message and its attachments. After a
satisfactory inspection the FortiGate unit passes the content on to the client. If the proxy
inspection detects a security threat in the content, the content is removed from the
communication stream before it reaches its destination. For example, if proxy inspection
detects a virus in an email attachment, the attachment is removed from the email message
before its sent to the client. Proxy inspection is the most thorough inspection of all, although it
requires more processing power, and this may result in lower performance.
Figure 3: Proxy inspection of packets through the FortiGate unit
1
3
nt
Se et
ck
Pa
Em
a
filteil filter
r, D , we
LP, b
AV
3
2
1
3
ed
eiv t
c
Re cke
Pa
Feature
Stateful
Flow
first packet
low
medium
high
good
better
best
Authentication
yes
yes
Antivirus protection
yes
yes
Web Filtering
yes
yes
yes
yes
Page 11
Proxy
Feature
Stateful
Flow
Proxy
Application control
yes
IPS
yes
Delay in traffic
no
small
no
yes
Security Function
Stateful
Firewall
yes
IPsec VPN
yes
Traffic Shaping
yes
User Authentication
yes
Management Traffic
yes
SSL VPN
yes
Flow
Intrusion Prevention
yes
Antivirus
yes
Application Control
yes
Web filtering
yes
DLP
Proxy
yes
yes
yes
Email Filtering
yes
VoIP inspection
yes
yes
Packet flow
After the FortiGate units external interface receives a packet, the packet proceeds through a
number of steps on its way to the internal interface, traversing each of the inspection types,
depending on the security policy and security profile configuration. The diagram in Figure 4 on
page 13 is a high level view of the packets journey.
Page 12
The description following is a high-level description of these steps as a packet enters the
FortiGate unit towards its destination on the internal network. Similar steps occur for outbound
traffic.
Page 13
Interface
Ingress packets are received by a FortiGate interface.The packet enters the system, and the
interface network device driver passes the packet to the Denial of Service (DoS) sensors, if
enabled, to determine whether this is a valid information request or not.
DoS sensor
DoS scans are handled very early in the life of the packet to determine whether the traffic is
valid or is part of a DoS attack. Unlike signature-based IPS which inspects all the packets within
a certain traffic flow, the DoS module inspects all traffic flows but only tracks packets that can
be used for DoS attacks (for example TCP SYN packets), to ensure they are within the
permitted parameters. Suspected DoS attacks are blocked, other packets are allowed.
IPsec
If the packet is an IPsec packet, the IPsec engine attempts to decrypt it. The IPsec engine
applies the correct encryption keys to the IPsec packet and sends the unencrypted packet to
the next step. IPsec is bypassed when for non-IPsec traffic and for IPsec traffic that cannot be
decrypted by the FortiGate unit.
Routing
The routing step determines the outgoing interface to be used by the packet as it leaves the
FortiGate unit. In the previous step, the FortiGate unit determined the real destination address,
so it can now refer to its routing table and decide where the packet must go next.
Routing also distinguishes between local traffic and forwarded traffic and selects the source
and destination interfaces used by the security policy engine to accept or deny the packet.
Policy lookup
The policy look up is where the FortiGate unit reviews the list of security policies which govern
the flow of network traffic, from the first entry to the last, to find a match for the source and
Fortinet Technologies Inc.
Page 14
destination IP addresses and port numbers. The decision to accept or deny a packet, after
being verified as a valid request within the stateful inspection, occurs here. A denied packet is
discarded. An accepted packet will have further actions taken. If IPS is enabled, the packet will
go to Flow-based inspection engine, otherwise it will go to the Proxy-based inspection engine.
If no other security options are enabled, then the session was only subject to stateful
inspection. If the action is accept, the packet will go to Source NAT to be ready to leave the
FortiGate unit.
Session tracking
Part of the stateful inspection engine, session tracking maintains session tables that maintain
information about sessions that the stateful inspection module uses for maintaining sessions,
NAT, and other session related functions.
User authentication
User authentication added to security policies is handled by the stateful inspection engine,
which is why Firewall authentication is based on IP address. Authentication takes place after
policy lookup selects a security policy that includes authentication. This is also known as
identify-based policies. Authentication also takes place before security features are applied to
the packet.
Management traffic
This local traffic is delivered to the FortiGate unit TCP/IP stack and includes communication
with the web-based manager, the CLI, the FortiGuard network, log messages sent to
FortiAnalyzer or a remote syslog server, and so on. Management traffic is processed by
applications such as the web server which displays the FortiOS web-based manager, the SSH
server for the CLI or the FortiGuard server to handle local FortiGuard database updates or
FortiGuard Web Filtering URL lookups.
ICAP traffic
If you enable ICAP in a security policy, HTTP (and optionally HTTPS) traffic intercepted by the
policy is transferred to ICAP servers in the ICAP profile added to the policy. The FortiGate unit is
the surrogate, or middle-man, and carries the ICAP responses from the ICAP server to the
ICAP client; the ICAP client then responds back, and the FortiGate unit determines the action
that should be taken with these ICAP responses and requests.
Session helpers
Some protocols include information in the packet body (or payload) that must be analyzed to
successfully process sessions for this protocol. For example, the SIP VoIP protocol uses TCP
control packets with a standard destination port to set up SIP calls. To successfully process SIP
VoIP calls, FortiOS must be able to extract information from the body of the SIP packet and use
this information to allow the voice-carrying packets through the firewall.
FortiOS uses session helpers to analyze the data in the packet bodies of some protocols and
adjust the firewall to allow those protocols to send packets through the firewall.
Fortinet Technologies Inc.
Page 15
Once the packet has passed the flow-based engine, it can be sent to the proxy inspection
engine or egress.
IPsec
If the packet is transmitted through an IPsec tunnel, it is at this stage the encryption and
required encapsulation is performed. For non-IPsec traffic (TCP/UDP) this step is bypassed.
Routing
The final routing step determines the outgoing interface to be used by the packet as it leaves
the FortiGate unit.
Egress
Upon completion of the scanning at the IP level, the packet exits the FortiGate unit.
Page 16
Page 17
Page 18
6. Routing module
6.1 Update routing table
Page 19
Page 20
Page 21
For example, if you want to add an admin profile that does not allow changing firewall policies,
when you configure the admin profile set Firewall Configuration to None or Read Only.
Change the admin account name and limit access to this account
The default super_admin administrator account, admin, is a well known administrator name so if
this account is available it could be easier for attackers to access the FortiGate unit because
they know they can log in with this name, only having to determine the password. You
can improve security by changing this name to one more difficult for an attacker to guess.
To do this, create a new administrator account with the super_admin admin profile and log in as
that administrator. Then go to System > Admin > Administrators and edit the admin
administrator and change the Administrator name.
Once the account has been renamed you could delete the super_admin account that you just
added. Consider also only using the super-admin account for adding or changing
administrators. The less this account is used to less likely that it could be compromised.
You could also store the account name and password for this account in a secure location in
case for some reason the account name or password is forgotten.
Page 23
Page 24
The time-out can be set as high as 480 minutes, or eight hours, although this is not recommend.
To set the idle time out, go to System > Admin > Settings and enter the amount of time for the
Idle Timeout. A best practice is to keep the default of 5 min.
When logging into the console using SSH, the default time of inactivity to successfully log into
the FortiGate unit is 120 seconds (2 minutes). You can configure the time to be shorter by using
the CLI to change the length of time the command prompt remains idle before the FortiGate unit
will log the administrator out. The range can be between 10 and 3600 seconds. To set the
logout time enter the following CLI commands:
config system global
set admin-ssh-grace-time <number_of_seconds>
end
Page 25
Page 26
Troubleshooting resources
Before you begin troubleshooting, you need to know Fortinets troubleshooting resources.
Doing so will shorten the time to solve your issue. Indeed, an administrator can save time and
effort during the troubleshooting process by first checking if the issue has been experienced
before. Several self-help resources are available to provide valuable information about FortiOS
technical issues, including:
Technical Documentation
Installation Guides, Administration Guides, Quick Start Guides, and other technical documents
are available online at the following URL:
http://docs.fortinet.com
Release Notes
Issues that are uncovered after the technical documentation has been published will often be
listed in the Release Notes that accompany the device.
Knowledge Base
The Fortinet Knowledge Base provides access to a variety of articles, white papers, and other
documentation providing technical insight into a range of Fortinet products. The Knowledge
Base is available online at the following URL:
http://kb.fortinet.com
Page 27
Page 28
Troubleshooting tools
FortiOS provides a number of tools that help with troubleshooting both hardware and software
issues. These tools include diagnostics and ports; ports are used when you need to understand
the traffic coming in or going out on a specific port, for example, UDP 53, which is used by the
FortiGate unit for DNS lookup and RBL lookup.
This section also contains information about troubleshooting FortiGuard issues.
This section contains the following topics:
FortiOS diagnostics
FortiOS ports
FortiAnalyzer/FortiManager ports
FortiGuard troubleshooting
FortiOS diagnostics
A collection of diagnostic commands are available in FortiOS for troubleshooting and
performance monitoring. Within the CLI commands, the two main groups of diagnostic
commands are get and diagnose commands. Both commands display information about
system resources, connections, and settings that enable you to locate and fix problems, or to
monitor system performance.
This topic includes diagnostics commands to help with:
Check date and time
Resource usage
Proxy operation
Hardware NIC
Traffic trace
Session table
Firewall session setup rate
Finding object dependencies
Flow trace
Packet sniffing and packet capture
FA2 and NP2 based interfaces
Debug command
The execute tac report command
Other commands
Additional diagnostic commands related to specific features are covered in the chapter for that
specific feature. For example in-depth diagnostics for dynamic routing are covered in the
dynamic routing chapter.
Use Network Time Protocol (NTP) to set the date and time if possible. This is an automatic
method that does not require manual intervention. However, you must ensure the port is
allowed through the firewalls on your network. FortiToken synchronization requires NTP in many
situations.
How to check the date and time - web-based manager
1. Go to System Information > System Time on the dashboard.
Alternately, you can check the date and time using the CLI commands execute date and
execute time.
2. If required, select Change to adjust the date and time settings.
You can set the time zone, date and time, and select NTP usage. In the CLI, use the
following commands to change the date and time:
config system global
set timezone (use ? to get a list of IDs and descriptions of their
timezone)
set
config system ntp
config ntpserver
edit 1
set server ntp1.fortinet.net
next
edit 2
set server ntp2.fortinet.net
next
end
set ntpsync enable
set syncinterval 60
end
Resource usage
Each program running on a computer has one or more processes associated with it. For
example if you open a Telnet program, it will have an associated telnet process. The same is
true in FortiOS. All the processes have to share the system resources in FortiOS including
memory and CPU.
Use get system performance status command to show the FortiOS performance
status.
Page 30
Sample output:
FGT#get system performance status
CPU states: 0% user 0% system 0% nice 100% idle
CPU0 states: 0% user 0% system 0% nice 100% idle
CPU1 states: 0% user 0% system 0% nice 100% idle
CPU2 states: 0% user 0% system 0% nice 100% idle
CPU3 states: 0% user 0% system 0% nice 100% idle
Memory states: 25% used
Average network usage: 0 kbps in 1 minute, 0 kbps in 10 minutes, 0 kbps
in 30 minutes
Average sessions: 5 sessions in 1 minute, 5 sessions in 10 minutes, 4
sessions in 30 minutes
Average session setup rate: 0 sessions per second in last 1 minute, 0
sessions per second in last 10 minutes, 0 sessions per second in
last 30 minutes
Virus caught: 0 total in 1 minute
IPS attacks blocked: 0 total in 1 minute
Uptime: 0 days, 12 hours, 7 minutes
Monitor the CPU/memory usage of internal processes using the following command:
get system performance top <delay> <max_lines>
The data listed by the command includes the name of the daemon, the process ID, whether the
process is sleeping or running, the CPU percentage being used, and the memory percentage
being used.
Sample output:
FGT#get system performance top 10 100
Run Time: 0 days, 11 hours and 30 minutes
0U, 0S, 100I; 1977T, 1470F, 121KF
pyfcgid
120
S
0.0
pyfcgid
121
S
0.0
pyfcgid
122
S
0.0
pyfcgid
53
S
0.0
ipsengine
75
S <
0.0
ipsengine
66
S <
0.0
ipsengine
73
S <
0.0
ipsengine
74
S <
0.0
ipsengine
79
S <
0.0
ipsengine
80
S <
0.0
cmdbsvr
43
S
0.0
proxyworker
110
S
0.0
proxyworker
111
S
0.0
httpsd
125
S
0.0
httpsd
52
S
0.0
httpsd
124
S
0.0
newcli
141
R
0.0
newcli
128
S
0.0
fgfmd
102
S
0.0
iked
86
S
0.0
Fortinet Technologies Inc.
Page 31
1.3
1.3
1.3
1.3
1.3
1.3
1.3
1.3
1.3
1.3
1.0
1.0
1.0
0.8
0.8
0.8
0.7
0.7
0.7
0.7
Proxy operation
Monitor proxy operations using the following command:
diag test application <application> <option>
The <application> value can include the following:
acd
Aggregate Controller.
ddnscd
dhcp6c
dhcprelay
dlpfingerprint
dlpfpcache
dnsproxy
DNS proxy.
dsd
forticldd
FortiCloud daemon.
forticron
FortiCron daemon.
fsd
FortiExplorer daemon.
ftpd
FTP proxy.
harelay
HA relay daemon.
http
HTTP proxy.
imap
IMAP proxy.
info-sslvpnd
ipldbd
ipsengine
ips sensor
ipsmonitor
ips monitor
ipsufd
l2tpcd
lted
miglogd
nat64d
NAT 64 daemon.
nntp
NNTP proxy.
pop3
POP3 proxy.
Page 32
pptpcd
PPTP client.
proxyacceptor
Proxy acceptor.
proxyworker
Proxy worker.
quarantined
Quarantine daemon.
radiusd
RADIUS daemon.
reportd
Report daemon.
reputation
scanunit
Scanning unit.
sflowd
sFlow daemon.
smtp
SMTP proxy.
snmpd
SNMP daemon.
sqldb
ssh
SSH proxy.
sslacceptor
SSL proxy.
sslworker
SSL proxy.
swctrl_authd
uploadd
Upload daemon.
urlfilter
wa_cs
wa_dbd
wad
wad_diskd
wccpd
WCCP daemon.
wpad
WPA daemon.
The <option> value depends from the application value used in the command. Here are some
examples:
Page 33
22
222
44
444
4444
44444
55
70
71
72
11
12
13
14
80
81
82
Page 34
10
11
12
13
14
15
IPSA statistics
97
98
99
Hardware NIC
Monitor hardware network operations using the following command:
diag hardware deviceinfo nic <interface>
The information displayed by this command is important as errors at the interface are indicative
of data link or physical layer issues which may impact the performance of the FortiGate unit.
The following is sample output when <interface> = internal:
System_Device_Name
Current_HWaddr
Permanent_HWaddr
Link
Speed
Duplex
[]
Rx_Packets=5685708
Tx_Packets=4107073
Rx_Bytes=617908014
Tx_Bytes=1269751248
Rx_Errors=0
Tx_Errors=0
Rx_Dropped=0
Tx_Dropped=0
[..]
port5
00:09:0f:68:35:60
00:09:0f:68:35:60
up
100
full
Page 35
The diag hardware deviceinfo nic command displays a list of hardware related error
names and values. The following table explains the items in the list and their meanings.
Table 3: Possible hardware errors and meanings
Field
Rx_Errors = rx error count
Rx_CRC_Errors +
Rx_Length_Errors Rx_Align_Errors
Rx_Dropped or
Rx_No_Buffer_Count
Rx_Missed_Errors
Definition
Bad frame was marked as error by PHY.
This error is only valid in 10/100M mode.
Page 36
Rx_Frame_Too_Longs
Rx_Frame_Too_Shorts
Rx_Align_Errors
Symbol Error Count
Definition
Counts defer events. A defer event occurs when the
transmitter cannot immediately send a packet due to the
medium being busy because another device is transmitting,
the IPG timer has not expired, half-duplex deferral events are
occurring, XOFF frames are being received, or the link is not
up. This register only increments if transmits are enabled.
This counter does not increment for streaming transmits that
are deferred due to TX IPG.
The Rx frame is over size.
The Rx frame is too short.
This error is only valid in 10/100M mode.
Counts the number of symbol errors between reads SYMERRS. The count increases for every bad symbol
received, whether or not a packet is currently being received
and whether or not the link is up. This register only
increments in internal SerDes mode.
Traffic trace
Traffic tracing allows a specific packet stream to be followed. This is useful to confirm packets
are taking the route you expected on your network.
View the characteristics of a traffic session though specific security policies using:
diag sys session
Trace per-packet operations for flow tracing using:
diag debug flow
Trace per-Ethernet frame using:
diag sniffer packet
Session table
A session is a communication channel between two devices or applications across the network.
Sessions enable FortiOS to inspect and act on a sequential group of packets in a session all
together instead of inspecting each packet individually. Each of these sessions has an entry in
the session table that includes important information about the session.
Use as a tool
Session tables are useful troubleshooting tools because they allow you to verify connections
that you expect to see open. For example, if you have a web browser open to browse the
Fortinet website, you would expect a session entry from your computer, on port 80, to the IP for
the Fortinet website. Another troubleshooting method is if there are too many sessions for
FortiOS to process, you can examine the session table for evidence why this is happening.
The FortiGate session table can be viewed from either the CLI or the web-based manager. The
most useful troubleshooting data comes from the CLI. The session table in web-based manager
also provides some useful summary information, particularly the current policy number that the
session is using.
Page 37
Session monitor
The session monitor is the session table. It lists the protocol used, source and destination
addresses, source and destination ports, what policy ID was matched (if any), how long until the
session expires, and how long it has been established.
If there is no policy ID listed in the session entry, the traffic originated from the FortiGate unit.
Otherwise all sessions must match a security policy to pass through the FortiGate unit. You can
specify a filter to show Forward Traffic only. To do this, click on the Edit icon (it looks like a
pencil)
As there are potentially many sessions active at one time, there are different methods you can
use to filter unimportant sessions out of your search. The easiest filter is to display only IPv4 or
IPv6 sessions. By default both are displayed.
Page 38
address. It can also tell you the security policy number it matches, so you can check what is
happening in that policy.
1. Know your connection information.
You need to be able to identify the session you want. For this you need the source IP
address (usually your computer), the destination IP address if you have it, and the port
number which is determined by the program being used. Some commons ports are:
port 80 (HTTP for web browsing),
port 22 (SSH used for secure login and file transfers)
port 23 (telnet for a text connection)
port 443 (HTTPS for secure web browsing
2. Find your session and policy ID.
Follow System > Dashboard> Top Sources to the session table monitor. Find your session by
finding your source IP address, destination IP address if you have it, and port number. The
policy ID is listed after the destination information. If the list of sessions is very long, you can
filter the list to make it easier to find your session.
3. When there are many sessions, use a filter to help you find your session.
If there are multiple pages of sessions it is difficult to find a single session. To help you in
your search you can use a filter to block out sessions that you dont want. Select the filter
icon next to Src Address. In the window that pops up, enter your source IP address and
select Apply. Now only sessions that originate from your IP address will be displayed in the
session table. If the list is still too long, you can do the same for the Src port. That will make
it easy to find your session and the security policy ID. When you are finished remember to
clear the filters.
Page 39
Sample Output:
FGT# diag sys session list
session info: proto=6 proto_state=05 expire=89 timeout=3600
flags=00000000 av_idx=0 use=3
bandwidth=204800/sec
guaranteed_bandwidth=102400/sec
traffic=332/sec prio=0 logtype=session ha_id=0 hakey=4450
tunnel=/
state=log shape may_dirty
statistic(bytes/packets/err): org=3408/38/0 reply=3888/31/0 tuples=2
orgin->sink: org pre->post, reply pre->post oif=3/5
gwy=192.168.11.254/10.0.5.100
hook=post dir=org act=snat
10.0.5.100:1251->192.168.11.254:22(192.168.11.105:1251)
hook=pre dir=reply act=dnat
192.168.11.254:22->192.168.11.105:1251(10.0.5.100:1251)
pos/(before,after) 0/(0,0), 0/(0,0)
misc=0 domain_info=0 auth_info=0 ftgd_info=0 ids=0x0 vd=0
serial=00007c33 tos=ff/ff
Since output can be verbose, the filter option allows specific information to be displayed, for
example:
diag sys session filter <option>
The <option> values available include the following:
clear
dintf
Destination interface.
dport
Destination port.
dst
Destination IP address.
duration
duration
expire
expire
negate
Inverse filter.
nport
nsrc
policy
Policy ID.
proto
Protocol number.
proto-state
Protocol state.
sintf
Source interface.
sport
Source port.
src
Source IP address.
vd
Page 40
Even though UDP is a sessionless protocol, the FortiGate unit still keeps track of the following
two different states:
UDP reply not seen with a value of 0
UDP reply seen with a value of 1
The following illustrates FW session states from the session table:
Table 4:
State
Meaning
log
local
ext
may_dirty
ndr
nds
br
Page 41
CLI method
When running multiple VDOMs, this command is run in the Global configuration only and it
searches for the named object both in the Global and VDOM configuration most recently used:
diag sys checkused <path.object.mkey>
For example, to verify which objects are referred to in a security policy with an ID of 1, enter the
command as follows:
diag sys checkused firewall.policy.policyid 1
To check what is referred to by interface port1, enter the following command:
diag sys checkused system.interface.name port1
Page 42
To show all the dependencies for an interface, enter the command as follows:
diag sys checkused system.interface.name <interface name>
Sample Output:
entry
entry
entry
entry
entry
entry
entry
entry
used
used
used
used
used
used
used
used
by
by
by
by
by
by
by
by
table
table
table
table
table
table
table
table
firewall.address:name '10.98.23.23_host
firewall.address:name 'NAS'
firewall.address:name 'all'
firewall.address:name 'fortinet.com'
firewall.vip:name 'TORRENT_10.0.0.70:6883'
firewall.policy:policyid '21'
firewall.policy:policyid '14'
firewall.policy:policyid '19'
In this example, the interface has dependent objects, including four address objects, one VIP,
and three security policies.
Flow trace
To trace the flow of packets through the FortiGate unit, use the following command:
diag debug flow trace start
Page 43
Enable the output to be displayed to the CLI console using the following command:
diag debug flow show console
diag debug flow output is recorded as event log messages and are sent to a
FortiAnalyzer unit if connected. Do not let this command run longer than necessary
since it generates significant amounts of data.
Start flow monitoring with a specific number of packets using this command:
diag debug flow trace start <N>
The following is an example of the flow trace for the device at the following IP address:
203.160.224.97
diag
diag
diag
diag
diag
debug
debug
debug
debug
debug
enable
flow filter addr 203.160.224.97
flow show console enable
flow show function-name enable
flow trace start 100
Page 44
Page 45
Page 46
Packet sniffing in the CLI is well suited for spot checking traffic from the CLI, but if you have
complex filters to enter it can be a lot of work to enter them each time. You can also save the
sniffing output; however, you must log to a file and then analyze the file later by hand.
Packet capture in the web-based manager makes it easy to set up multiple filters at once and
just run one or two as you need them. You also have controls to start and stop capturing as you
wish. Packet capture output is downloaded to your local computer as a *.pcap file which
requires a third party application to read the file, such as Wireshark. This method is useful to
send Fortinet support information to help resolve an issue.
Features
Packet sniffing
Packet capture
Command location
CLI
web-based manager
puTTY to log
plaintext output
Wireshark to read
*.pcap files
yes
no
no
yes
no
yes
no
no
yes
sniff IPv6
hard
easy
no
yes
easy
easy
easy
easy
Packet sniffing
Before you start sniffing packets on the CLI, you should be prepared to capture the output to a
file there can be huge amounts of data that you will not be able to see without saving it to a
file. One method is to use a terminal program like puTTY to connect to the FortiGate units CLI.
Then once the packet sniffing count is reached you can end the session and analyze the output
in the file.
Details within packets passing through particular interfaces can be displayed using the packet
sniffer with the following command:
diag sniffer packet <interface> <filter> <verbose> <count> <tsformat>
The <interface> value is required, with the rest being optional. If not included the default
values will be none.
For example the simplest valid sniffer command would be:
diag sniffer packet any
The <interface> value can be any physical or virtual interface name. Use any to sniff packets
on all interfaces.
Fortinet Technologies Inc.
Page 47
The <filter> value limits the display of packets using filters, including Berkeley Packet
Filtering (BPF) syntax. The <filter> value must be enclosed in quotes.
'[[src|dst] host <host_name_or_IP1>] [[src|dst] host
<host_name_or_IP2>] [[arp|ip|ip6|gre|esp|udp|tcp] [port_no]]
[[arp|ip|ip6|gre|esp|udp|tcp] [port_no]]
If a second host is specified in the filter, only the traffic between the two hosts will be displayed.
Optionally, you can use logical OR to match only one of the hosts, or match one of multiple
protocols or ports. When defining a port, there are up to two parts protocol and port number.
For example, to display UDP 1812 traffic or TCP 8080 traffic, use the following:
'udp port 1812 or tcp port 8080
To display all IP traffic that has a source of 192.168.1.2 and a destination of 192.168.2.3:
'ip src host 192.168.1.2 and dst host 192.168.2.3
The <verbose> option allows different levels of information to be displayed. The verbose levels
include:
1 Print header of packets
2 Print header and data from the IP header of the packets
3 Print header and data from the Ethernet header of the packets
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 with interface name
The <count> value indicates the number of packets to sniff before stopping. If this variable is
not included, or is set to zero, the sniffer will run until you manually halt it with Ctrl-C.
The <tsformat> value define the format of timestamp. It can be:
a: absolute UTC time, yyyy-mm-dd hh:mm:ss.ms
l: absolute LOCAL time, yyyy-mm-dd hh:mm:ss.ms
otherwise: relative to the start of sniffing, ss.ms
Packet capture
FortiOS 5 includes packet capture to the web-based manager. To configure packet capture
filters, go to System > Network > Packet Capture.
Page 48
When you add a packet capture filter, enter the following information and select OK.
Max Packets to
Capture
Enable Filters
Host(s)
Port(s)
VLAN(s)
Protocol
Include IPv6
packets
Capture Non-IP
packets
If you select a filter and go back to edit it, you have the added option of starting and stopping
packet capture in the edit window, or downloading the captured packets. You can also see the
filter status and the number of packets captured.
You can also select the filter and select Start to start capturing packets. While the filter is
running, you will see the number of captured packets increasing until it reaches the max packet
count or you select Stop. While the filter is running you cannot download the output file.
When the packet capture is complete, you can select Download to send the packet capture
filter captured packets to your local computer as a *.pcap file. To read this file format, you will
need to use Wireshark or a similar third party application. Using this tool you will have extensive
analytics available to you and the full contents of the packets that were captured.
Page 49
Sample output:
ID PORTS
-- ----0 port1
0 port2
0 port3
0 port4
ID PORTS
-- ----1 port5
1 port6
1 port7
1 port8
ID PORTS
-- ----2 port9
2 port10
2 port11
2 port12
ID PORTS
-- ----3 port13
3 port14
3 port15
3 port16
Sample output:
NP2 Fast Path Sniffer on port1 enabled
Fortinet Technologies Inc.
Page 50
This will cause all traffic on port1 of NP2 to be sent to the CPU meaning a standard sniffer trace
can be taken and other diag commands should work if it was a standard CPU driven port.
These commands are only for the newer NP2 interfaces. FA2 interfaces are more limited as the
sniffer will only capture the initial packets before the session is offloaded into HW (FA2). The
same holds true for the diag debug flow command as only the session setup will be shown,
however, this is usually enough for this command to be useful.
Debug command
Debug output provides continuous, real-time event information. Debugging output continues
until it is explicitly stopped or until the unit is rebooted. Debugging output can affect system
performance and will be continually generated even though output might not be displayed in the
CLI console.
Debug information displayed in the console will scroll in the console display and may prevent
CLI commands from being entered, for example, the command to disable the debug display. To
turn off debugging output as the display is scrolling by, press the key to recall the recent diag
debug command, press backspace, and type 0, followed by Enter.
Debug output display is enabled using the following command:
diag debug enable
When finished examining the debug output, disable it using:
diag debug disable
Once enabled, indicate the debug information that is required using this command:
diag debug <option> <level>
Debug command options include the following:
application
application
authd
Authentication daemon.
cli
Debug CLI.
cmdb-trace
Trace CLI.
console
crashlog
disable
enable
flow
fsso-polling
info
kernel
kernel
rating
Page 51
report
reset
rtmon
rtmon daemon
sql-log-error
urlfilter
urlfilter
The debug level can be set at the end of the command. Typical values are 2 and 3, for example:
diag debug application DHCPS 2
diag debug application spamfilter 2
Fortinet support will advise which debugging level to use.
Timestamps can be enabled to the debug output using the following command:
diag debug console timestamp enable
Sample Output:
FGh_FtiLog1: IPsec SA connect 0 192.168.11.2->192.168.10.201:500,
natt_mode=0 rekey=0 phase2=FGh_FtiLog1
FGh_FtiLog1: using existing connection, dpd_fail=0
FGh_FtiLog1: found phase2 FGh_FtiLog1
FGh_FtiLog1: IPsec SA connect 0 192.168.11.2 -> 192.168.10.201:500
negotiating
FGh_FtiLog1: overriding selector 225.30.5.8 with 192.168.11.2
FGh_FtiLog1: initiator quick-mode set pfs=1536...
FGh_FtiLog1: try to negotiate with 1800 life seconds.
FGh_FtiLog1: initiate an SA with selectors:
192.168.11.2/0.0.0.0->192.168.10.201, ports=0/0, protocol=0/0
Send IKE Packet(quick_outI1):192.168.11.2:500(if0) ->
192.168.10.201:500, len=348
Initiator: sent 192.168.10.201 quick mode message #1 (OK)
FGh_FtiLog1: set retransmit: st=168, timeout=6.
In this example:
192.168.11.2->192.168.10.201:500
Page 52
dpd_fail=0
pfs=1536...
Other commands
ARP table
To view the ARP cache, use the following command:
get sys arp
Sample output:
index=14 ifname=internal 224.0.0.5 01:00:5e:00:00:05 state=00000040
use=72203 confirm=78203 update=72203 ref=1
index=13 ifname=dmz 192.168.3.100 state=00000020 use=1843
confirm=650179 update=644179 ref=2
? VIP
index=13 ifname=dmz 192.168.3.109 02:09:0f:78:69:ff state=00000004
use=71743 confirm=75743 update=75743 ref=1
index=14 ifname=internal 192.168.11.56 00:1c:23:10:f8:20
state=00000004 use=10532 confirm=10532 update=12658 ref=4
To remove all entries associated with a particular interface, use this command:
diag ip arp flush <interface name>
Page 53
If all devices have the same time, it helps to correlate log entries from different devices.
IP address
There may be times when you want to verify the IP addresses assigned to the FortiGate unit
interfaces are what you expect them to be. This is easily accomplished from the CLI using the
following command.
diag ip address list
The output from this command lists the IP address and mask if available, the index of the
interface (a sort of ID number) and the devname is the name of the interface. While physical
interface names are set, virtual interface names can vary. Listing all the virtual interface names is
a good use of this command. For vsys_ha and vsys_fgfm, the IP addresses are the local host
these are internally used virtual interfaces.
# diag ip address list
IP=10.31.101.100->10.31.101.100/255.255.255.0 index=3 devname=internal
IP=172.20.120.122->172.20.120.122/255.255.255.0 index=5 devname=wan1
IP=127.0.0.1->127.0.0.1/255.0.0.0 index=8 devname=root
IP=127.0.0.1->127.0.0.1/255.0.0.0 index=11 devname=vsys_ha
IP=127.0.0.1->127.0.0.1/255.0.0.0 index=13 devname=vsys_fgfm
Other related commands include flushing the IP addresses (diag ip address flush), which
will force a reload of the IP addresses. This can be useful if you think an IP address is wrong and
dont want to reboot the unit. You can add or delete a single IP address (diag ip address
add <ipv4_addr> or diag ip address delete <ipv4_addr>).
FortiOS ports
In the TCP and UDP stacks, there are 65 535 ports available for applications to use when
communicating with each other. Many of these ports are commonly known to be associated
with specific applications or protocols. These known ports can be useful when troubleshooting
your network.
Page 54
Port(s)
Functionality
UDP 53
UDP 53 or
UDP 8888
UDP 53
(default) or
UDP 8888 and
UDP 1027 or
UDP 1031
UDP 123
NTP Synchronization
UDP 162
SNMP Traps
UDP 514
TCP 22
TCP 25
TCP 389 or
TCP 636
TCP 443
TCP 443
TCP 514
TCP 541
TCP 514
TCP 1812
RADIUS authentication
Page 55
FortiAnalyzer/FortiManager ports
If you have a FortiAnalyzer unit or FortiManager unit on your network you may need to use the
following ports for troubleshooting network traffic.
Table 6:
Functionality
Port(s)
DNS lookup
UDP 53
NTP synchronization
UDP 123
Windows share
UDP 137-138
SNMP traps
UDP 162
UDP 514
TCP 21 or TCP 22
TCP 25
RVS update
TCP 443
RADIUS authentication
TCP 1812
TCP 3000
FortiGuard troubleshooting
The FortiGuard service provides updates to Antivirus, IPsec, Webfiltering, and more. The
FortiGuard Distribution System (FDS) involves a number of servers across the world that
provide updates to your FortiGate unit. Problems can occur both with connection to FDS, and
its configuration on your local FortiGate unit. Some of the more common troubleshooting
methods are listed here including
Troubleshooting process for FortiGuard updates
FortiGuard server settings
FortiGuard URL rating
Page 56
2. If the device is part of an HA cluster, do all members of the cluster have the same level of
support?
As with the previous step, you can verify the support contract status for all the devices in
your HA cluster at the Fortinet Support website.
3. Have services been enabled on the device?
To see the FortiGuard information and status for a device, in the web-based manager go to
System > Config > FortiGuard. On that page you can verify the status of each component,
and if required enable each service. If there are problems, see the FortiGuard section of the
FortiOS Handbook.
4. Is the device able to communicate with FortiGuard servers?
At System > Config > FortiGuard you can also attempt to update AV and IPS, or test the
availability of WF and AS default and alternate ports. If there are problems, see the
FortiGuard section of the FortiOS Handbook.
5. Is there proper routing to reach the FortiGuard servers?
Ensure there is a static or dynamic route that enables your ForitGate unit to reach the
FortiGuard servers. Usually a generic default route to the internet is enough, but you may
need to verify this if your network is complex.
6. Are there issues with DNS?
An easy way to test this is to attempt a traceroute from behind the FortiGate unit to an
external network using the FQDN for a location. If the traceroute FQDN name does not
resolve, you have general DNS problems.
7. Is there anything upstream that might be blocking FortiGuard traffic, either on the network or
ISP side?
Many firewalls block all ports by default, and often ISPs block ports that are low. There may
be a firewall between the FortiGate unit and the FortiGuard servers that is blocking the
traffic. FortiGuard uses port 53 by default, so if it is being blocked you need to either open a
hole for it, or change the port it is using.
8. Is there an issue with source ports?
It is possible that ports used to contact FortiGuard are being changed before reaching
FortiGuard or on the return trip before reaching your FortiGate unit. A possible solution for
this is to use a fixed-port at NATd firewalls to ensure the port remains the same. Packet
sniffing can be used to find more information on what is happening with ports.
9. Are there security policies that include antivirus?
If no security policies include antivirus, the antivirus databse will not be updated. If antivirus
is included, only the database type used will be updated.
Page 57
Troubleshooting methodologies
Before you begin troubleshooting anything but the most minor issues, you need to prepare.
Doing so will shorten the time to solve your issue. This section helps to explain how you prepare
before troubleshooting, as well as creating a troubleshooting plan and contacting support.
This section contains the following topics:
Establish a baseline
Define the problem
Gathering Facts
Create a troubleshooting plan
Obtain any required additional equipment
Ensure you have administrator level access to required equipment
Contact Fortinet customer support for assistance
Establish a baseline
FortiGate units operate at all layers of the OSI model. For this reason troubleshooting problems
can become complex. If you establish a normal operation parameters, or baseline, for your
system before the problem occurs it will help reduce the complexity when you are
troubleshooting.
Many of the guiding questions in the following sections are some form of comparing the current
problem situation to normal operation on your FortiGate unit. For this reason it is a best practice
that you know what your normal operating status is, and have a record of it you can refer to.
This can easily be accomplished by monitoring the system performance with logs, SNMP tools,
or regularly running information gathering commands and saving the output. This regular
operation data will show trends, and enable you to see when changes happen and there may be
a problem.
Back up your FortiOS configuration on a regular basis. This is a good practice for
everyday as well as when troubleshooting. You can restore the backed up configuration
when needed and save the time and effort of re-creating it from the factory default
settings.
Some fundamental CLI commands you can use to obtain normal operating data for your
system:
Page 58
These commands are just a sample. Feel free to include any extra information gathering
commands that apply to your system. For example if you have active VPN connections, record
information about them using the get vpn * series of commands.
For an extensive snapshot of your system, run the CLI command used by TAC to gather
extensive information about a system exec tac report. It runs many diagnostic
commands that are for specific configurations. This means no matter what features you are
using, this command will record their current state. Then if you need to perform troubleshooting
at a later date, you can run the same command again and compare the differences to quickly
locate suspicious output you can investigate.
Page 59
Before you can solve a problem, you need to understand it. Often this step can be the longest in
this process.
Ask questions such as:
What is not working? Be specific.
Is there more than one thing not working?
Is it partly working? If so, what parts are working?
Is it a connectivity issue for the whole device, or is there an application that isnt reaching the
Internet?
Be as specific as possible with your answers, even if it takes awhile to find the answers.
These questions will help you define the problem. Once the problem is defined, you can search
for a solution and then create a plan on how to solve it.
Gathering Facts
Fact gathering is an important part of defining the problem. Record the following information as
it applies to the problem:
Where did the problem occur?
When did the problem occur and to whom?
What components are involved?
What is the affected application?
Can the problem be traced using a packet sniffer?
Can the problem be traced in the session table or using system debugging?
Can log files be obtained that indicate a failure has occurred?
Answers to these questions will help you narrow down the problem, and what you have to
check during your troubleshooting. The more things you can eliminate, the fewer things you
need to check during troubleshooting. For this reason, be as specific and accurate as you can
while gathering facts.
Page 60
Do not provide the output from exec tac report unless Support requests it. The output
from that command is very large and is not required in many cases.
For additional information about contacting Fortinet Customer Support, see Technical Support
Organization Overview on page 62.
All of this is your troubleshooting plan.
Page 61
Page 62
Creating an account
To receive technical support and service updates, Fortinet products in the organization must be
registered. The Product Registration Form on the support website will allow the registration to
be completed online. Creating an account on the support website is the first step in registering
products.
Go to the Fortinet support site shown below:
https://support.fortinet.com/
Figure 9: Customer service and support home page
Once the support account has been created, product details can be provided by going to the
Product Register/Renew and Manage Product buttons displayed on the home page. Alternately,
the product registration can be completed at a later time.
Registering a device
Complete the following steps when registering a device for support purposes:
1. Log in using the Username and Password defined when the account was created
2. Under the Asset section, select Register/Renew to go to the Registration Wizard.
Alternatively, use the Asset menu at the top of the page.
Figure 10:Register/Renew and Manage Products menu
3. Get a serial number from the back of the FortiGate unit or from the exterior of the FortiGate
shipping box.
Fortinet Technologies Inc.
Page 63
4. Enter the serial number, service contract registration code or license certificate number to
start the product registration.
Figure 11:Adding a product to a support account
Reporting problems
Problems can be reported to a Fortinet Technical Assistance Center in the following ways:
By logging an online ticket
By phoning a technical support center
Fortinet partners
Fortinet Partners are entitled to priority web-based technical support. This service is designed
for partners who provide initial support to their customers and who need to open a support
ticket with Fortinet on their behalf. We strongly encourage submission and follow up of support
tickets using this service.
The support ticket can be submitted after logging into the partner website using one of the
following links using FortiPartner account details:
http://partners.fortinet.com
This link will redirect to the general Fortinet Partner Portal extranet website. Click Support >
Online Support Ticket.
https://forticare.fortinet.com/customersupport/Login/CommonLogin.aspx
Page 64
Fortinet customers
There are two methods to report a technical issue on the Fortinet Support website: creating a
technical support ticket by product or creating any type of ticket with the Ticket Wizard for more
options.
Fortinet customers should complete the following steps to create a support ticket by product:
1. Log in to the support website at the following address with the account credentials used
when the account was created:
https://support.fortinet.com
2. Navigate to the top menu, click Asset and select Manage/View Products.
3. In the product list, select the product that is causing the problem.
4. On the left side bar, go to the Assistance category, and select Technical Request to create a
TA Ticket.
5. Complete the Create TA Ticket fields.
6. Click View Products.
7. In the Products List, select the product that is causing the problem.
8. Complete the Create Support Ticket fields.
9. Select Finish to complete the support ticket.
Fortinet customers who would like to submit a customer service ticket, DOA ticket, RMA ticket,
or FortiGuard service ticket should use the Ticket Wizard and complete the following steps:
1. Log in to the support website at the following address with the account credentials used
when the account was created:
https://support.fortinet.com
2. Navigate to the top menu, click Assistance and select Create a Ticket from the drop down
menu.
3. Select a ticket type and complete the remaining steps in the Ticket Wizard.
4. Select Finish to complete the ticket.
Page 65
Every web ticket update triggers a notification to the ticket owner, or ticket queue
supervisor.
Priority 1
This Critical priority is assigned to support cases in which:
The network or system is down causing customers to experience a total loss of service.
There are continuous or frequent instabilities affecting traffic-handling capability on a
significant portion of the network.
There is a loss of connectivity or isolation to a significant portion of the network.
This issue has created a hazard or an emergency.
Priority 2
This Major priority is assigned to support cases in which:
The network or system event is causing intermittent impact to end customers.
There is a loss of redundancy.
There is a loss of routine administrative or diagnostic capability.
Fortinet Technologies Inc.
Page 66
Priority 3
This Medium priority is assigned to support cases in which:
The network event is causing only limited impact to end customers.
Issues seen in a test or pre-production environment exist that would normally cause adverse
impact to a production network.
The customer is making time sensitive information requests.
There is a successful workaround in place for a higher priority issue.
Priority 4
This Minor priority is assigned to support cases in which:
The customer is making information requests and asking standard questions about the
configuration or functionality of equipment.
Customers must report Priority 1 and 2 issues by phone directly to the Fortinet EMEA Support
Center.
For lower priority issues, you may submit an assistance request (ticket) via the web system.
The web ticket system also provides a global overview of all ongoing support requests.
Page 67
Common questions
The general troubleshooting tips include, and can help answer the following questions.
How to verify the contents of the routing table (in NAT mode)
Are there routes in the routing table for default and static routes?
Do all connected subnets have a route in the routing table?
Does a route wrongly have a higher priority than it should?
Page 68
Page 69
Interface settings
If you can access the FortiGate unit with the management cable only, the first step is to display
the interface settings. To display the settings for the internal interface, use the following CLI
command:
FGT# show system interface <Interface_mane>
For a complete listing of all the possible interface settings, use the following CLI command:
config system interface
edit <Interface_name>
get
end
Page 70
Check the interface settings to ensure they are not preventing traffic. Specific things to check
include (only the web-based manager names are shown, CLI names may vary slightly):
Link Status Down until a valid cable is plugged into this interface, after which it will be
Up. The Link Status is shown physically by the connection LED for the interface. If it lights up
green, it is a good connection. If Link Status is Down, the interface does not work. Link
Status is also displayed on the System > Network > Interface screen by default.
Addressing mode Do not use DHCP if you dont have a DHCP server you will not be
able to logon to an interface in DHCP mode as it will not have an IP address.
IP/Netmask An interface needs an IP address to be able to connect to other devices.
Ensure there is a valid IP address in this field. The one exception is if DHCP is enabled for
this interface to get its IP address from an external DHCP server.
IPv6 address The same protocol must be used by both ends to complete the connection.
Ensure both this interface and the remote connection are both using IPv4 or both using IPv6
addressing.
Administrative access If no protocols are selected, you will have to use the local
management cable to connect to the unit. If you are using IPv6, configure the IPv6
administrative access protocols.
Administrative status Set to Up or the interface will not work.
DNS settings
While this section is not complicated, many networking problems can be traced back to DNS
problems. Things to check in this area include:
Are there values for both primary and secondary entries?
Is the local domain name correct?
Are you using IPv6 addressing? If so, are the IPv6 DNS settings correct?
Are you using Dynamic DNS (DDNS)? If so, is it using the correct server, credentials, and
interface?
Can you contact both DNS servers to verify the servers are operational?
If an interface addressing mode is set to DHCP and is set to override the internal DNS, is that
interface receiving a valid DNS entry from the DHCP server? Is it a reasonable address and
can it be contacted to verify its operational?
Are there any DENY security policies that need to allow DNS?
Can any internal device perform a successful traceroute to a location using the FQDN? See
Traceroute.
Page 71
Page 72
scanning will go into failopen mode where it will start dropping connections or bypass the
antivirus system.
The other lines of output, such as average network usage, average session setup rate, viruses
caught, and IPS attacks blocked can also help you determine why system resource usage it
high. For example, if network usage is high it will result in high traffic processing on the
FortiGate, or if the session setup rate is very low or zero the proxy may be overloaded and not
able to do its job.
Page 73
newcli
286
0.1
0.8
ipsengine
78
S <
0.0
3.1
ipsengine
64
S <
0.0
3.0
ipsengine
77
S <
0.0
3.0
ipsengine
68
S <
0.0
2.9
ipsengine
66
S <
0.0
2.9
ipsengine
79
S <
0.0
2.9
scanunitd
133
S <
0.0
1.8
pyfcgid
267
0.0
1.8
pyfcgid
269
0.0
1.7
pyfcgid
268
0.0
1.6
httpsd
139
0.0
1.6
pyfcgid
266
0.0
1.5
scanunitd
131
S <
0.0
1.4
scanunitd
132
S <
0.0
1.4
proxyworker
90
0.0
1.3
cmdbsvr
43
0.0
1.1
proxyworker
91
0.0
1.1
miglogd
55
0.0
1.1
httpsd
135
0.0
1.0
Page 74
Where the codes displayed on the second output line mean the following:
U is % of user space applications using CPU. In the example, 0U means 0% of the user
space applications are using CPU.
S is % of system processes (or kernel processes) using CPU. In the example, 0S means
0% of the system processes are using the CPU.
I is % of idle CPU. In the example, 98I means the CPU is 98% idle.
T is the total FortiOS system memory in Mb. In the example, 1977T means there are
1977 Mb of system memory.
F is free memory in Mb. In the example, 758F means there is 758 Mb of free memory.
KF is the total shared memory pages used. In the example, 180KF means the system is
using 180 shared memory pages.
Each additional line of the command output displays information for each of the processes
running on the FortiGate unit. For example, the third line of the output is:
newcli
286
0.1
0.8
Where:
newcli is the process name. Other process names can include ipsengine, sshd,
cmdbsrv, httpsd, scanunitd, and miglogd.
286 is the process ID. The process ID can be any number.
R is the current state of the process. The process state can be:
R running
S sleep
Z zombie
D disk sleep.
0.1 is the amount of CPU that the process is using. CPU usage can range from 0.0 for a
process that is sleeping to higher values for a process that is taking a lot of CPU time.
0.8 is the amount of memory that the process is using. Memory usage can range from
0.1 to 5.5 and higher.
Enter the following single-key commands when diagnose sys top is running:
Press q to quit and return to the normal CLI prompt.
Press p to sort the processes by the amount of CPU that the processes are using.
Press m to sort the processes by the amount of memory that the processes are using.
Page 75
Page 76
set udp-idle-timer 60
end
Enable only features that you need under System > Config > Features.
4. When CPU usage is under control, use SNMP to monitor CPU usage. Alternately, use
logging to record CPU and memory usage every 5 minutes.
Once things are back to normal, you should set up a warning system to alert you of future
CPU overusage. A common method to do this is with SNMP. SNMP monitors many values
on the FortiOS and allows you to set high water marks that will generate events. You run an
application on your computer to watch for and record these events. Go to System > Config >
SNMP to enable and configure an SNMP community. If this method is too complicated, you
can use the System Resources widget to record CPU usage. However, this method will not
alert you to problems - it will just record them as they happen.
Page 77
that can be useful in determining why particular services, such as email or web browsing, may
not be working properly.
If ping does not work, you likely have it disabled on at least one of the interface settings,
and security policies for that interface.
Both ping and traceroute require particular ports to be open on firewalls, or else they cannot
function. Since you typically use these tools to troubleshoot, you can allow them in the security
policies and on interfaces only when you need them, and otherwise keep the ports disabled for
added security.
Ping
The ping command sends a very small packet to the destination, and waits for a response. The
response has a timer that may expire, indicating the destination is unreachable. The behavior of
ping is very much like a sonar ping from a submarine, where the command gets its name.
Ping is part of Layer-3 on the OSI Networking Model. Ping sends Internet Control Message
Protocol (ICMP) echo request packets to the destination, and listens for echo response
packets in reply. However, many public networks block ICMP packets because ping can be
used in a denial of service (DoS) attack (such as Ping of Death or a smurf attack), or by an
attacker to find active locations on the network. By default, FortiGate units have ping enabled
while broadcast-forward is disabled on the external interface.
What ping can tell you
Beyond the basic connectivity information, ping can tell you the amount of packet loss (if any),
how long it takes the packet to make the round trip, and the variation in that time from packet to
packet.
If there is some packet loss detected, you should investigate the following:
Possible ECMP, split horizon, or network loops.
Cabling to ensure no loose connections.
Verify which security policy was used (use the packet count column on the Policy & Objects
> Policy page).
If there is total packet loss, you should investigate the following:
Hardware ensure cabling is correct, and all equipment between the two locations is
accounted for.
Addresses and routes ensure all IP addresses and routing information along the route is
configured as expected.
Firewalls ensure all firewalls, including FortiGate unit security policies allow PING to pass
through.
How to use ping
Ping syntax is the same for nearly every type of system on a network.
To ping from a FortiGate unit
1. Connect to the CLI either through telnet or through the CLI widget on the web-based
manager dashboard.
2. Enter exec ping 10.11.101.101 to send 5 ping packets to the destination IP address.
There are no options for this command.
Sample output:
Head_Office_620b # exec ping 10.11.101.101
Fortinet Technologies Inc.
Page 78
ms
ms
ms
ms
ms
--- 10.11.101.101 ping statistics --5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.2/0.2/0.3 ms
To ping from an MS Windows PC
1. Open a command window.
In Windows XP, select Start > Run, enter cmd, and select OK.
In Windows 7, select the Start icon, enter cmd in the search box, and select cmd.exe
from the list.
2. Enter ping 10.11.101.100 to ping the default internal interface of the FortiGate unit with
four packets.
Other options include:
-t to send packets until you press Control-C
-a to resolve addresses to domain names where possible
-n X to send X ping packets and stop
Sample output:
C:\>ping 10.11.101.101
Pinging 10.11.101.101 with 32 bytes of data:
Reply from 10.11.101.101: bytes=32 time=10ms TTL=255
Reply from 10.11.101.101: bytes=32 time<1ms TTL=255
Reply from 10.11.101.101: bytes=32 time=1ms TTL=255
Reply from 10.11.101.101: bytes=32 time=1ms TTL=255
Ping statistics for 10.11.101.101:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 10ms, Average = 3ms
To ping from a Linux PC
1. Go to a shell prompt.
2. Enter ping 10.11.101.101.
Traceroute
Where ping will only tell you if it reached its destination and came back successfully, traceroute
will show each step of its journey to its destination and how long each step takes. If ping finds
an outage between two points, traceroute can be used to locate exactly where the problem is.
What is traceroute
Traceroute works by sending ICMP packets to test each hop along the route. It will send out
three packets, and then increase the time to live (TTL) setting by one each time. This effectively
allows the packets to go one hop farther along the route. This is the reason why most traceroute
commands display their maximum hop count before they start tracing the route that is the
maximum number of steps it will take before declaring the destination unreachable. Also, the
Page 79
TTL setting may result in steps along the route timing out due to slow responses. There are
many possible reasons for this to occur.
By default, traceroute uses UDP datagrams with destination ports numbered from 33434 to
33534. The traceroute utility usually has an option to specify use of ICMP echo request (type 8)
instead, as used by the Windows tracert utility. If you have a firewall and if you want traceroute
to work from both machines (Unix-like systems and Windows) you will need to allow both
protocols inbound through your FortiGate security policies (UDP with ports from 33434 to
33534 and ICMP type 8).
You can also use the packet count column of the Policy & Objects > Policy page to track
traceroute packets. This allows you to verify the connection, but also confirm which security
policy the traceroute packets are using.
What traceroute can tell you
Ping and traceroute have similar functionsto verify connectivity between two points. The big
difference is that traceroute shows you each step of the way, where ping does not. Also, ping
and traceroute use different protocols and ports, so one may succeed where the other fails.
You can verify your DNS connection using traceroute. If you enter an FQDN instead of an IP
address for the traceroute, DNS will try to resolve that domain name. If the name does not get
resolved, you know you have DNS issues.
How to use traceroute
The traceroute command varies slightly between operating systems. Note that in MS Windows
the command name is shortened to tracert. Also, your output will list different domain
names and IP addresses along your route.
To use traceroute on an MS Windows PC
1. Open a command window.
In Windows XP, select Start > Run, enter cmd, and select OK.
In Windows 7, select the Start icon, enter cmd in the search box, and select cmd.exe
from the list.
2. Enter tracert fortinet.com to trace the route from the PC to the Fortinet web site.
Sample output:
C:\>tracert fortinet.com
Tracing route to fortinet.com [208.70.202.225]
over a maximum of 30 hops:
1
<1 ms
<1 ms
<1 ms 172.20.120.2
2
66 ms
24 ms
31 ms 209-87-254-xxx.storm.ca [209.87.254.221]
3
52 ms
22 ms
18 ms core-2-g0-0-1104.storm.ca [209.87.239.129]
4
43 ms
36 ms
27 ms core-3-g0-0-1185.storm.ca [209.87.239.222]
5
46 ms
21 ms
16 ms te3-x.1156.mpd01.cogentco.com
[38.104.158.69]
6
25 ms
45 ms
53 ms te8-7.mpd01.cogentco.com [154.54.27.249]
7
89 ms
70 ms
36 ms te3-x.mpd01.cogentco.com [154.54.6.206]
8
55 ms
77 ms
58 ms sl-st30-chi-.sprintlink.net [144.232.9.69]
9
53 ms
58 ms
46 ms sl-0-3-3-x.sprintlink.net [144.232.19.181]
10
82 ms
90 ms
75 ms sl-x-12-0-1.sprintlink.net
[144.232.20.61]
11
122 ms
123 ms
132 ms sl-0-x-0-3.sprintlink.net
[144.232.18.150]
12
129 ms
119 ms
139 ms 144.232.20.7
Page 80
13
172 ms
164
[144.223.243.58]
14
99 ms
94
15
108 ms
102
16
98 ms
95
ms
243 ms
ms
ms
ms
93 ms
89 ms
97 ms
sl-321313-0.sprintlink.net
203.78.181.18
203.78.176.2
208.70.202.225
Trace complete.
The first, or the left column, is the hop count, which cannot go over 30 hops. When that number
is reached, the traceroute ends.
The second, third, and fourth columns display how much time each of the three packets takes
to reach this stage of the route. These values are in milliseconds and normally vary quite a bit.
Typically a value of <1ms indicates a local connection.
The fifth, or the column farthest to the right, is the domain name of that device and its IP
address or possibly just the IP address.
To perform a traceroute on a Linux PC
1. Go to a command line prompt.
2. Enter traceroute fortinet.com.
The Linux traceroute output is very similar to the MS Windows tracert output.
To perform a traceroute from the FortiGate
1. Connect to the CLI either through telnet or through the CLI widget on the web-based
manager dashboard.
2. Enter exec traceroute www.fortinet.com to trace the route to the destination IP
address. There are no options for this command.
Output appears as follows:
# execute traceroute www.fortinet.com
traceroute to www.fortinet.com (66.171.121.34), 32 hops max, 84 byte
packets
1 172.20.120.2 0.637 ms 0.653 ms 0.279 ms
2 209.87.254.221 <static-209-87-254-221.storm.ca> 2.448 ms 2.519 ms
2.458 ms
3 209.87.239.129 <core-2-g0-2.storm.ca> 2.917 ms 2.828 ms 9.324 ms
4 209.87.239.199 <core-3-bdi1739.storm.ca> 13.248 ms 12.401 ms
13.009 ms
5 216.66.41.113 <v502.core1.tor1.he.net> 17.181 ms 12.422 ms 12.268
ms
6 184.105.80.9 <100ge1-2.core1.nyc4.he.net> 21.355 ms 21.518 ms
21.597 ms
7 198.32.118.41 <ny-paix-gni.twgate.net> 83.297 ms 84.416 ms 83.782
ms
8 203.160.228.217 <217-228-160-203.TWGATE-IP.twgate.net> 82.579 ms
82.187 ms 82.066 ms
9 203.160.228.229 <229-228-160-203.TWGATE-IP.twgate.net> 82.055 ms
82.455 ms 81.808 ms
10 203.78.181.2 82.262 ms 81.572 ms 82.015 ms
11 203.78.186.70 83.283 ms 83.243 ms 83.293 ms
12 66.171.127.177 84.030 ms 84.229 ms 83.550 ms
13 66.171.121.34 <www.fortinet.com> 84.023 ms 83.903 ms 84.032 ms
14 66.171.121.34 <www.fortinet.com> 83.874 ms 84.084 ms 83.810 ms
Page 81
How to verify the contents of the routing table (in NAT mode)
When you have some connectivity, or possibly none at all a good place to look for information is
the routing table.
The routing table is where all the currently used routes are stored for both static and dynamic
protocols. If a route is in the routing table, it saves the time and resources of a lookup. If a route
is not used for a while and a new route needs to be added, the oldest least used route is
bumped if the routing table is full. This ensures the most recently used routes stay in the table. If
your FortiGate unit is in Transparent mode, you are unable to perform this step.
If the FortiGate is running in NAT mode, verify that all desired routes are in the routing table:
local subnets, default routes, specific static routes, and dynamic routing protocols.
To check the routing table in the web-based manager, use the Routing Monitor by going to
Router > Monitor > Routing Monitor.
In the CLI, use the command get router info routing-table all. Sample output:
FGT# get router info routing-table all
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP
O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS
inter area
Fortinet Technologies Inc.
Page 82
* - candidate default
S*
C
C
<1 ms
<1 ms
3 ms
10.10.1.99
172.20.120.2
static-209-87-254-221.storm.ca
3 ms core-2-g0-2.storm.ca [209.87.239.129]
13 ms core-3-bdi1739.storm.ca [209.87.239.199]
11 ms v502.core1.tor1.he.net [216.66.41.113]
21 ms 100ge1-2.core1.nyc4.he.net
84 ms
82 ms
ny-paix-gni.twgate.net [198.32.118.41]
217-228-160-203.TWGATE-IP.twgate.net
82 ms
229-228-160-203.TWGATE-IP.twgate.net
82
83
85
84
83
203.78.181.2
203.78.186.70
66.171.127.177
fortinet.com [66.171.121.34]
fortinet.com [66.171.121.34]
ms
ms
ms
ms
ms
Trace complete.
In this scenario, the first hop contains the IP address 10.10.1.99, which is the internal
interface of the FortiGate. The second hop contains the IP address 172.20.120.2, to which
the wan1 interface of the FortiGate is connected, so we can conclude that the route via wan1
interface is being used for this traffic.
Also debug the packet flow in the CLI shows the route taken for each session.
Sample output:
id=20085 trace_id=319 func=vf_ip4_route_input line=1597 msg="find a
route: gw-172.20.120.2 via wan1"
For more information on debuging the packet flow, see How to debug the packet flow.
Page 83
Also debuging the packet flow in the CLI shows the policy id allowing the traffic.
Sample output:
id=13 trace_id=1 func=fw_forward_handler line=650 msg="Allowed by
Policy-14: SNAT"
For more information on debuging the packet flow, see How to debug the packet flow.
used=6
num=7
depth=2
simple=no
Total 1 bridges
Page 84
To list the existing bridge MAC table, use the following command:
diagnose netlink brctl name host <name>
Sample output
show bridge control interface root.b host.
fdb: size=256, used=6, num=7, depth=2, simple=no
Bridge root.b host table
port no device
2
7
5
6
3
8
4
9
3
8
4
9
1
3
devname
wan2
vlan_1
dmz
internal
dmz
internal
wan1
mac addr
02:09:0f:78:69:00
02:09:0f:78:69:01
02:09:0f:78:69:01
02:09:0f:78:69:02
00:80:c8:39:87:5a
02:09:0f:78:67:68
00:09:0f:78:69:fe
ttl
0
0
0
0
194
8
0
attributes
Local Static
Local Static
Local Static
Local Static
Local Static
Page 85
behavior when memory is running low or the proxy connection limit has been reached. There
are two related commands for this in the CLI:
config system global
set av-failopen-session {enable | disable}
set av-failopen { idledrop | off | one-shot | pass}
end
av-failopen-session must be enabled to set the behavior for these conditions. When it is
enabled, and a proxy for a protocol runs out of room in its session table that protocol goes into
failopen mode and behaves as defined in the av-failopen command.
av-failopen determines the behavior of the proxy until entries are free in the session table
again for that proxy.
idledrop This option removes idle sessions from the session table, starting with the
clients that have the most sessions currently open. This method assumes that idle sessions
are not being used and it will not cause problems to close these sessions. This is usually
true, but some applications may have problems with this and start complaining about either
not having or being able to open a session. If this occurs, try another method to check if this
is really the problem. This is a secure option as no unscanned traffic is allowed to pass.
off This option turns off accepting any new AV sessions, but will continue to process any
existing AV sessions that are currently active. All the protocols listed (HTTP, SMTP, POP3,
IMAP, FTP, and NNTP) are scanned by FortiGate Antivirus. If AV scanning is enabled,
av-failopen off is selected, and the proxy session table fills up, then no new sessions of that
type will be accepted. For example, if POP3 session table is filled and email AV scanning is
enabled, no more POP3 connections will be allowed until the session table gets some free
space. This is a secure option because no unscanned traffic is allowed to pass.
one-shot When memory is low, bypass the antivirus system. The name one-shot comes
from the fact that once you are in one-shot av-failopen mode, you must set av-failopen to
either pass or off to restart AV scanning. This is a very unsecure option because it allows all
traffic without AV scanning, and it never reverts to normal without manual assistance.
pass When memory is low, bypass the antivirus system much as one-shot. The difference
is that when memory is freed up, the system will start AV scanning automatically again. This
is an unsecure option because it allows traffic to pass without AV scanning. However, it is
better than one-shot because it automatically restarts AV scanning when possible.
If the proxy session table is full for one or more protocols and your FortiGate unit enters into
conserve or failopen mode, it will appear as if you have lost connections, network services are
intermittent or non-existent, and yet other services work normally for a while until their sessions
end and they join the queue of session-starved applications.
Page 86
Worker[0]
HTTP Common
Current Connections
Max Concurrent Connections
Worker Stat
Running time (HH:MM:SS:usec)
Time in loop scanning
Error Count (accept)
Error Count (read)
Error Count (write)
Error Count (poll)
Error Count (alloc)
Last Error
Acceptor Read
Acceptor Write
Acceptor Close
HTTP Stat
Bytes sent
Bytes received
Error Count (alloc)
Error Count (accept)
Error Count (bind)
Error Count (connect)
Error Count (socket)
Error Count (read)
Error Count (write)
Error Count (retry)
Error Count (poll)
Error Count (scan reset)
Error Count (urlfilter wait)
Last Error
Web responses clean
Web responses scan errors
Web responses detected
Web responses infected with worms
Web responses infected with viruses
Web responses infected with susp
Web responses file blocked
Web responses file exempt
Web responses bannedword detected
Web requests oversize pass
Web requests oversize block
Last Server Scan errors
URL requests exempt
URL requests blocked
URL requests passed
URL requests submit error
URL requests rating error
URL requests rating block
URL requests rating allow
URL requests infected with worms
Web requests detected
Web requests file blocked
Fortinet Technologies Inc.
Page 87
8/8032
76
29:06:27:369365
2:08:000198
0
0
0
0
0
0
6386
19621
0
667012 (kb)
680347 (kb)
0
0
0
0
0
134
0
40
0
2
3
104
17950
23
16
0
0
0
0
0
0
16
0
102
0
0
0
0
0
0
10025
0
0
0
FortiOS Handbook - Troubleshooting for FortiOS 5.0
0
512
0
0
0
0
0
0
0
0
0
Worker Accounting
poll=721392/649809/42 pollfail=0 cmdb=85 scan=19266 acceptor=25975
HTTP Accounting
setup_ok=8316 setup_fail=0 conn_ok=0 conn_inp=8316
urlfilter=16553/21491/20 uf_lookupf=0
scan=23786 clt=278876 srv=368557
SMTP Accounting
setup_ok=12 setup_fail=0 conn_ok=0 conn_inp=12
scan=12 suspend=0 resume=0 reject=0 spamadd=0 spamdel=0 clt=275
srv=279
POP3 Accounting
setup_ok=30 setup_fail=0 conn_ok=0 conn_inp=30
scan=3 clt=5690 srv=5836
IMAP Accounting
setup_ok=0 setup_fail=0 conn_ok=0 conn_inp=0
scan=0 clt=0 srv=0
FTP Accounting
setup_ok=0 setup_fail=0 conn_ok=0 conn_inp=0
scan=0 clt=0 srv=0 datalisten=0 dataclt=0 datasrv=0
NNTP Accounting
setup_ok=0 setup_fail=0 conn_ok=0 conn_inp=0
scan=0 clt=0 srv=0
The output from this command falls into the following sections:
HTTP Common current connections There is an entry for each protocol that displays
the connections currently used, and the maximum connections allowed. This maximum is for
the UTM proxy, which means all the protocols connections combined cannot be larger than
this number. To support this, note that the maximum session count for each protocol is the
same. You may also see a line titled Max Concurrent Connections for each protocol.
This number is the maximum connections of this type allowed at one time. If VDOMs are
enabled, this value is defined either on the global or per-VDOM level at VDOM > Global
Resources or in the CLI at config system resource-limits.
Worker Stat This is statistics about the UTM proxy including how long it has been
running, and how many errors it has found.
HTTP Stat This section includes statistics about the HTTP protocol proxy. This is a very
extensive list covering errors, web responses, and any UTM positive matches. There are
Fortinet Technologies Inc.
Page 88
similar sections for each protocol, but the specific entries in each vary based on what UTM
scanning is looking for in each spam control for email, file transfer blocking for FTP, and
so on.
Worker Accounting Lists accounting information about the UTM proxy such as polling
statistics, how many sessions were scanned, and how many were just accepted. This
information can tell you if expect AV scanning is taking place or not. Under normal operation
there should be no errors or fails.
HTTP Accounting The accounting sections for each protocol provide information about
successful session creation, failures, how many sessions are being scanned or filtered, and
how many are client or server originated. If setup_fail is larger than zero, run the command
again to see if it is increasing quickly. If it is, your FortiGate unit may be in conserve mode.
Related commands
To dump memory usage:
# get test proxyworker 1
To display statistics per VDOM:
# get test proxyworker 4444
To restart the proxy:
# get test proxyworker 99
Page 89
Page 90
Sample output:
FG100D# execute ping service.fortiguard.net
PING guard.fortinet.net (208.91.112.196): 56 data bytes
64 bytes from 208.91.112.196: icmp_seq=0 ttl=51 time=61.0
64 bytes from 208.91.112.196: icmp_seq=1 ttl=51 time=60.0
64 bytes from 208.91.112.196: icmp_seq=2 ttl=51 time=59.6
64 bytes from 208.91.112.196: icmp_seq=3 ttl=51 time=58.9
64 bytes from 208.91.112.196: icmp_seq=4 ttl=51 time=59.2
ms
ms
ms
ms
ms
--- guard.fortinet.net ping statistics --5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 58.9/59.7/61.0 ms
FG100D# execute ping update.fortiguard.net
PING fds1.fortinet.com (208.91.112.68): 56 data bytes
64 bytes from 208.91.112.68: icmp_seq=0 ttl=53 time=62.0
64 bytes from 208.91.112.68: icmp_seq=1 ttl=53 time=61.8
64 bytes from 208.91.112.68: icmp_seq=2 ttl=53 time=61.3
64 bytes from 208.91.112.68: icmp_seq=3 ttl=53 time=61.9
64 bytes from 208.91.112.68: icmp_seq=4 ttl=53 time=61.8
ms
ms
ms
ms
ms
Page 91
<interface_name>
<filter>
<verbose>
<count>
For a simple sniffing example, enter the CLI command diag sniffer packet port1 none
1 3. This will display the next three packets on the port1 interface using no filtering, and using
verbose level 1. At this verbosity level you can see the source IP and port, the destination IP and
port, action (such as ack), and sequence numbers.
In the output below, port 443 indicates these are HTTPS packets, and 172.20.120.17 is both
sending and receiving traffic.
Head_Office_620b # diag sniffer packet port1 none 1 3
interfaces=[port1]
filters=[none]
0.545306 172.20.120.17.52989 -> 172.20.120.141.443: psh 3177924955
ack 1854307757
0.545963 172.20.120.141.443 -> 172.20.120.17.52989: psh 1854307757
ack 3177925808
0.562409 172.20.120.17.52988 -> 172.20.120.141.443: psh 4225311614
ack 3314279933
For a more advanced example of packet sniffing, the following commands will report packets
on any interface travelling between a computer with the host name of PC1 and the computer
with the host name of PC2. With verbosity 4 and above, the sniffer trace will display the
interface names where traffic enters or leaves the FortiGate unit. Remember to stop the sniffer,
type CTRL+C.
FGT# diagnose sniffer packet any "host <PC1> or host <PC2>" 4
or
FGT# diagnose sniffer packet any "(host <PC1> or host <PC2>) and
icmp" 4
Page 92
The following sniffer CLI command includes the ARP protocol in the filter which may be useful
to troubleshoot a failure in the ARP resolution (for instance PC2 may be down and not
responding to the FortiGate ARP requests).
FGT# diagnose sniffer packet any "host <PC1> or host <PC2> or arp" 4
Packet Capture
When troubleshooting networks, it helps to look inside the header of the packets. This helps to
determine if the packets, route, and destination are all what you expect. Packet capture can
also be called a network tap, packet sniffing, or logic analyzing.
To use the packet capture:
1. Go to System > Network > Packet Capture.
2. Select the interface to monitor and select the number of packets to keep.
3. Select Enable Filters.
4. Enter the information you want to gather from the packet capture.
5. Select OK.
To run the capture, select the play button in the progress column in the packet capture list. If
not active, Not Running will also appear in the column cell. The progress bar will indicate the
status of the capture. You can stop and restart it at any time.
When the capture is complete, click the Download icon to save the packet capture file to your
hard disk for further analysis.
Packet capture tells you what is happening on the network at a low level. This can be very
useful for troubleshooting problems, such as:
Finding missing traffic.
Seeing if sessions are setting up properly.
Locating ARP problems such as broadcast storm sources and causes.
Confirming which address a computer is using on the network if they have multiple addresses
or are on multiple networks.
Confirming routing is working as you expect.
Wireless client connection problems.
Intermittent missing PING packets.
A particular type of packet is having problems, such as UDP, which is commonly used for
streaming video.
If you are running a constant traffic application such as ping, packet capture can tell you if the
traffic is reaching the destination, how the port enters and exits the FortiGate unit, if the ARP
resolution is correct, and if the traffic is returning to the source as expected. You can also use
packet switching to verify that NAT or other configuration is translating addresses or routing
traffic the way that you want it to.
Before you start capturing packets, you need to have a good idea of what you are looking for.
Capture is used to confirm or deny your ideas about what is happening on the network. If you
try capture without a plan to narrow your search, you could end up with too much data to
effectively analyze. On the other hand, you need to capture enough packets to really
understand all of the patterns and behavior that you are looking for.
Page 93
diag
diag
diag
diag
diag
diag
debug
debug
debug
debug
debug
debug
disable
flow filter add <PC1>
flow show console enable
flow show function-name enable
flow trace start 100
enable
The start 100 argument in the above list of commands will limit the output to 100 packets
from the flow. This is useful for looking at the flow without flooding your log or displaying too
much information.
The following is an example of debug flow output for traffic that has no matching security policy,
and is in turn blocked by the FortiGate unit. The denied message indicates that the traffic was
blocked.
id=20085 trace_id=319 func=resolve_ip_tuple_fast line=2825
msg="vd-root received a packet(proto=6,
192.168.129.136:2854->192.168.96.153:1863) from port3."
id=20085 trace_id=319 func=resolve_ip_tuple line=2924 msg="allocate
a new session-013004ac"
id=20085 trace_id=319 func=vf_ip4_route_input line=1597 msg="find a
route: gw-192.168.150.129 via port1"
id=20085 trace_id=319 func=fw_forward_handler line=248 msg=" Denied
by forward policy check"
Page 94
Index
A
accelerated interfaces 94
Administrative Status 70
anti-spoofing 91
ARP
cache 53
duplicate packets 84
resolution 93
asymmetric routing 91
av-failopen 85
B
Berkeley Packet Filtering (BPF) 48
brctl,netlink 85
bridge, Trasnparent mode 84
C
collision domain 84
connectionless 9
conserve mode 85
CPU usage 72
D
date 29, 54
debug flow 94
default
password 7
Define the problem 58
Denial of Service (DoS) 14
diagnose commands
diag debug 94
diag netlink 85
domain name server (DNS) 77
Duplicate ARP packet 84
I
ICAP 15
identify-based policies 15
inspection
flow 10
flow-based 10
proxy 11
security layers 12
stateful 8
interface
accelerated NP2 94
link status 70
pairs 94
Internet Control Message Protocol (ICMP) 78
IP stack validation 13
L
layer 4 13
Layer-2 84
Layer-3 78
LDAP 55
life of a packet 8
UDP 8
link status 70
Linux 79, 81
Establish a baseline 58
MAC table 85
memory usage 72
middle-man 15
MS Windows 80
netlink 85
Network Time Protocol (NTP) 30, 55
NP2 interface 94
O
OSI
Layer-2 84
Layer-3 78
P
packet
flow 12, 94
life of 8
sniffer 91
Page 95
Packet verification 13
password
administrator 7
ping 78
ports
port 1024 57
port 1025 57
port 443 92
port 53 57
port 8888 57
UDP ports 33434-33534 80
problem scope 59
proxy inspection 11
RADIUS 55
Return Material Authorization (RMA) 67
Reverse Path Forwarding (RPF) 91
Round Trip Time (RTT) 57
routing
bridge 84
routing table 14
security layers 12
Session creation 13
session helper 15
session tables 15
signature-based IPS 14
UDP 8
V
VDOM 41, 42, 61, 88
Verifications of IP options 13
Page 96