Standard Syntax
Description | Syntax | Examples | |
---|---|---|---|
1 | By IPv4 Address only | ip host {[ipv4] address} |
|
2 | By IPv6 Address only | ip6 host {[ipv6] address} |
|
3 | By Source IP only | src host {[ipv4/v6] address} |
|
4 | By Destination IP only | dst host {[ipv4/v6] address} |
|
5 |
By source and/or destination IPv4/IPv6 address |
src host {[ipv4] address} [and/or] dst host {[ipv4] address} src host {[ipv4] address} [and/or] dst host {[ipv6] address}
|
|
6 | By Port Number | src port {[port number] limited to 2^16} [and/or] dst port {[port number] limited to 2^16} |
|
7 | By source and/or destination IPv4/IPv6 address and/or Port number | ip host {[ipv4] address} [and/or] port {[port number] limited to 2^16} ip6 host {[ipv6] address} [and/or] port {[port number] limited to 2^16}
|
|
8 | By source and/or destination IPv4/IPv6 address and/or source and/or destination Port number | src/dst host {[ipv6] address} [and/or] src/dst port {[port number] limited to 2^16} |
|
9 | By MAC address | ether {[src/dst/host]} {[mac] address} |
NOTE: Matches either source or destination address
|
10 |
By mac and/or IP address | ether {[src/dst/host]} {[mac] address} and ip host {[ipv4] address} ether {[src/dst/host]} {[mac] address} or ip host {[ipv6] address} ether {[src/dst/host]} {[mac] address} or ip src/dst {[ipv4/ipv6] address}
|
|
11 | By src or dst MAC address and protocol | (ether {[src/dst/host]} {[mac] address} or ether src/dst host {[mac] address}) and {[ip4/ip6] proto {[tcp/udp/icmp/sctp/igmp/arp/rarp]} }
|
|
12 |
By Protocol | {[tcp/udp/icmp/sctp/igmp/arp/rarp]} ip proto {[tcp/udp/icmp/sctp/igmp/arp/rarp]}
ether proto {[ip/ip6/arp/rarp]} | tcp or udp or icmp or icmp6 or igmp or arp ip proto \\tcp or ip proto \\udp ip proto \\igmp NOTE: with ip proto tag tcp, udp, icmp, igmp protocols must be escaped with backslash. ip proto 0x06 (same as ip proto \\tcp or just tcp) ip6 proto 0x11 (same as ip6 proto \\udp or just udp) ip6 proto 0x58 (same as ip6 proto \\icmp6 or just icmp6) ether proto \\ip (same as ether proto 0x0800) ether proto \\ip6 (same as ether proto 0x86dd) ether proto \\arp (same as ether proto 0x0806) NOTE: with ether proto tag tcp, udp, icmp, igmp protocols must be escaped with backslash
|
13 | By Protocol header chain | ip protochain {[tcp/udp/icmp/sctp/igmp]} ip6 protochain {[tcp/udp/icmp/sctp/igmp]} |
|
14 |
By Protocol and Port Number | {[tcp/udp/icmp/sctp/igmp/arp/rarp]} [and/or] (src port {[port number] limited to 2^16} [and/or] dst port {[port number] limited to 2^16})
ip proto {[tcp/udp/icmp/sctp/igmp/arp/rarp]} [and/or] (src port {[port number] limited to 2^16} [and/or] dst port {[port number] limited to 2^16}) |
NOTE: with ip proto tag tcp, udp, icmp, igmp protocols must be escaped with backslash.
|
15 |
By Protocol and Port Number and IP address |
{[tcp/udp/icmp/sctp/igmp/arp/rarp]} [and/or] (src port {[port number] limited to 2^16} [and/or] dst port {[port number] limited to 2^16}) [and/or] src/dst host {[ipv4/ipv6] address} By destination Port Number but should not have specific src port number and specific protocol |
NOTE: parentheses are special to the Shell and must be escaped
|
16 |
By Protocol and IP |
{[tcp/udp/sctp/icmp/igmp/arp/rarp]} and src host {[ipv4/v6] address} |
NOTE: To exclude a particular protocol, see below examples
|
17 |
By Protocol and Multiple IP |
{[tcp/udp/icmp/sctp/igmp/arp/rarp]} and (src host {[ipv4/v6] address1} or src host {[ipv4/v6] address2} or src host {[ipv4/v6] address3}) |
|
18 |
By Port and IP |
src host [ipv4/v6] and dst host [ipv4/v6] and src port {[port number] limited to 2^16} [and/or] dst port {[port number] limited to 2^16} |
Alternatively you can rewrite the above example as shown below.
|
19 |
By Protocol Port and Multiple IP |
|
|
20 |
By Portrange |
portrange {[0-65535] limited to 0 - 2^16}} |
NOTE:
|
21 |
By Port Portrange and IP |
portrange 0-65535 and not port {[port number] limited to 2^16} [and/or] ip host {[ipv4/v6] address} |
NOTE:
|
22 |
By Subnet | net [IP]/Mask(bits) net [IP] mask [Subnet Mask] |
|
23 |
By Multicast Address | multicast [multicast IP addr] multicast [mac addr] |
|
24 |
By Broadcast Address | broadcast [broadcast IP addr] broadcast [broadcast mac addr] |
|
25 | By IP broadcast or multicast packets Note: jump to specific byte offset to verify | IP broadcast or multicast packets that were not sent via Ethernet broadcast or multicast: |
Note: ‘&' and '>’ should be escaped with backslash
|
26 |
By TCP flags | start and end packets (the SYN and FIN packets) of each TCP conversation that involves a non-local host ALL IPv4 HTTP packets to and from port 80, i.e. print only packets that contain data, not, for example, SYN and FIN packets and ACK-only packets. |
NOTE: the expression is quoted to prevent the shell from (mis-)interpreting the parentheses.
|
27 | By Gateway | gateway <hostname> Where hostname can be retrieved from /etc/hosts file or run “arp” command. NOTE: However this syntax doesnt work with IPv6 enabled configuration. Hence search binary doesn’t support this for the time being. | gateway snup |