raw
ip/firewall/raw
Type: Directory
| Flag | Name | Description |
|---|---|---|
| X | disabled | disabled |
| I | invalid | invalid |
| D | dynamic | dynamic |
| Argument | Type | Description |
|---|---|---|
| all | switch | |
| static | switch | |
| dynamic | switch | |
| chain ( mandatory ) | enum | Specifies to which chain the rule will be added. If the input does not match the name of an already defined chain, a new chain will be created. |
| action | enum (accept | jump | return | log | passthrough | add-src-to-address-list | add-dst-to-address-list | drop | notrack) | Action to take if a packet is matched by the rule:
|
| jump-target | enum () | Name of the target chain to jump to. Applicable only if action=jump. |
| tcp-flags | super { !, , multi { array-id, array-id, super { ! , enum (fin | syn | rst | psh | ack | urg | ece | cwr) { fin:0, syn:1, rst:2, psh:3, ack:4, urg:5, ece:6, cwr:7 } } { ! , enum (fin | syn | rst | psh | ack | urg | ece | cwr) { fin:0, syn:1, rst:2, psh:3, ack:4, urg:5, ece:6, cwr:7 } } } { array-id, array-id, super { ! , enum (fin | syn | rst | psh | ack | urg | ece | cwr) { fin:0, syn:1, rst:2, psh:3, ack:4, urg:5, ece:6, cwr:7 } } { ! , enum (fin | syn | rst | psh | ack | urg | ece | cwr) { fin:0, syn:1, rst:2, psh:3, ack:4, urg:5, ece:6, cwr:7 } } } } | Matches the specified TCP flags:
|
| tls-host | super { ! , string } | Matches HTTPS traffic based on TLS SNI hostname. Accepts GLOB syntax for wildcard matching. The matcher will not be able to match the hostname if the TLS handshake frame is fragmented into multiple TCP segments. |
| in-interface | super { ! , iface_enum { } { } } | Interface the packet has entered the router. |
| out-interface | super { ! , iface_enum { } { } } | Interface the packet is leaving the router. |
| in-interface-list | super { ! , enum } | Set of interfaces defined in interface list. Works the same as in-interface. |
| out-interface-list | super { ! , enum } | Set of interfaces defined in interface list. Works the same as out-interface. |
| in-bridge-port | super { ! , iface_enum { } { } } | Actual interface the packet has entered the router if the incoming interface is a bridge. Works only if use-ip-firewall is enabled in bridge settings. |
| out-bridge-port | super { ! , iface_enum { } { } } | Actual interface the packet leaves the router if the outgoing interface is a bridge. Works only if use-ip-firewall is enabled in bridge settings. |
| in-bridge-port-list | super { ! , enum } | Set of interfaces defined in interface list. Works the same as in-bridge-port. |
| out-bridge-port-list | super { ! , enum } | Set of interfaces defined in interface list. Works the same as out-bridge-port. |
| packet-mark | super { ! , enum } | Matches packets marked by the mangle facility with a particular packet mark. If no-mark is set, the rule will match any unmarked packet. |
| src-port | super { ! , multi { , , range [ .. 65535] } { , , range [ .. 65535] } } | List of source ports and ranges of source ports. Applicable only if the protocol is TCP or UDP. |
| dst-port | super { ! , multi { , , range [ .. 65535] } { , , range [ .. 65535] } } | List of destination port numbers or port number ranges. |
| port | super { ! , multi { , , range [ .. 65535] } { , , range [ .. 65535] } } | Matches if any (source or destination) port matches the specified list of ports or port ranges. Applicable only if protocol is TCP or UDP. |
| icmp-options | super { ! , num [0 .. 255] , [ :range [ .. 255]] } | Matches ICMP type:code fields. |
| src-mac-address | super { ! , macAddr } | Matches the source MAC address of the packet. |
| content | super { ! , string } | Matches packets that contain the specified text. |
| ingress-priority | super { ! , num [0 .. 63] } | Matches the priority of an ingress packet. Priority may be derived from VLAN, WMM, DSCP, or MPLS EXP bit. |
| priority | super { ! , num [0 .. 63] } | Matches the packet's priority after a new priority has been set. Priority may be derived from VLAN, WMM, DSCP, MPLS EXP bit, or from the priority set by using the set-priority action. |
| dscp | super { ! , num [0 .. 63] } | Matches the DSCP IP header field. |
| tos | super { ! , num [0 .. 255] , [ /num [0 .. 255]] } | |
| limit | super { ! , num [1 .. 32000000000] , [ /time [1 .. ]] , ,num [ .. 2000000000] , [ :enum (packet | bit) { packet:0, bit:1 }] } | Matches packets up to a limited rate (packet rate or bit rate). A rule with this matcher will match until this limit is reached. Parameters are written in the following format:
|
| dst-limit | super { num , [ /time] , ,num , ,enum (dst-address | dst-address-and-port | src-address | src-and-dst-addresses | addresses-and-dst-port) { dst-address:1, dst-address-and-port:3, src-address:4, src-and-dst-addresses:5, addresses-and-dst-port:7 } , [ /time] } | Matches packets until a given rate is exceeded. Rate is defined as packets per time interval. As opposed to the
|
| time | super { ! , time [0 .. 86400] , -time [0 .. 86400] , ,ubit (sun, mon, tue, wed, thu, fri, sat) { sun, mon, tue, wed, thu, fri, sat } } | Creates a filter based on the packets' arrival time and date or, for locally generated packets, departure time and date. The matcher takes into account the time and timezone configured on the router. |
| random | super { num [1 .. 99] } | Matches packets randomly with a given probability. |
| nth | super { ! , num [1 .. ] , [ ,num [1 .. ]] } | Matches every nth packet: nth=2,1 will match every first packet of 2, hence, 50% of all the traffic matched by the rule. |
| tcp-mss | super { ! , num [0 .. 65535] , -num [0 .. 65535] } | Matches the TCP MSS value of an IP packet. |
| per-connection-classifier | super { ! , enum (src-address | dst-address | both-addresses | src-port | src-address-and-port | dst-port | dst-address-and-port | both-ports | both-addresses-and-ports) { src-address:1, dst-address:2, both-addresses:3, src-port:4, src-address-and-port:5, dst-port:8, dst-address-and-port:10, both-ports:12, both-addresses-and-ports:15 } , :num [1 .. ] , /num [0 .. ] } | PCC matcher allows dividing traffic into equal streams with the ability to keep packets with a specific set of options in one particular stream. |
| packet-size | super { ! , num [ .. 65535] , -num [ .. 65535] } | Matches packets of specified size or size range in bytes. |
| log | bool | Add a message to the system log containing the following data: in-interface, out-interface, src-mac, protocol, src-ip:port->dst-ip:port, and length of the packet. Allows logging of packets even if the action is not log, useful for debugging the firewall. |
| log-prefix | string | Adds the specified text at the beginning of every log message. Applicable if action=log or log=yes is configured. |
| ipsec-policy | super { enum (in | out) { in:0, out:1 } , ,enum (none | ipsec) { none:0, ipsec:1 } } | Matches the policy used by IPsec. Value is written in the following format:
|
| protocol | super { ! , enum () { } } | Matches the particular IP protocol specified by protocol name or number. |
| src-address | super { ! , ipRange } | Matches packets whose source is equal to the specified IP or falls into the specified IP range. |
| dst-address | super { ! , ipRange } | Matches packets whose destination is equal to the specified IP or falls into the specified IP range. |
| fragment | super { bool } | Matches fragmented packets. The first (starting) fragment does not count. If connection tracking is enabled there will be no fragments as the system automatically assembles every packet. IPv4 only. |
| psd | super { num , ,time , ,num , ,num } | Attempts to detect TCP and UDP scans. Parameters are in the following format:
|
| ipv4-options | super { enum (strict-source-routing | loose-source-routing | no-source-routing | record-route | no-record-route | timestamp | no-timestamp | router-alert | no-router-alert | any | none) { strict-source-routing:0x1, loose-source-routing:0x2, no-source-routing:0x4, record-route:0x8, no-record-route:0x10, timestamp:0x20, no-timestamp:0x40, router-alert:0x80, no-router-alert:0x100, any:0x200, none:0x400 } } | Matches IPv4 header options.
|
| src-address-type | super { ! , ubit (unicast, local, broadcast, multicast, blackhole) { unicast, local, broadcast, multicast, blackhole } } | Matches the source address type:
|
| dst-address-type | super { ! , ubit (unicast, local, broadcast, multicast, blackhole) { unicast, local, broadcast, multicast, blackhole } } | Matches the destination address type:
|
| src-address-list | super { ! , enum } | Matches the source address of a packet against a user-defined address list. Supports only one list. |
| dst-address-list | super { ! , enum } | Matches the destination address of a packet against a user-defined address list. Supports only one list. |
| hotspot | multi { array-id, array-id, super { ! , enum (from-client | auth | local-dst | to-client | http) { from-client:0, auth:1, local-dst:2, to-client:3, http:4 } } { ! , enum (from-client | auth | local-dst | to-client | http) { from-client:0, auth:1, local-dst:2, to-client:3, http:4 } } } | Matches packets received from HotSpot clients against various HotSpot matchers.
|
| address-list | enum () | Name of the address list to be used. Applicable if the action is add-dst-to-address-list or add-src-to-address-list. |
| address-list-timeout | alt { enum (none-dynamic | none-static) { none-dynamic:0, none-static:0xffffffff } , time [ .. 21474836] , } | Time interval after which the address will be removed from the address list specified by the
|
| ttl | super { enum (equal | not-equal | less-than | greater-than) { equal:0, not-equal:1, less-than:2, greater-than:3 } , :num [0 .. 255] } | Matches the packet TTL value. IPv4 only. |
| Read-only Argument | Type | Description |
|---|---|---|
| bytes | num | Total amount of bytes matched by the rule. |
| packets | num | Total amount of packets matched by the rule. |
ip/firewall/raw/reset-counters
Type: Command
ip/firewall/raw/reset-counters-all
Type: Command