Skip to main content
Version: 7.26

rule


routing/rule​

Type: Directory

FlagNameDescription
Xdisableddisabled
Iinactiveinactive
*defaultdefault
ArgumentTypeDescription
src-address ( unset )address (flags=64iv/)Source address to match.
dst-address ( unset )address (flags=64iv/)Destination address to match.
routing-mark ( unset )enumMatch a specific routing mark.
interface ( unset )iface_enumIncoming interface to match.
actionenum (lookup | lookup-only-in-table | unreachable | drop | mangle)

Action to take on the matching packet:

  • drop - Silently drop the packet.
  • lookup - Look up the destination in the table in table. If the table has no active route for it, the lookup continues in the main table.
  • lookup-only-in-table - Look up the destination only in the table in table. If the table has no active route for it, the destination is unreachable.
  • unreachable - Generate an ICMP unreachable message and send it to the source.
  • mangle - Perform actions by firewall mangle rules.
tableenum (local) { local:4095 }Name of the routing table to use for lookup.
min-prefix ( unset )numHide routes from the routing table with the specified prefix length from packets processed by this routing rule.
This is equivalent to the Linux IP rule suppress_prefixlength. For example, set the value to 0 to suppress the default route in the routing decision.
vrfswitch
realm ( unset )num
chain ( unset )enumName of the chain used by routing decision rules. By default, user is used when the chain is not specified. If the chain name matches a built-in routing decision name, user-created rules are added after that decision. For example, if chain=mangle, user-created rules in this chain are located immediately after the mangle decision.