NOPE LinkedIn

Catégories:
Tips&Tricks
Firewall

Troubleshooting Fortigate firewalls

Troubleshooting Fortigate firewall:

To view the date and time in the CLI:

  • To view the date
FortiGate-VM64-HV # execute date

current date is: 2022-08-01
  • To view time
FortiGate-VM64-HV # execute time
current time is: 09:54:57
last ntp sync:Mon Aug  1 09:20:07 2022
  • To view system resources in the CLI:
FortiGate-VM64-HV # get system performance status
CPU states: 0% user 0% system 0% nice 100% idle 0% iowait 0% irq 0% softirq
CPU0 states: 0% user 0% system 0% nice 100% idle 0% iowait 0% irq 0% softirq
Memory: 2058672k total, 880400k used (42.8%), 954208k free (46.4%), 224064k freeable (10.8%)
Average network usage: 2 / 0 kbps in 1 minute, 2 / 0 kbps in 10 minutes, 2 / 0 kbps in 30 minutes
Maximal network usage: 9 / 0 kbps in 1 minute, 44 / 12 kbps in 10 minutes, 44 / 12 kbps in 30 minutes
Average sessions: 11 sessions in 1 minute, 10 sessions in 10 minutes, 11 sessions in 30 minutes
Maximal sessions: 11 sessions in 1 minute, 29 sessions in 10 minutes, 30 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
Maximal session setup rate: 1 sessions per second in last 1 minute, 2 sessions per second in last 10 minutes, 3 sessions per second in last 30 minutes
Average NPU sessions: 0 sessions in last 1 minute, 0 sessions in last 10 minutes, 0 sessions in last 30 minutes
Maximal NPU sessions: 0 sessions in last 1 minute, 0 sessions in last 10 minutes, 0 sessions in last 30 minutes
Virus caught: 0 total in 1 minute
IPS attacks blocked: 0 total in 1 minute
Uptime: 0 days,  5 hours,  37 minutes
  • To view current memory usage information in the CLI:
FortiGate-VM64-HV # diagnose hardware sysinfo memory
MemTotal:        2058672 kB
MemFree:          954456 kB
Buffers:            2708 kB
Cached:           715912 kB
SwapCached:            0 kB
Active:           304476 kB
Inactive:         614100 kB
Active(anon):     218972 kB
Inactive(anon):   419492 kB
Active(file):      85504 kB
Inactive(file):   194608 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                48 kB
Writeback:             0 kB
AnonPages:        199968 kB
Mapped:            87032 kB
Shmem:            438500 kB
Slab:              47324 kB
SReclaimable:       6348 kB
SUnreclaim:        40976 kB
KernelStack:        2016 kB
PageTables:        24324 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1029336 kB
Committed_AS:   14950684 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      108884 kB
VmallocChunk:   34359626739 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        4032 kB
DirectMap2M:     2093056 kB
  • To view the routing table in the CLI:
FortiGate-VM64-HV # 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
       V - BGP VPNv4
       * - candidate default

Routing table for VRF=0
S*      0.0.0.0/0 [5/0] via 10.152.8.1, port1, [1/0]
C       10.152.8.0/24 is directly connected, port1

Performing a sniffer trace

When you troubleshoot networks and routing in particular, it helps to look inside the headers of packets to determine if they are traveling the route that you expect them to take.

Sniffing packets

To perform a sniffer trace in the CLI: Before you start sniffing packets, you should prepare to capture the output to a file. A large amount of data may scroll by and you will not be able to see it without saving it first. One method is to use a terminal program like puTTY to connect to the FortiGate CLI. Once the packet sniffing count is reached, you can end the session and analyze the output in the file.

The general form of the internal FortiOS packet sniffer command is:

diagnose sniffer packet <interface_name> <‘filter’>

To stop the sniffer, type CTRL+C.

<interface_name> <‘filter’>