sk30583 - What is FW Monitor?

Header/footer test page

My Favorites

Solution ID: sk30583


Technical Level:

Basic

Email

Print

What is FW Monitor?

ProductCluster - 3rd-party, ClusterXL, CoreXL, IPS, IPSec VPN, SecureXL, Security Gateways, VSX (Traditional)

VersionR80.10 (EOS), R80.20 (EOS), R80.30 (EOS), R80.40 (EOS), R81 (EOS), R81.10 (EOS), R81.20

Last Modified2026-02-15

Solution

Table of Contents:

  1. Introduction

  2. Warnings

  3. FW Monitor Features

  4. FW Monitor Functionality

  5. FW Monitor Syntax and Usage

  6. Syntax

  7. Comparison with TCPdump

  8. Using the UUID feature

  9. SecureClient Syntax

  10. Capture Examples of "-e" flag

  11. Usual Capture

  12. Host Specific Capture

  13. Port Specific Capture

  14. Protocol Specific Capture

  15. Protocol Options Specific Capture

  16. Bytes Specific Capture

  17. Network Specific Capture

  18. Some Examples

  19. Capture Examples of "-F" flag

  20. Usual Capture

  21. Host Specific Capture

  22. Port Specific Capture

  23. Protocol Specific Capture

  24. Related Documentation

  25. Related Solutions

(1) Introduction

Check Point's FW Monitor is a powerful built-in tool for capturing network traffic at the packet level. The FW Monitor utility captures network packets at multiple capture points along the FireWall inspection chains. These captured packets can be inspected later using the WireShark (available for free from www.wireshark.org).

(2) Warnings

Monitored traffic

Filtering options

If you use the "-e" flag, the filtering applies to the non-accelerated traffic, and accelerated traffic is not shown at all.

A limitation exists when you use filters ("-F" flag for "fw monitor" and "-F" / "-H" flags for "fw ctl debug") for both "fw monitor" and "fw ctl debug" simultaneously. Running any of these commands with a debug filter overrides the debug filter used for pre-existing debug commands.

Currently, it is not supported to run both of these commands simultaneously with a debug filter - "fw monitor -F" and "fw ctl debug -F" / "fw ctl debug -H".

Only the filter for the last command that was run is applied. The data for the previous command will stop being filtered as soon as a new command is run, which means that all data is received unfiltered. This may have significant performance impact.

If you need filtered packet capture during a kernel debug “fw ctl debug” session, we recommend to use "cppcap" ( sk141412) instead of "fw monitor".

(3) FW Monitor Features

In many deployment and support scenarios, capturing network packets is an essential functionality. The tcpdump / snoop utilities are normally used for this task. The FW Monitor utility provides an even better functionality, but omits many of the requirements and the risks associated with these tools:

Normally, Check Point kernel modules are used to perform several functions on packets, such as filtering, encryption and decryption, QoS, etc. FW Monitor adds its modules to capture packets. FW Monitor can capture all packets that are seen and/or forwarded by the Security Gateway.

(4) FW Monitor Functionality

There are different inspection points when a packet passes through a Security Gateway.

Note - The Inbound and Outbound traffic direction relates to each specific packet, and not to the connection.

Name of inspection point Relation to the FireWall
Virtual Machine
Notion of inspection point
in the FW Monitor output
Pre-Inbound Before the inbound FireWall VM i (for example, eth4:i)
Post-Inbound After the inbound FireWall VM I (for example, eth4:I)
Pre-Inbound VPN Inbound before decryption id (for example, eth4:id)
Post-Inbound VPN Inbound after decryption ID (for example, eth4:ID)
Pre-Inbound QoS Inbound before QoS iq (for example, eth4:iq)
Post-Inbound QoS Inbound after QoS IQ (for example, eth4:IQ)
Name of inspection point Relation to the FireWall
Virtual Machine
Notion of inspection point
in the FW Monitor output
Pre-Outbound Before the outbound FireWall VM o (for example, eth4:o)
Post-Outbound After the outbound FireWall VM O (for example, eth4:O)
Pre-Outbound VPN Outbound before encryption e (for example, eth4:e)
Post-Outbound VPN Outbound after encryption E (for example, eth4:E)
Pre-Outbound QoS Outbound before QoS oq (for example, eth4:oq)
Post-Outbound QoS Outbound after QoS OQ (for example, eth4:OQ)

Let us examine a TCP handshake in the following topology:

[Client] --- (eth1)[Security Gateway](eth2) --- [Server]

  1. TCP SYN from [Client] will pass through Pre-Inbound and Post-Inbound on interface eth1: [Client] --- (eth1) {Pre-Inbound + Post-Inbound} [Security Gateway](eth2) --- [Server]
  2. TCP SYN from [Client] will pass through Pre-Outbound and Post-Outbound on interface eth2: [Client] --- (eth1)[Security Gateway] {Pre-Outbound and Post-Outbound} (eth2) --- [Server]
  3. TCP SYN-ACK from [Server] will pass through Pre-Inbound and Post-Inbound on interface eth2: [Client] --- (eth1)[Security Gateway] {Pre-Inbound + Post-Inbound} (eth2) --- [Server]
  4. TCP SYN-ACK from [Server] will pass through Pre-Outbound and Post-Outbound on interface eth1: [Client] --- (eth1) {Pre-Outbound and Post-Outbound} [Security Gateway](eth2) --- [Server]
  5. TCP ACK from [Client] will pass through Pre-Inbound and Post-Inbound on interface eth1: [Client] --- (eth1) {Pre-Inbound + Post-Inbound} [Security Gateway](eth2) --- [Server]
  6. TCP ACK from [Client] will pass through Pre-Outbound and Post-Outbound on interface eth2: [Client] --- (eth1)[Security Gateway] {Pre-Outbound and Post-Outbound} (eth2) --- [Server]

Once started, the FW Monitor compiles the INSPECT filter (created as $FWDIR/tmp/monitorfilter.pf) based on the specified syntax (which packets to capture), and loads it to the Check Point kernel (not replacing the Security Policy). The FW Monitor will then continuously get packets from the Check Point kernel, and depending on the syntax, will either display them on the terminal window, or will save them in the output capture file. Upon an interrupt signal (key combination CTRL + C), the FW Monitor stops, unloads the INSPECT filter, and exits.

(5) FW Monitor Syntax and Usage

(5-A) FW Monitor Syntax and Usage - Syntax

[Expert@HostName]# fw monitor [-h] [-u|-s] [-i] [-d] [-D] [-t] [{-e <expr>}+ | -f <filter_file_name>|-] [-l length] [-m i|I|o|O] [-x offset[,length]] [-o <output_file_name>] <[-pi position] [-pI position] [-po position] [-pO position] | -p all> [-a] [-ci count] [-co count] [-v VSID] [-w whole packet] [-F "<src IP>,<src port>,<dst IP>,<dst port>,<protocol num>"] [-U]

[Expert@HostName]# fw6 monitor [-h] [-u|-s] [-i] [-d] [-D] [-t] [{-e <expr>}+ | -f <filter_file_name>|-] [-l length] [-m i|I|o|O] [-x offset[,length]] [-o <output_file_name>] <[-pi position] [-pI position] [-po position] [-pO position] | -p all> [-a] [-ci count] [-co count] [-v VSID] [-w whole packet] [-F "<src IP>,<src port>,<dst IP>,<dst port>,<protocol num>"] [-U]

Enter the string to filter this table:

Flag Explanation
-h Displays the usage.
-i Flushes the standard output.
Use this flag to make sure that captured data for each packet is at once written to standard output. This is especially useful if you want to kill a running FW Monitor process, and want to be sure that all data is written to a file.
-d
-D
Starts the FW Monitor in the debug mode.
This will give you an insight into FW Monitor's inner workings, although this option is only rarely used outside Check Point.
Use the " -D" flag will produce an even more verbose output.
-t When compiling the INSPECT filter, includes $FWDIR/lib/tcpip.def, which allows using TCP/IP macros.
Warning: Do not modify anything in $FWDIR/lib/tcpip.def or in any other $FWDIR/lib/*.def file by yourself. Check Point does not support any configuration with changed *.def files. An exception are modifications done together with Check Point Support (according to a Service Request) or found in SecureKnowldege.
`{-e }+
-f
-l length Limits the length of the captured packets. FW Monitor will read only as many bytes from the kernel as specified by the length.
Make sure to capture as least as many bytes, so that the L3 IP header and L4 Transport header are included. This option allows capturing only the headers of a packet (e.g., IP and TCP), while omitting the actual payload, and thus decreases the size of the output file (by omitting the payload).
FW Monitor uses a buffer to transfer the packets from Check Point kernel to user space. If the size of the captured packets is reduced, this buffer will not fill up so fast.
-m i
-m I
-m o
-m O
-m e
-m E
Capture masks. By default, FW Monitor captures packets before and after the FireWall Virtual Machine in both directions.
This flag allows to specify the positions (kernel chains), where the traffic should be captured:
- i - Pre-Inbound only (before the packet enters a Chain Module in the inbound direction)
- I - Post-Inbound only (after the packet passes a Chain Module in the inbound direction) 
- o - Pre-Outbound only (before the packet enters a Chain Module in the outbound direction)
- O - Post-Outbound only (after the packet passes through a Chain Module in the outbound direction)
- e - Pre-Outbound VPN only (before the packet enters a VPN Chain Module in the outbound direction)
- E - Post-Outbound VPN only (after the packet passes through a VPN Chain Module in the outbound direction)
-x offset[,length] Prints packet/payload raw data in addition to the IP and Transport headers. Optionally it is also possible to limit the data written to the screen.
-o <output_file_name> Writes the captured raw data into an output file.
The format of an output file is the same format used by tools like snoop (refer to RFC 1761 for further information). This output file can be later analyzed by tools like WireShark.
-pi position
-pI position
-po position
-pO position
-p all
Inserts FW Monitor chain module at a specific position between Check Point kernel chains.
In addition to capture masks (which give the ability to specify a specific position), this flag defines where exactly (in Check Point kernel chains) the packets should be captured.
-a Uses absolute chain positions (in Check Point kernel chains). This flag changes the chain ID from a relative value (which only makes sense with the matching output from fw ctl chain command) to an absolute value.
If the captured data is saved into an output file (using the " -o <output_file_name>" switch), one of the fields written into the output file would be the chain position of the FW Monitor chain module.
Together with a simultaneous execution of " fw ctl chain" command you can determine where the packet was captured. Especially when using " -p all" switch, you will find the same packet captured multiples times at different chain positions.
-ci count
-co count
Captures a specific number of packets.
This is especially useful in situations where the FireWall is filtering high amounts of traffic. In such scenarios, FW Monitor may bind so many resources (for writing to the console, or to a file) that recognizing the break sequence (CTRL+C) might take very long time.
It is possible to use the " -ci" and the " -co" switches together. FW Monitor will stop capturing packets if the number of packets for one of the two counters reaches the specified " count".
`-u -s`
-v VSID Applies only to VSX NG, VSX NGX, and VSX NGX R6x versions.
Captures the packets on a specific Virtual Router or Virtual System on VSX Gateway (Example: fw monitor -v 4 -e "accept;" -o /var/log/fw_mon.cap)
-w When using the "-o" or the "-x" flag, there is an option to print the whole raw data of a packet.
Supported versions:
- R80.40 and above
- R80.30 Jumbo Hotfix Accumulator Take 215 and above
- R80.20 Jumbo Hotfix Accumulator Take 73 and above
-F "<src IP>, <src port>, <dst IP>, <dst port>, <protocol num>" Filtering the packets based on IP / port / protocol.
Notes:
- Value 0 is used as "any".
- Up to 5 filters are supported. Multiple filters are applied on packets in OR logical manner.
Supported versions:
- R80.40 and above
- R80.30 Jumbo Hotfix Accumulator Take 215 and above
- R80.20 Jumbo Hotfix Accumulator Take 73 and above
-U Unloads the FW Monitor filters.
Supported versions:
- R80.40 and above
- R80.30 Jumbo Hotfix Accumulator Take 215 and above
- R80.20 Jumbo Hotfix Accumulator Take 73 and above

(5-B) FW Monitor Syntax and Usage - Syntax comparison between TCPdump and FW Monitor

Note: Refer to https://linux.die.net/man/8/tcpdump.

Enter the string to filter this table:

Function Flag in TCPdump Flag in FW Monitor Notes
Save output into a file -w <output_file_name> -o <output_file_name>
Capture specified number
of bytes per packet
-s snaplen -l length For TCPdump:
- If not specified, then 65535 bytes are captured
- It is recommended to use "-s 1500"
- Setting snaplen to 0 sets it to the default of 65535 bytes
For FW Monitor:
- By default, not needed
- Refer to the table above
Automatically exit after
specified number of
packets was captured
-c count -ci count
-co count
For FW Monitor:
- Refer to the table above
Print payload content -X -x offset[,length] For TCPdump:
- In addition to printing the headers of each packet, prints the data

of each packet (minus its Link Level header) in Hex and ASCII
For FW Monitor:
- Refer to the table above
Display timestamps on CLI
(when not saving
output into a file)
-tt N/A For TCPdump:
- Prints an unformatted timestamp on each dump line.
-ttt -T For TCPdump:
- Prints a delta (micro-second resolution) between

current and previous line on each dump line.
-ttt N/A For TCPdump:
- Prints a delta (micro-second resolution) between

current and previous line on each dump line.
-tttt N/A For TCPdump:
- Prints a timestamp in default format

preceeded by date on each dump line.
-ttttt N/A For TCPdump:
- Print a delta (micro-second resolution) between

current and first line on each dump line.
Display verbose
output on CLI
(when not saving
output into a file)
-v -d For TCPdump:
- Produces slightly more verbose output.

For example, the TTL, Identification, total length and options

in an IP packet are printed. Also enables additional packet

integrity checks, such as verifying the IP and ICMP header checksum.
For FW Monitor:
- Refer to the table above
-vv -D For TCPdump:
- Produces even more verbose output.

For example, additional fields are printed

from NFS reply packets, and SMB packets

are fully decoded.
For FW Monitor:
- Refer to the table above
-vvv -D For TCPdump:
- Produces even more verbose output.

For example, telnet SB ... SE options

are printed in full. With "-X", Telnet options

are printed in Hex as well.
For FW Monitor:
- Refer to the table above

(5-C) FW Monitor Syntax and Usage - Using the UUID feature

The purpose of the new FW Monitor feature is to use the UUID feature (that was introduced in the NG AI family) to follow connections passing through the FireWall.

Following connections through the FireWall is not always a trivial task because often the FireWall modifies information in the original packet. These cases include:

In Check Point NG AI version, a Universal-Unique-IDentifier (UUID) was introduced as the basis for the log unification mechanism. A UUID is given to every new connection passing through the FireWall. This way, all packets that belong to the connection can be identified and can later be unified on the Security Management Server.

This new infrastructure has given us the ability to enhance the "FW Monitor" utility. The FW Monitor utility is a tcpdump/snoop-like tool that allows us to monitor packets as they pass through the FireWall. The FW Monitor module registers itself as the first and the last module on the chain, allowing us to see any modifications done by the FireWall on the original packet. With the addition of the UUID field to the FW Monitor, entire connections can be monitored as they pass through the FireWall.

The original UUID is an array, composed of 4 unsigned 32-bit integers, in which only the first two integers are relevant:

UUID[0] is a timestamp.

UUID[1] is a counter used whenever UUID[0] is not unique.

UUID[2] is the IP address of the local firewall (constant)

UUID[3] is a process number (currently a constant that can be ignored).

The UUID feature can be activated with one of the following switches:

Since we are pressed for space in the header fields of the captured packet, the original UUID has been manipulated to be 1 unsigned long 32-bit integer. It is currently composed of the 2 least significant bytes of UUID[1] (16 bits) attached to the 2 least significant bytes of UUID[0] (16 bits). This gives us the following amount of unique IDs:

This UUID is then placed in the last four bytes of the Ethernet MAC Source header field.

The new Ethernet header MAC fields are now:

In addition, it is possible to redirect the FW Monitor output to an ASCII file instead of saving it in a tcpdump/snoop format. If this is the case, the 32-bit manipulated UUID is displayed as the first field of each line, followed by the entire UUID array.

When viewing the captured file, it is now possible to view the connection by filtering the file by the UUID. This is done by first opening the captured file, finding a packet that belongs to the connection, and getting the last four bytes of the Source MAC address. Then, convert these four bytes to Decimal format and filter the captured file as follows:

# tcpdump -r <captured_file_name> -e -v -xx "ether[8:4] = 0xHHHH"

# snoop -i <captured_file_name> -v -x0 "ether[8:4] = 0xHHHH"

where HHHH is the decimal equivalent of the last four bytes of the Source MAC address.

The UUID feature can be debugged by collecting the "fw ctl debug -m fw + chain conn" debug.

Note: The 'filter' flag may also provide some information, but produces many irrelevant printouts.

(6) SecureClient Syntax

%SRDIR%\bin\srfw monitor [-d] [{-e <expr>}+ | -f <filter_file_name> | -] [-l length] [-m i | I | o | O] [-x offset[,length]] [-o <output_file_name>]

Refer to SecureClient R56 for Mac OS X Release Notes ( Mac OS X 10.3, Mac OS X 10.4) and to Debugging SecuRemote/SecureClient.

packetmon [-d] [-h] [-t] [-T] [-i] [-I] [-r] [{-e <expr>}+ | -f <filter_file_name> | -] [-l length] [-m i | I | o | O] [-x offset[,length]] [-o <output_file_name>] [-ci count] [-co count]

Refer to Remote Access Clients for Windows 32/64-bit Administration Guide ( E75.30, E80.41, E80.50) - Chapter 'Monitoring and Troubleshooting' - Troubleshooting the Firewall - Desktop Firewall Monitoring.

(7) Capture Examples of "-e" flag

Refer to the $FWDIR/lib/fwmonitor.def file on the Security Gateway for useful macro definitions.

Note: The "-e" flag is not supported to capture accelerated traffic in these versions:

(7-A) Capture Examples - Usual Capture

Capture everything, save the data into the file:

[Expert@HostName]# fw monitor -e "accept;" -o /var/log/fw_mon.cap

(7-B) Capture Examples - Host Specific Capture

To specify a host, you can use the following expression:

Examples:

[Expert@HostName]# fw monitor -e "((src=x.x.x.x , dst=y.y.y.y) or (src=y.y.y.y , dst=x.x.x.x)), accept;" -o /var/log/fw_mon.cap

[Expert@HostName]# fw monitor -e "((src=x.x.x.x or dst=x.x.x.x) or (src=y.y.y.y or dst=y.y.y.y) or (src=z.z.z.z or dst=z.z.z.z)), accept;" -o /var/log/fw_mon.cap

(7-C) Capture Examples - Port-Specific Capture

Note: Port number in the syntax has to be provided in Decimal format. Refer to /etc/services file on the machine, or to http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml

To specify a port, you can use the following expression:

Examples:

[Expert@HostName]# fw monitor -e "(sport=x or dport=x), accept;" -o /var/log/fw_mon.cap

[Expert@HostName]# fw monitor -e "not (sport=x or dport=x), accept;" -o /var/log/fw_mon.cap

[Expert@HostName]# fw monitor -e "not (sport=22 or dport=22), accept;" -o /var/log/fw_mon.cap

[Expert@HostName]# fw monitor -e "not tcpport(22), accept;" -o /var/log/fw_mon.cap

[Expert@HostName]# fw monitor -e "((src=x.x.x.x or dst=x.x.x.x) and (not (sport=22 or dport=22))), accept;" -o /var/log/fw_mon.cap

[Expert@HostName]# fw monitor -e "(host(x.x.x.x) and not tcpport(22)), accept;" -o /var/log/fw_mon.cap

(7-D) Capture Examples - Protocol-Specific Capture

Note: Protocol number in the expression has to be provided in Decimal format. Refer to /etc/protocols file on the machine, or to http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml

To specify a protocol, you can use the following expression:

Examples:

(This byte offset syntax is described in the "Capture Examples - Bytes Specific Capture" section)

Examples:

Which protocol
to specify
On which port(s)
traffic will
be captured
Expression
TCP --- "tcp, accept;"
UDP --- "udp, accept;"
ICMPv4 --- "icmp, accept;"
or
"icmp4, accept;"
ICMPv6 --- "icmp6, accept;"
HTTP TCP 80 "http, accept;"
HTTPS TCP 443 "https, accept;"
PROXY TCP 8080 "proxy, accept;"
DNS UDP 53 "dns, accept;"
IKE UDP 500 "ike, accept;"
NAT-T UDP 4500 "natt, accept;"
ESP
and
IKE
IP proto 50
and
UDP 500
"vpn, accept;"
01. ESP
02. IPsec over UDP
03. IKE
04. NAT-T
05. CRL
06. RDP
07. Tunnel Test
08. Topology
09. L2TP
10. SCV
11. Multi-Portal
12. etc.
This captures all
VPN-related data.
01. IP proto 50
02. UDP 2746
03. UDP 500
04. UDP 4500
05. TCP 18264
06. UDP 259
07. UDP 18234
08. TCP 264
09. TCP 1701
10. UDP 18233
11. TCP 443 + TCP 444
12. etc.
"vpnall, accept;"
Multi-Portal
connections
TCP 443
and
TCP 444
"multi, accept;"
SSH TCP 22 "ssh, accept;"
FTP TCP 20
and
TCP 21
"ftp, accept;"
Telnet TCP 23 "telnet, accept;"
SMTP TCP 25 "smtp, accept;"
POP3 TCP 110 "pop3, accept;"

Examples:

[Expert@HostName]# fw monitor -e "tcp, host(x.x.x.x) or host(y.y.y.y), accept;" -o /var/log/fw_mon.cap

[Expert@HostName]# fw monitor -e "accept [9:1]=6 , ((src=x.x.x.x , dst=y.y.y.y) or (src=y.y.y.y , dst=x.x.x.x));"

[Expert@HostName]# fw monitor -e "ip_p=6, ((src=x.x.x.x , dst=y.y.y.y) or (src=y.y.y.y , dst=x.x.x.x)), accept;" -o /var/log/fw_mon.cap

(7-E) Capture Examples - Protocol Options Specific Capture

Note: Refer to the $FWDIR/lib/tcpip.def file on the Security Gateway.

Protocol Expression Option Description
IPv4 ip_src = <IPv4_Address> Source IPv4 address of the IPv4 packet
Example:
fw monitor -e "ip_src = 192.168.22.33, accept;"
ip_dst = <IPv4_Address> Destination IPv4 address of the IPv4 packet
Example:
fw monitor -e "ip_dst = 192.168.22.33, accept;"
ip_ttl = Time To Live of the IPv4 packet
Example:
fw monitor -e "ip_ttl = 255, accept;"
ip_len = <Length_in_Bytes> Total Length of the IPv4 packet in bytes
Example:
fw monitor -e "ip_len = 64, accept;"
ip_tos = TOS field of the IPv4 packet
Example:
fw monitor -e "ip_tos = 0, accept;"
ip_p = <IANA_Protocol_Number> IANA Protocol Number (either in Dec or in Hex) encapsulated in the IPv4 packet
Example 1 for TCP:
fw monitor -e "ip_p = 6, accept;"
Example 2 for UDP:
fw monitor -e "ip_p = 17, accept;"
Example 3 for UDP:
fw monitor -e "ip_p = 0x11, accept;"
Example 4 for ICMP:
fw monitor -e "ip_p = 1, accept;"
IPv6 ip_src6p = <IPv6_Address> Source IPv6 address of the IPv6 packet
ip_dst6p = <IPv6_Address> Destination IPv6 address of the IPv6 packet
ip_len6 = <Length_in_Bytes> Payload Length of the IPv6 packet in bytes
ip_ttl6 = Hop Limit ("Time To Live") of the IPv6 packet
ip_p6 = <IANA_Protocol_Number> Next Header of the IPv6 packet - encapsulated IANA Protocol Number
Example: fw monitor -e "ip_p6 = 6, accept;"
TCP syn SYN flag is set in TCP packet
Example:
fw monitor -e "ip_p = 6, syn, accept;"
ack ACK flag is set in TCP packet
Example:
fw monitor -e "ip_p = 6, ack, accept;"
rst RST flag is set in TCP packet
Example:
fw monitor -e "ip_p = 6, rst, accept;"
fin FIN flag is set in TCP packet
Example:
fw monitor -e "ip_p = 6, fin, accept;"
first First packet of TCP connection
(i.e., SYN flag is set, but ACK flag is not set in TCP packet)
Example:
fw monitor -e "ip_p = 6, first, accept;"
not_first Not the first packet of TCP connection
(i.e., SYN flag is not set in TCP packet)
Example: fw monitor -e "ip_p = 6, not_first, accept;"
established Established TCP connection
(i.e., either ACK flag is set, or SYN flag is not set in TCP packet)
Example:
fw monitor -e "ip_p = 6, established, accept;"
last Last packet of TCP connection
(i.e., both ACK flag and FIN flag are set in TCP packet)
Example:
fw monitor -e "ip_p = 6, last, accept;"
tcpdone End of TCP connection
(i.e., either RST flag is set, or FIN flag is set in TCP packet)
Example:
fw monitor -e "ip_p = 6, tcpdone, accept;"
th_flags = <Sum_of_Flags_Hex_Values> General way to match the flags inside in TCP packets:
Syntax Explanation Example
th_flags = 0x2 SYN flag is set in TCP packet fw monitor -e "th_flags = 0x2, accept;"
th_flags = 0x10 ACK flag is set in TCP packet fw monitor -e "th_flags = 0x10, accept;"
th_flags = 0x8 PSH flag is set in TCP packet fw monitor -e "th_flags = 0x8, accept;"
th_flags = 0x1 FIN flag is set in TCP packet fw monitor -e "th_flags = 0x1, accept;"
th_flags = 0x4 RST flag is set in TCP packet fw monitor -e "th_flags = 0x4, accept;"
th_flags = 0x20 URG flag is set in TCP packet fw monitor -e "th_flags = 0x20, accept;"
th_flags = 0x12 SYN flag (0x2) and ACK flag (0x10) are set in TCP packet fw monitor -e "th_flags = 0x12, accept;"
th_flags = 0x18 PSH flag (0x8) and ACK flag (0x10) are set in TCP packet fw monitor -e "th_flags = 0x18, accept;"
th_flags = 0x11 FIN flag (0x1) and ACK flag (0x10) are set in TCP packet fw monitor -e "th_flags = 0x11, accept;"
th_flags = 0x14 RST flag (0x4) and ACK flag (0x10) are set in TCP packet fw monitor -e "th_flags = 0x14, accept;"
th_sport = <Port_Number> TCP source port (refer to IANA Port Number Registry)
Example:
fw monitor -e "th_sport = 59259, accept;"
th_dport = <Port_Number> TCP destination port (refer to IANA Port Number Registry)
Example:
fw monitor -e "th_dport = 22, accept;"
th_seq = TCP sequence number (either in Dec or in Hex)
Example 1:
fw monitor -e "th_seq = 3937833514, accept;"
Example 2:
fw monitor -e "th_seq = 0xeab6922a, accept;"
th_ack = TCP acknowledged number (either in Dec or in Hex)
Example 1:
fw monitor -e "th_ack = 509054325, accept;"
Example 2:
fw monitor -e "th_ack = 0x1e578d75, accept;"
UDP uh_sport = <Port_Number> UDP source port (refer to IANA Port Number Registry)
Example:
fw monitor -e "uh_sport = 8116, accept;"
uh_dport = <Port_Number> UDP destination port (refer to IANA Port Number Registry)
Example:
fw monitor -e "uh_dport = 53, accept;"
ICMPv4 icmp_type = ICMPv4 packets with specified Type
Example:
fw monitor -e "icmp_type = 0, accept;"
icmp_code = ICMPv4 packets with specified Code
Example:
fw monitor -e "icmp_code = 0, accept;"
icmp_id = ICMPv4 packets with specified Identifier
Example:
fw monitor -e "icmp_id = 20583, accept;"
icmp_seq = ICMPv4 packets with specified Sequence number
Example:
fw monitor -e "icmp_seq = 1, accept;"
echo_req ICMPv4 Echo Request packets (Type 8, Code 0)
Example:
fw monitor -e "echo_req, accept;"
echo_reply ICMPv4 Echo Reply packets (Type 0, Code 0)
Example:
fw monitor -e "echo_reply, accept;"
ping ICMPv4 Echo Request and ICMPv4 Echo Reply packets
Example:
fw monitor -e "ping, accept;"
traceroute Traceroute packets as implemented in Unix OS (UDP packets on ports 30000 and greater and with TTL<30; or ICMP Time exceeded packets)
Example:
fw monitor -e "traceroute, accept;"
tracert Traceroute packets as implemented in Windows OS (ICMP Request packets with TTL<30; or ICMP Time exceeded packets)
Example:
fw monitor -e "tracert, accept;"
icmp_ip_len = Length of ICMPv4 packets
Example:
fw monitor -e "icmp_ip_len = 84, accept;"
ICMPv6 icmp6_type = ICMPv6 packets with specified Type
Example:
fw monitor -e "icmp6_type = 1, accept;"
icmp6_code = ICMPv6 packets with specified Code
Example:
fw monitor -e "icmp6_code = 3, accept;"

(7-F) Capture Examples - Byte-Specific Capture

Simple checks are used to check for a value at a specific offset in the packet:

[Expert@HostName]# fw monitor -e "accept [ offset : length , order ] relational-operator value;"

Field Explanation
offset Specifies the offset relative to the beginning of the IP packet from where the value should be read.
length Specifies the number of bytes:
- 1 = byte
- 2 = word
- 4 = dword
If length is not specified, FW Monitor assumes 4 (dword).
order Specifies the byte order:
- b = big-endian, or network order
- l = little-endian, or host order
If order is not specified, FW Monitor assumes little endian byte order.
relational-operator Relational operator to express the relation between the packet data and the value:
< less than
> greater than
<= less than or equal to
>= greater than
= equal to
is
!= not equal to
is not
value One of the data types known to INSPECT (e.g., an IP address, or an integer).

The IP-based protocols are stored in the IP packet as a byte at offset 9:

The Layer 3 IP Addresses are stored in the IP packet as double words at offset 12 (Source address) and at offset 16 (Destination address):

The Layer 4 Ports are stored in the IP packet as a word at offset 20 (Source port) and at offset 22 (Destination port):

Examples:

(7-G) Capture Examples - Network-Specific Capture

To capture traffic to/from a network, you need to specify the network address and length of network mask (number of bits).

There are 3 options:

Traffic direction Expression
To or From a network "net(<Network_IP_Address>, <Mask_Length>), accept;"
To a network "to_net(<Network_IP_Address>, <Mask_Length>), accept;"
From a network "from_net(<Network_IP_Address>, <Mask_Length>), accept;"

Examples:

(7-H) Capture Examples - Some Examples

(8) Capture Examples of "-F" flag

(8-A) Usual Capture

Capture everything, you can use the following expression:

-F "0,0,0,0,0"

(8-B) Host-Specific Capture

To specify a host, you can use the following expression:

-F "x.x.x.x,0,y.y.y.y,0,0"

This will filter for connections with the source IP x.x.x.x and the destination IP y.y.y.y.

Protocol number and port numbers can be any value.

Note: This means the filter will only catch one direction of the connection, so set a second (set of) filter to catch the other direction.

Examples:

This will filter connection "x.x.x.x: --> y.y.y.y:, <protocol: Any>"

Source ip: x.x.x.x, source port: any, destination ip: y.y.y.y, destination port: any, protocol: any.

This will filter connection "x.x.x.x: --> y.y.y.y:, <protocol: Any>" or connection " y.y.y.y: --> x.x.x.x:, <protocol: Any>"

Filter 1: source ip: x.x.x.x, source port: any, destination ip: y.y.y.y, destination port: any, protocol: any.

Filter 2: source ip: y.y.y.y, source port: any, destination ip: x.x.x.x, destination port: any, protocol: any.

(8-C) Port-Specific Capture

To specify ports numbers, you can use the following expression:

-F "0,x,0,y,0"

This will filter connection with source port x and destination port y. Protocol number and ip's can be any value.

Examples:

This will filter connection ":x -->:y, <protocol: Any>"

Source ip: any, source port: x, destination ip: any, destination port: y, protocol: any.

This will filter connection "x.x.x.x:z --> y.y.y.y:, <protocol: Any>" or connection " y.y.y.y: --> x.x.x.x:z, <protocol: Any>"

Filter 1: source ip: x.x.x.x, source port: z, destination ip: y.y.y.y, destination port: any, protocol: any.

Filter 2: source ip: y.y.y.y, source port: any, destination ip: x.x.x.x, destination port: z, protocol: any.

(8-D) Protocol-Specific Capture

To specify a protocol number, you can use the following expression:

-F "0,0,0,0,x"

This will filter for connections with the protocol number "X".

Port number and IP addresses can be any value.

Examples:

This will filter connection ": --> :, <protocol: x>"

Source ip: any, source port: any, destination ip: any, destination port: any, protocol: x.

For example, to capture the GRE traffic (protocol 47): fw monitor -F "0,0,0,0,47"

This will filter connection "x.x.x.x: --> y.y.y.y:z, <protocol: m>" or connection " y.y.y.y:z --> x.x.x.x:, <protocol: m>"

Filter 1: source ip: x.x.x.x, source port: any, destination ip: y.y.y.y, destination port: z, protocol: m.

Filter 2: source ip: y.y.y.y, source port: z, destination ip: x.x.x.x, destination port: any, protocol: m.

(9) Related Documentation

(10) Related Solutions

NOTE

This solution has been verified for the specific scenario, described by the combination of Product, Version and Symptoms. It may not work in other scenarios.

Article Properties

Access LevelGeneral

StatusApproved by TAC

Date Created2005-03-02

Last Modified2026-02-15

Was this page helpful?YesNo

Haven't found what you're looking for?

Our customer support team is only a click away and ready to help you 24 hours a day.

Open a Service Request

reCAPTCHA

Recaptcha requires verification.

protected by reCAPTCHA