Basic Syntax
Host filters:
host example.com # Traffic to/from host
src host 192.168.1.100 # Traffic from source
dst host 10.0.0.1 # Traffic to destination
Port filters:
port 80 # HTTP traffic
port 443 # HTTPS traffic
src port 53 # DNS queries
dst port 3306 # MySQL traffic
Protocol filters:
tcp # TCP traffic only
udp # UDP traffic only
icmp # ICMP (ping) traffic
arp # ARP traffic
Advanced Filters
Combining filters:
tcp and port 80 # HTTP over TCP
host example.com and not port 443 # Non-HTTPS traffic
src 192.168.1.0/24 and tcp # TCP from subnet
Packet size filters:
greater 1000 # Packets larger than 1000 bytes
less 128 # Packets smaller than 128 bytes
TCP flags:
tcp[tcpflags] & tcp-syn != 0 # SYN packets
tcp[tcpflags] & tcp-rst != 0 # RST packets
tcp[tcpflags] & tcp-fin != 0 # FIN packets
Common Use Cases
HTTP traffic:
port 80 or port 443 # Web traffic
host example.com and port 80 # Web traffic to specific host
Network troubleshooting:
icmp or arp # Network discovery traffic
tcp[tcpflags] == tcp-syn # Connection attempts
host not 192.168.1.1 and not arp # Non-local, non-ARP
Application monitoring:
port 3306 or port 6379 # MySQL and Redis traffic
dst port 53 # DNS lookups
port 5432 and host db.example.com # PostgreSQL to specific host