to PREFIX
or to TYPE PREFIX
(default)
-- the destination prefix of the route. If TYPE
is omitted,
ip
assumes type unicast
. Other values of TYPE
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
PREFIX
-- default
-- which is equivalent to IP 0/0
or
to IPv6 ::/0
.
tos TOS
or dsfield TOS
-- 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.
metric NUMBER
or preference NUMBER
-- the preference value of the route. NUMBER
is an arbitrary 32bit number.
table TABLEID
-- 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
local
, broadcast
and nat
routes, which are
put into the local
table by default.
dev NAME
-- the output device name.
via ADDRESS
-- 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.
src ADDRESS
-- the source address to prefer when sending to the destinations covered by the route prefix.
realm REALMID
-- 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 MTU
or mtu lock MTU
-- the MTU along the path to the destination. If the modifier lock
is
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.
window NUMBER
-- 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.
rtt NUMBER
-- the initial RTT (``Round Trip Time'') estimate.
rttvar NUMBER
-- [2.3.15+ only] the initial RTT variance estimate.
ssthresh NUMBER
-- [2.3.15+ only] an estimate for the initial slow start threshold.
cwnd NUMBER
-- [2.3.15+ only] the clamp for congestion window. It is ignored if the lock
flag is not used.
advmss NUMBER
-- [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.
reordering NUMBER
-- [2.3.15+ only] Maximal reordering on the path to this destination.
If it is not given, Linux uses the value selected with sysctl
variable net/ipv4/tcp_reordering
.
hoplimit NUMBER
-- [2.5.74+ only] Maximum number of hops on the path to this destination.
The default is the value selected with the sysctl
variable
net/ipv4/ip_default_ttl
.
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 [10].
+
initrwnd NUMBER
+-- [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.
nexthop NEXTHOP
-- the nexthop of a multipath route. NEXTHOP
is a complex value
with its own syntax similar to the top level argument lists:
via ADDRESS
is the nexthop router.
dev NAME
is the output device.
weight NUMBER
is a weight for this element of a multipath
route reflecting its relative bandwidth or quality.
scope SCOPE_VAL
-- the scope of the destinations covered by the route prefix.
SCOPE_VAL
may be a number or a string from the file
/etc/iproute2/rt_scopes
.
If this parameter is omitted,
ip
assumes scope global
for all gatewayed unicast
routes, scope link
for direct unicast
and broadcast
routes
and scope host
for local
routes.
protocol RTPROTO
-- 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
not given, 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.
Namely:
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.
rtnetlink.h
or in rt_protos
database.
onlink
-- 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 [6].
pref PREF
-- 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.
1cm NB.
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 append
,
which adds the route to the end of the list. Avoid these
features.
1cm NB.
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.