Documente Academic
Documente Profesional
Documente Cultură
Diagnostics
FortiGate 5.4.1
© Copyright Fortinet Inc. All rights reserved. Last Modified: Wednesday, April 29, 2020
1
Objectives
• Identify your network’s normal behavior
• Monitor for abnormal behavior such as traffic spikes
• Diagnose problems at the physical and network layers
• Diagnose connectivity problems using the debug flow
• Diagnose resource problems, such as high CPU or memory usage
• Load a firmware image from the BIOS menu
• Run the hardware tests
2
Before Problems Occur
• Know what normal is (baseline) Abnormal
o CPU usage
o Memory usage
o Traffic volume
o Traffic directions
o Protocols and port numbers
o Traffic pattern and distribution
• Why? Now
Baseline (Average)
o Abnormal behavior is difficult to determine – Normal Range
3
What is Normal?
Network Diagrams
• Why? port2
192.168.5.1/30
o Explaining or analyzing complex
port1
networks is difficult and time- 10.0.30.1/24
port2
consuming without them 192.168.3.1/30
devices
5
Monitoring Traffic Flows and Resource Usage
• Get normal data before problems or complaints
• Tools:
o FortiView
o SNMP
o Alert email
o Logging / Syslog / FortiAnalyzer
o Dashboard
o CLI debug commands
Traffic
spikes
6
Diagnosis
System Information
# get system status
8
Physical Layer Information
# get hardware nic <port>
Name: port1
Driver: vmxnet3
Version: 1.1.29.0-k-NAPI
Hwaddr: 00:0c:29:04:60:1b
Permanent Hwaddr:00:0c:29:04:60:1b
State: up
Link: up
Mtu: 1500
Supported: 1000full 10000full
...
Auto: disabled
Rx packets: 11827
Rx bytes: 16243808
Rx dropped: 0
Rx errors: 0
...
Tx packets: 7175
Tx bytes: 761511
Tx dropped: 0
Tx errors: 0
Multicasts: 34
Collisions: 0
9
SFP/SFP+ Received Signal Strength
# get system interface transceiver
Interface port3 - SFP/SFP+
Vendor Name : xxxx
Part No. : xxxx
Serial No. : xxxx
Interface port4 - SFP/SFP+
Vendor Name : xxxx
Part No. : xxxx
Serial No. : xxxx
Optical Optical Optical
Temperature Voltage Tx Bias Tx Power Rx Power
SFP Intf Part No. (Celsius) (Volts) (mA) (dBm) (dBm)
-------- -------- ----------- ------ -------- -------- --------
port3 xxxx 40.2 3.27 7.1 -2.27 -12.8
port4 xxxx 37.6 3.28 6.7 -2.29 -inf
10
ARP Table
# diagnose ip arp list
11
Network Layer Troubleshooting
# execute ping-options
data-size Integer value to specify datagram size in bytes.
df-bit Set DF bit in IP header <yes | no>.
interval Integer value to specify seconds between two pings.
repeat-count Integer value to specify how many times to repeat PING.
source Auto | <source interface IP>.
timeout Integer value to specify timeout in seconds.
tos IP type-of-service option.
ttl Integer value to specify time-to-live.
12
Debug Flow
Debug Flow
• Shows what the CPU is doing step-by-step with the packets
o If a packet is dropped, it shows the reason
• Multi-step command
1. Enable console output: diagnose debug flow show console enable
2. Specify the filter: diagnose debug flow filter <filter>
3. Enable debug output: diagnose debug enable
4. Start the trace: diag debug flow trace start [number_of_packets]
5. Stop the trace: diagnose debug flow trace stop
14
Debug Flow Example: SYN
15
Debug Flow Example: SYN/ACK
IP
IP addresses,
addresses, port
port numbers
numbers
id=2 line=4677 msg="vd-root received a packet(proto=6, and
and incoming
incoming interface
interface
66.171.121.44:80->10.200.1.1:49886) from port1. flag
[S.], seq 3567496940, ack 2176715502, win 5840"
Using
Using an
an existing
existing session
session
id=2 line=4739 msg="Find an existing session, id-
00007fc0, reply direction"
Destination
Destination NAT
NAT
id=2 line=2733 msg="DNAT 10.200.1.1:49886-
>10.0.1.10:49886"
16
CPU and Memory
Slowness
• High CPU usage
• High memory usage
18
CPU and Memory Usage
# get system performance status
CPU states: 4% user 13% system 0% nice 83% idle
CPU0 states: 3% user 13% system 0% nice 84% idle CPU usage
CPU1 states: 5% user 13% system 0% nice 82% idle
CPU2 states: 2% user 13% system 0% nice 85% idle
CPU3 states: 6% user 13% system 0% nice 81% idle RAM usage
Memory states: 19% used
Average network usage: 12740 kbps in 1 minute, 3573 kbps in 10 minutes,
1077 kbps in 30 minutes
Average sessions: 118 sessions in 1 minute, 11 sessions in 10 minutes, 40
sessions in 30 minutes
Average session setup rate: 11 sessions per second in last 1 minute, 0
sessions per second in last 10 minutes, 1 sessions per second in last
30 minutes Network usage
Virus caught: 3 total in 1 minute
IPS attacks blocked: 64 total in 1 minute
Uptime: 60 days, 9 hours, 58 minutes
19
High CPU and Memory Troubleshooting
# diagnose sys top
Run Time: 0 days, 0 hours and 18 minutes
1U, 4N, 0S, 95I, 0WA, 0HI, 0SI, 0ST; 994T, 421F
pyfcgid 248 S 2.9 3.8
newcli 251 R 0.1 1.0
merged_daemons 185 S 0.1 0.7
miglogd 177 S 0.0 6.8
pyfcgid 249 S 0.0 3.0
pyfcgid 246 S 0.0 2.8
reportd 197 S 0.0 2.7 Memory usage (%)
cmdbsvr 113 S 0.0 2.4
Process Name
CPU usage (%)
Sort by CPU: Shift + P Process ID Process State
Sort by RAM: Shift + M
20
Process States
Normal D R
• S: Sleeping
• R: Running Z
• D: Do not Disturb; waiting on
something to finish, likely
disk I/O
Abnormal S
• Z: Zombie
21
Listing Processes Usage
Forked
Forked processes
processes Total
Total memory
memory used
used by
by all
all forked
forked Number
Number of of times
times
processes, including shared Forked
Forked processes
processes
are
are listed
listed processes, including shared the
the process has
process has
memory are
are listed
listed together
together
individually
individually memory forked
forked
22
Forked Processes and Shared Memory
• Processes can spawn (“fork”) multiple copies
o Example: Each policy’s antivirus scan is separate, although they use the same signatures loaded into RAM
o Shared memory is assigned globally to the system (not a process ID)
• diagnose sys top shows each process’s individual usage
o RAM assigned for that specific process ID
• diagnose sys top-summary shows total usage
o Total RAM/CPU usage of all child processes, including shared memory
Shared Memory
23
Firmware and Hardware
Access to BIOS Menu
FGT60D (18:34-05.06.2014)
Ver:04000005 BIOS
BIOS version.
version. Options
Options in
in BIOS
BIOS
Serial number:FG60DXXXXXXXX menu depend on the version
menu depend on the version
RAM activation
Total RAM: 512MB
Enabling cache...Done.
Hit
Hit any
any key
key at
at this
this prompt
prompt to
to
Scanning PCI bus...Done.
enter the BIOS menu
enter the BIOS menu
Allocating PCI resources...Done.
Enabling PCI resources...Done.
Zeroing IRQ settings...Done.
Verifying PIRQ tables...Done.
Enabling Interrupts...Done.
Boot up, boot device capacity: 122MB.
Press any key to display configuration menu...
......
25
Format Flash Memory
[G]: Get firmware image from TFTP server.
[F]: Format boot device.
[B]: Boot with backup firmware and set as default.
Recommended for a
[I]: Configuration and information.
clean installation and
[Q]: Quit menu and continue to boot with default firmware.
problems possibly related
[H]: Display this list of options.
with corrupted firmware
Enter Selection [G]:
Enter G,F,B,I,Q,or H:
26
Firmware Installation from Console
Connect the
Configure your PC
TFTP
Make sure that a TFTP
NIC todirectory
server the and
server application is
copy the FortiGate
FortiGate TFTP
installed on your PC
firmware [image.out]
install interface
Sel
ect
ge
t
fi
rm
wa
re
im
ag
e
fro
m
the
BI
OS
me
nu
27
BIOS Firmware Transfer
Please connect TFTP server to Ethernet port "3".
28
Hardware Tests
• Designed for both manufacturing testing and end-users to verify
major hardware components:
o CPU
o RAM memory
o Network interfaces
o Hard disk
o Flash memory
o USB interface
o Front panel LEDs
o WiFi
o and so on
29
How to Run the Hardware Tests
• In some E-series and D-series models, the hardware test can
be executed directly from FortiOS
o Can run a single test, or multiple tests
• For other models, a special HQIP image must be loaded using
TFTP and executed from the BIOS menu
o Instructions:
https://support.fortinet.com/Download/HQIPImages.aspx
30
FortiOS Hardware Tests Command
# diagnose hardware test suite all
Following tests will request you to check the colours of the system LEDs.
To skip this test, please press 'N'.
Do you want to continue? (y/n) (default is n) N
Following tests will request you to check the colours of the NIC LEDs.
- Please connect ethernet cables:
[WAN - Any of PORT1...PORT4]
To skip this test, please press 'N'.
Do you want to continue? (y/n) (default is n) N
.....
31
Crash Logs
• Inspect crash logs for debugging purposes
• Any time a process closes, it is recorded as killed
o Some are normal (ex. closing scanunit to update definitions)
• Conserve mode events are also recorded
## diagnose
diagnose debug
debug crashlog
crashlog read
read
36:
36: 2015-11-25
2015-11-25 17:20:02
17:20:02 the
the killed
killed daemon
daemon is
is /bin/quard:
/bin/quard: status=0xf
status=0xf
37:
37: 2015-11-25
2015-11-25 17:20:02
17:20:02 the
the killed
killed daemon
daemon is
is /bin/thmd:
/bin/thmd: status=0x0
status=0x0
38:
38: 2015-11-25
2015-11-25 17:20:02
17:20:02 the
the killed
killed daemon
daemon is
is /bin/snmpd:
/bin/snmpd: status=0x0
status=0x0
39: 2015-11-25 17:20:02 the killed
39: 2015-11-25 17:20:02 the killed daemon
daemon is
is /bin/proxyd:
/bin/proxyd: status=0x0
status=0x0
40:
40: 2015-11-25
2015-11-25 17:20:02
17:20:02 the
the killed
killed daemon
daemon is
is /bin/fgfmd:
/bin/fgfmd: status=0x0
status=0x0
41:
41: 2015-11-25
2015-11-25 17:20:02
17:20:02 the
the killed
killed daemon
daemon is
is /bin/reportd:
/bin/reportd: status=0x0
status=0x0
32
Review
Why do you need to know precisely what normal is?
Monitoring network usage and system resource usage
Physical layer troubleshooting
Network layer troubleshooting
Debug flow
Loading a firmware from the BIOS menu
Hardware tests
Crash logs
33