to TYPE PREFIX(default)
-- the destination prefix of the route. If
TYPE is omitted,
ip assumes type
unicast. Other values of
are listed above.
PREFIX is an IP or IPv6 address optionally followed
by a slash and the prefix length. If the length of the prefix is missing,
ip assumes a full-length host route. There is also a special
default -- which is equivalent to IP
-- the Type Of Service (TOS) key. This key has no associated mask and
the longest match is understood as: First, compare the TOS
of the route and of the packet. If they are not equal, then the packet
may still match a route with a zero TOS.
TOS is either an 8 bit hexadecimal
number or an identifier from /etc/iproute2/rt_dsfield.
-- the preference value of the route.
NUMBER is an arbitrary 32bit number.
-- the table to add this route to.
TABLEID may be a number or a string from the file
/etc/iproute2/rt_tables. If this parameter is omitted,
ip assumes the
main table, with the exception of
nat routes, which are
put into the
local table by default.
-- the output device name.
-- the address of the nexthop router. Actually, the sense of this field depends
on the route type. For normal
unicast routes it is either the true nexthop
router or, if it is a direct route installed in BSD compatibility mode,
it can be a local address of the interface.
For NAT routes it is the first address of the block of translated IP destinations.
-- the source address to prefer when sending to the destinations covered by the route prefix.
-- the realm to which this route is assigned.
REALMID may be a number or a string from the file
/etc/iproute2/rt_realms. Sec.13 (p.)
contains more information on realms.
mtu lock MTU
-- the MTU along the path to the destination. If the modifier
not used, the MTU may be updated by the kernel due to Path MTU Discovery.
If the modifier
lock is used, no path MTU discovery will be tried,
all packets will be sent without the DF bit in IPv4 case
or fragmented to MTU for IPv6.
-- the maximal window for TCP to advertise to these destinations, measured in bytes. It limits maximal data bursts that our TCP peers are allowed to send to us.
-- the initial RTT (``Round Trip Time'') estimate.
-- [2.3.15+ only] the initial RTT variance estimate.
-- [2.3.15+ only] an estimate for the initial slow start threshold.
-- [2.3.15+ only] the clamp for congestion window. It is ignored if the
flag is not used.
-- [2.3.15+ only] the MSS (``Maximal Segment Size'') to advertise to these destinations when establishing TCP connections. If it is not given, Linux uses a default value calculated from the first hop device MTU.
1cm NB. If the path to these destination is asymmetric, this guess may be wrong.
-- [2.3.15+ only] Maximal reordering on the path to this destination.
If it is not given, Linux uses the value selected with
-- [2.5.74+ only] Maximum number of hops on the path to this destination.
The default is the value selected with the
initcwnd NUMBER-- [2.5.70+ only] Initial congestion window size for connections to this destination. Actual window size is this value multiplied by the MSS (``Maximal Segment Size'') for same connection. The default is zero, meaning to use the values specified in .
+-- [2.6.33+ only] Initial receive window size for connections to + this destination. The actual window size is this value multiplied + by the MSS (''Maximal Segment Size'') of the connection. The default + value is zero, meaning to use Slow Start value.
-- the nexthop of a multipath route.
NEXTHOP is a complex value
with its own syntax similar to the top level argument lists:
via ADDRESSis the nexthop router.
dev NAMEis the output device.
weight NUMBERis a weight for this element of a multipath route reflecting its relative bandwidth or quality.
-- the scope of the destinations covered by the route prefix.
SCOPE_VAL may be a number or a string from the file
If this parameter is omitted,
ip assumes scope
global for all gatewayed
link for direct
-- the routing protocol identifier of this route.
RTPROTO may be a number or a string from the file
/etc/iproute2/rt_protos. If the routing protocol ID is
ip assumes protocol
boot (i.e. it assumes the route was added by someone who doesn't
understand what they are doing). Several protocol values have a fixed interpretation.
redirect-- the route was installed due to an ICMP redirect.
kernel-- the route was installed by the kernel during autoconfiguration.
boot-- the route was installed during the bootup sequence. If a routing daemon starts, it will purge all of them.
static-- the route was installed by the administrator to override dynamic routing. Routing daemon will respect them and, probably, even advertise them to its peers.
ra-- the route was installed by Router Discovery protocol.
-- pretend that the nexthop is directly attached to this link, even if it does not match any interface prefix. One application of this option may be found in .
-- the IPv6 route preference.
PREF PREF is a string specifying the route preference as defined in
RFC4191 for Router Discovery messages. Namely:
low-- the route has a lowest priority.
medium-- the route has a default priority.
high-- the route has a highest priority.
Actually there are more commands:
prepend does the same
thing as classic
route add, i.e. adds a route, even if another
route to the same destination exists. Its opposite case is
which adds the route to the end of the list. Avoid these
More sad news, IPv6 only understands the
append command correctly.
All the others are translated into
append commands. Certainly,
this will change in the future.