Manual IP Firewall Raw - MikroTik Wiki
Manual IP Firewall Raw - MikroTik Wiki
Contents
Summary
Chains
Properties
Configuration examples
Summary
Sub-menu: /ip firewall raw
Firewall RAW table allows to selectively bypass or drop packets before connection tracking that way
significantly reducing load on CPU. Tool is very useful for DOS attack mitigation.
RAW table does not have matchers that depend on connection tracking ( like connection-state, layer7 etc.).
If packet is marked to bypass connection tracking packet de-fragmentation will not occur.
Chains
There are two predefined chains in RAW tables:
Properties
Property Description
action (action name; Default: accept) Action to take if packet is matched by the rule:
address-list (string; Default: ) Name of the address list to be used. Applicable if action is
add-dst-to-address-list or add-src-to-address-list
address-list-timeout (none-dynamic | Time interval after which the address will be removed from the
none-static | time; Default: none- address list specified by address-list parameter. Used in
dynamic) conjunction with add-dst-to-address-list or add-src-to-
address-list actions
chain (name; Default: ) Specifies to which chain rule will be added. If the input does
not match the name of an already defined chain, a new chain
will be created.
comment (string; Default: ) Descriptive comment for the rule.
dscp (integer: 0..63; Default: ) Matches DSCP IP header field.
dst-address (IP/netmask | IP range; Matches packets which destination is equal to specified IP or
Default: ) falls into specified IP range.
dst-address-list (name; Default: ) Matches destination address of a packet against user-defined
address list
dst-address-type (unicast | local | Matches destination address type:
broadcast | multicast; Default: )
unicast - IP address used for point to point
transmission
local - if dst-address is assigned to one of router's
interfaces
broadcast - packet is sent to all devices in subnet
multicast - packet is forwarded to defined group of
devices
dst-limit (integer[/time],integer,dst- Matches packets until a given rate is exceeded. Rate is defined
address | dst-port | src-address[/time]; as packets per time interval. As opposed to the limit matcher,
Default: ) every flow has it's own limit. Flow is defined by mode
parameter. Parameters are written in following format:
count[/time],burst,mode[/expire].
count - packet count per time interval per flow to
match
time - specifies the time interval in which the packet
count per flow cannot be exceeded (optional, 1s will
be used if not specified)
burst - initial number of packets per flow to match:
this number gets recharged by one every
time/count, up to this number
mode - this parameter specifies what unique fields
define flow (src-address, dst-address, src-and-dst-
address, dst-address-and-port, addresses-and-dst-
port)
expire - specifies interval after which flow with no
packets will be allowed to be deleted (optional)
dst-port (integer[-integer]: 0..65535; List of destination port numbers or port number ranges
Default: )
fragment (yes|no; Default: ) Matches fragmented packets. First (starting) fragment does not
count. If connection tracking is enabled there will be no
fragments as system automatically assembles every packet
hotspot (auth | from-client | http | local-dst
| to-client; Default: )
icmp-options (integer:integer; Default: ) Matches ICMP type:code fileds
in-bridge-port (name; Default: ) Actual interface the packet has entered the router, if incoming
interface is bridge. Works only if use-ip-firewall is enabled in
bridge settings.
in-interface (name; Default: ) Interface the packet has entered the router
in-interface-list (name; Default: ) Set of interfaces defined in interface list. Works the same as
in-interface
ingress-priority (integer: 0..63; Default: ) Matches ingress priority of the packet. Priority may be derived
from VLAN, WMM or MPLS EXP bit. Read more>>
ipsec-policy (in | out, ipsec | none; Matches the policy used by IPsec. Value is written in following
Default: ) format: direction, policy. Direction is Used to select
whether to match the policy used for decapsulation or the
policy that will be used for encapsulation.
in - valid in the PREROUTING chain
out - valid in the OUTPUT chain
jump-target (name; Default: ) Name of the target chain to jump to. Applicable only if
action=jump
limit (integer,time,integer; Default: ) Matches packets up to a limited rate (packet rate or bit rate).
Rule using this matcher will match until this limit is reached.
Parameters are written in following format:
count[/time],burst:mode.
random (integer: 1..99; Default: ) Matches packets randomly with given probability.
src-address (Ip/Netmaks, Ip range; Matches packets which source is equal to specified IP or falls
Default: ) into specified IP range.
src-address-list (name; Default: ) Matches source address of a packet against user-defined
address list
src-address-type (unicast | local |
broadcast | multicast; Default: ) Matches source address type:
src-port (integer[-integer]: 0..65535; List of source ports and ranges of source ports. Applicable only
Default: ) if protocol is TCP or UDP.
src-mac-address (MAC address; Default: ) Matches source MAC address of the packet
tcp-flags (ack | cwr | ece | fin | psh | rst | Matches specified TCP flags
syn | urg; Default: )
ack - acknowledging data
cwr - congestion window reduced
ece - ECN-echo flag (explicit congestion notification)
fin - close connection
psh - push function
rst - drop connection
syn - new connection
urg - urgent data
Configuration examples
[ Top | Back to Content ]