The following is a step-by-step guide to capturing packets from the GUI:
Go to Network -> Packet Capture and Create New packet capture, then select the correct interface and any filters required.     By 'right-clicking' the newly created record, it is possible to start the packet capture:     After capturing the selected traffic, it is possible to stop the capture and download the .pcap file:    Note: If the capture configuration is edited, it is important to use the Restart option. If Start is used, the capture will not be modified, and the old configuration will be used.
It is not possible to restart a running capture, so it is required to stop the process before performing a restart.
Step-by-step guide to capturing packets from CLI:
Open the CLI console on FortiPAM.
 Run these commands:Â
diagnose sniffer packet <Interface> <Port number>
diagnose sniffer packet <Interface> 'host x.x.x.x'
Example:
diagnose sniffer packet any 'host 10.10.20.9'
diagnose sniffer packet port1 tcp 1812
On FortiPAM, the verbose level of the packet can be set to either of them. Verbose has 1 to 6 levels and, by default, it is always set to 1.
Level 1: Prints only the packet header (source/destination IP, ports, protocol, flags, sequence numbers). Level 2: Prints the packet header and the data from the IP layer (includes IP payload). Level 3: Prints the packet header and the data from the Ethernet layer (includes Ethernet payload). Level 4: Same as level 1, plus the interface name where the packet was captured. Level 5: Same as level 2, plus the interface name. Level 6: Same as level 3, plus the interface name.
Parameter description values: <interface> Interface to capture on any, port1, port2, etc. <filter> BPF (Berkeley Packet Filter) expression 'host x.x.x.x', 'port 1812', 'tcp and port 22', none. <verbose> Level of detail 1–6 (see verbose levels table). <count> Number of packets to capture 0 = indefinite, N = stop after N packets. <tsformat> Timestamp format a = absolute UTC, l = local time, omitted = relative. <frame size> Maximum frame size printed before truncation. Default = interface MTU. E.g., 68 for headers only.


 In addition to 'verbose level', it is also possible to add 'Count parameter' and 'Timestamp parameter'.
Count parameter:
0 = Capture indefinitely until interrupted. 10 = Capture the first 10 matching packets. 100 = Capture the first 100 matching packets.
Timestamp parameter (Common options include):
For example:
diagnose sniffer packet any 'host 10.10.20.9 and port 8000' 4 10 l
Here, verbose level=4, count=10, and timestamp=long-timestamp.
A guide to importing 'sniffer packet' to Wireshark is available in Technical Tip: How to import 'diagnose sniffer packet' data to WireShark.
|