table of contents
other versions
- wheezy 20120521-3+b3
- wheezy-backports 3.16.0-2~bpo70+1
- jessie 3.16.0-2
- testing 4.9.0-1
- unstable 4.9.0-1
IP-RULE(8) | Linux | IP-RULE(8) |
NAME¶
ip-rule - routing policy database managementSYNOPSIS¶
ip [ OPTIONS ] rule { COMMAND | help }
DESCRIPTION¶
ip rule manipulates rules in the routing policy database control the route selection algorithm.- 1.
- Priority: 0, Selector: match anything, Action: lookup
routing table local (ID 255). The local table is a special
routing table containing high priority control routes for local and
broadcast addresses.
- 2.
- Priority: 32766, Selector: match anything, Action: lookup
routing table main (ID 254). The main table is the normal
routing table containing all non-policy routes. This rule may be deleted
and/or overridden with other ones by the administrator.
- 3.
- Priority: 32767, Selector: match anything, Action: lookup
routing table default (ID 253). The default table is empty.
It is reserved for some post-processing if no previous default rules
selected the packet. This rule may also be deleted.
unicast - the rule prescribes to return the route found in the routing table referenced by the rule.
ip rule add - insert a new rule¶
ip rule delete - delete a rule¶
- type TYPE (default)
- the type of this rule. The list of valid types was given in
the previous subsection.
- from PREFIX
- select the source prefix to match.
- to PREFIX
- select the destination prefix to match.
- iif NAME
- 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.
- oif NAME
- select the outgoing device to match. The outgoing interface
is only available for packets originating from local sockets that are
bound to a device.
- tos TOS
- dsfield TOS
- select the TOS value to match.
- fwmark MARK
- select the fwmark value to match.
- priority PREFERENCE
- the priority of this rule. Each rule should have an
explicitly set unique priority value. The options preference and
order are synonyms with priority.
- table TABLEID
- the routing table identifier to lookup if the rule selector
matches. It is also possible to use lookup instead of table.
- realms FROM/TO
- 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.
- nat ADDRESS
- 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.
ip rule flush - also dumps all the deleted rules.¶
This command has no arguments.ip rule show - list rules¶
This command has no arguments. The options list or lst are synonyms with show.SEE ALSO¶
ip(8)AUTHOR¶
Original Manpage by Michail Litvak <mci@owl.openwall.com>20 Dec 2011 | iproute2 |