Interface RuleAddOptions

Rule add options.

Hierarchy

Properties

dport?: string | number

Select the destination port value to match. Supports port range.

from?: string

Select the source prefix to match.

fwmark?: string

Select the fwmark value to match.

goto?: number

Attribute is used to jump to a rule with a specified priority. It essentially alters the typical sequence in which rules are evaluated.

iif?: string

Select the incoming device to match.

If the interface is loopback, the rule only matches packets originating from this host. This means that you may create separate routing tables for forwarded and local packets and, hence, completely segregate them.

ipproto?: string | number

Select the ip protocol value to match.

l3mdev?: true

Pertains to layer 3 master device-based routing, particularly relevant when using Virtual Routing and Forwarding (VRF) tables.

nat?: string

The base of the IP address block to translate (for source addresses). The ADDRESS may be either the start of the block of NAT addresses (selected by NAT routes) or a local host address (or even zero).

In the last case the router does not translate the packets, but masquerades them to this address. Using map-to instead of nat means the same thing.

not?: true

Invert the rule.

oif?: string

Sselect the outgoing device to match. The outgoing interface is only available for packets originating from local sockets that are bound to a device.

preference?: number

The priority of this rule.

PREFERENCE is an unsigned integer value, higher number means lower priority, and rules get processed in order of increasing number.

Each rule should have an explicitly set unique priority value. The options preference and order are synonyms with priority.

protocol?: string | number

The routing protocol who installed the rule in question. As an example when zebra installs a rule it would get RTPROT_ZEBRA as the installing protocol.

realms?: string

Realms to select if the rule matched and the routing table lookup succeeded. Realm TO is only used if the route did not select any realm.

sport?: string | number

Select the source port value to match. Supports port range.

suppress_ifgroup?: number

Reject routing decisions that use a device belonging to the interface group GROUP.

suppress_prefixlength?: number

Reject routing decisions that have a prefix length of NUMBER or less.

table?: number | RoutingTables

The routing table identifier to lookup if the rule selector matches. It is also possible to use lookup instead of table.

to?: string

Select the destination prefix to match.

tos?: number

Select the TOS value to match.

tun_id?: number

Attribute is used to match packets based on their tunnel ID, typically relevant for VXLAN (Virtual eXtensible Local Area Network) or other tunneling protocols that utilize tunnel IDs. The tunnel ID helps identify individual tunnels in scenarios where multiple tunnels are used.

type?: RuleTypes

The type of this rule.

uidrange?: string

Select the uid value to match.

Generated using TypeDoc