filter
ipv6/firewall/filter
Package: ipv6
Type: Directory
| Argument | Type | Description |
|---|---|---|
| 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 | reject | fasttrack-connection) | Action to take if a packet is matched by the rule: accept - accept the packet. A packet is not passed to the next firewall rule. add-dst-to-address-list - add the destination address to the address list specified by the address-list parameter. add-src-to-address-list - add the source address to the address list specified by the address-list parameter. drop - drop the packet. fasttrack-connection - fasttrack the connection. jump - jump to the user-defined chain specified by the value of the jump-target parameter. log - 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. After a packet is matched it is passed to the next rule in the list, similar to passthrough. passthrough - if a packet is matched by the rule, increase the counter and go to the next rule (useful for statistics). reject - reject the packet and send an ICMP response. return - passes control back to the chain from where the jump took place. |
| jump-target | enum () | Name of the target chain to jump to. Applicable only if action=jump. |
| reject-with | enum (icmp-no-route | icmp-admin-prohibited | icmp-not-neighbour | icmp-address-unreachable | icmp-port-unreachable | tcp-reset | icmp-err-src-routing-header | icmp-headers-too-long) | Specifies the ICMPv6 error message to send when rejecting a packet. |
| connection-nat-state | super { ! , ubit (srcnat, dstnat) { srcnat, dstnat } } | Matches connections that are source-natted, destination-natted, or both. |
| 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. |
| connection-state | super { ! , ubit (invalid, established, related, new, untracked) { invalid, established, related, new, untracked } } | Interprets the connection tracking analytics data for a particular packet: established - a packet that belongs to an existing connection. invalid - a packet that does not have a determined state in connection tracking (usually severe out-of-order packets, packets with wrong sequence/ack number, or in case of resource over usage on the router). An invalid packet will not participate in NAT, and will still contain the original source IP address when routed. You should drop all connection-state=invalid packets in the firewall filter forward and input chains. new - the packet has started a new connection or is otherwise associated with a connection that has not seen packets in both directions. related - a packet that is related to, but not part of an existing connection, such as ICMP errors or a packet that begins an FTP data connection. untracked - a packet that was set to bypass connection tracking in firewall RAW tables. |
| connection-limit | super { ! , num , ,num [0 .. 128] } | Matches connections per address or address block after a given value is reached. You should use this together with connection-state=new and/or with tcp-flags=syn because the matcher is very resource-intensive. |
| protocol | super { ! , enum (icmpv6) { , icmpv6:58 } } | Matches the particular IP protocol specified by protocol name or number. |
| src-address | super { ! , ip6Prefix } | Matches packets whose source is equal to the specified IP or falls into the specified IP range. |
| dst-address | super { ! , ip6Prefix } | Matches packets whose destination is equal to the specified IP or falls into the specified IP range. |
| 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. |
| 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 address-list parameter. Used in conjunction with add-dst-to-address-list or add-src-to-address-list actions. none-dynamic (00:00:00) will leave the address in the address list till reboot. none-static will leave the address in the address list forever and will be included in the configuration export/backup. |
| src-address-type | super { ! , ubit (unicast, local, anycast, multicast, unreachable) { unicast, local, anycast, multicast, unreachable } } | Matches the source address type: unicast - an IP address used for point-to-point transmission. local - the address is assigned to one of the router's interfaces. anycast - a packet sent to the nearest node in a group. multicast - a packet is forwarded to a defined group of devices. unreachable - the address is unreachable. |
| dst-address-type | super { ! , ubit (unicast, local, anycast, multicast, unreachable) { unicast, local, anycast, multicast, unreachable } } | Matches the destination address type: unicast - an IP address used for point-to-point transmission. local - the destination address is assigned to one of the router's interfaces. anycast - a packet sent to the nearest node in a group. multicast - a packet is forwarded to a defined group of devices. unreachable - the address is unreachable. |
| headers | super { ! , ubit (hop, dst, route, frag, ah, esp, none, proto) { hop, dst, route, frag, ah, esp, none, proto } , [ :enum (exact | contains) { exact:0, contains:1 }] } | Matches IPv6 next-header. Two types of header matching are possible controlled by the mode parameter: contains - soft matching, matches at least selected headers. exact - matches the exact set of selected headers. |
| 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: 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. |
| hop-limit | 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 hop limit field in the IPv6 header. |
| connection-mark | super { ! , enum } | Matches packets marked by the mangle facility with a particular connection mark. If no-mark is set, the rule will match any unmarked connection. |
| connection-type | super { ! , enum (ftp | pptp | h323 | sip | irc | quake3 | tftp) { ftp:0, pptp:1, h323:2, sip:3, irc:4, quake3:5, tftp:6 } } | Matches packets from related connections based on information from their connection tracking helpers. A relevant connection helper must be enabled under /ip/firewall/service-port. |
| connection-bytes | super { num , -num } | Matches packets only if a given amount of bytes has been transferred through the particular connection. 0 means infinity, for example connection-bytes=2000000-0 means that the rule matches if more than 2MB has been transferred through the relevant connection. |
| connection-rate | super { ! , num , -num } | Allows capturing traffic based on the present speed of the connection. |
| routing-mark | super { ! , enum () { } } | Matches packets marked by the mangle facility with a particular routing mark. |
| 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:
|
ipv6/firewall/filter/reset-counters
Type: Command
ipv6/firewall/filter/reset-counters-all
Type: Command