Blame man/man8/ip-route.8.in

Packit Service 3880ab
.TH IP\-ROUTE 8 "13 Dec 2012" "iproute2" "Linux"
Packit Service 3880ab
.SH "NAME"
Packit Service 3880ab
ip-route \- routing table management
Packit Service 3880ab
.SH "SYNOPSIS"
Packit Service 3880ab
.sp
Packit Service 3880ab
.ad l
Packit Service 3880ab
.in +8
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.B ip
Packit Service 3880ab
.RI "[ " ip-OPTIONS " ]"
Packit Service 3880ab
.B route
Packit Service 3880ab
.RI " { " COMMAND " | "
Packit Service 3880ab
.BR help " }"
Packit Service 3880ab
.sp
Packit Service 3880ab
.ti -8
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip route" " { "
Packit Service 3880ab
.BR show " | " flush " } "
Packit Service 3880ab
.I  SELECTOR
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip route save"
Packit Service 3880ab
.I SELECTOR
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip route restore"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.B  ip route get
Packit Service 3880ab
.I ROUTE_GET_FLAGS
Packit Service 3880ab
.IR ADDRESS " [ "
Packit Service 3880ab
.BI from " ADDRESS " iif " STRING"
Packit Service 3880ab
.RB " ] [ " oif
Packit Service 3880ab
.IR STRING " ] [ "
Packit Service 3880ab
.B  mark
Packit Service 3880ab
.IR MARK " ] [ "
Packit Service 3880ab
.B  tos
Packit Service 3880ab
.IR TOS " ] [ "
Packit Service 3880ab
.B  vrf
Packit Service 3880ab
.IR NAME " ] [ "
Packit Service 3880ab
.B  ipproto
Packit Service 3880ab
.IR PROTOCOL " ] [ "
Packit Service 3880ab
.B  sport
Packit Service 3880ab
.IR NUMBER " ] [ "
Packit Service 3880ab
.B  dport
Packit Service 3880ab
.IR NUMBER " ] "
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.BR "ip route" " { " add " | " del " | " change " | " append " | "\
Packit Service 3880ab
replace " } "
Packit Service 3880ab
.I  ROUTE
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR SELECTOR " := "
Packit Service 3880ab
.RB "[ " root
Packit Service 3880ab
.IR PREFIX " ] [ "
Packit Service 3880ab
.B  match
Packit Service 3880ab
.IR PREFIX " ] [ "
Packit Service 3880ab
.B  exact
Packit Service 3880ab
.IR PREFIX " ] [ "
Packit Service 3880ab
.B  table
Packit Service 3880ab
.IR TABLE_ID " ] [ "
Packit Service 3880ab
.B  vrf
Packit Service 3880ab
.IR NAME " ] [ "
Packit Service 3880ab
.B  proto
Packit Service 3880ab
.IR RTPROTO " ] [ "
Packit Service 3880ab
.B  type
Packit Service 3880ab
.IR TYPE " ] [ "
Packit Service 3880ab
.B  scope
Packit Service 3880ab
.IR SCOPE " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR NODE_SPEC " := [ " TYPE " ] " PREFIX " ["
Packit Service 3880ab
.B  tos
Packit Service 3880ab
.IR TOS " ] [ "
Packit Service 3880ab
.B  table
Packit Service 3880ab
.IR TABLE_ID " ] [ "
Packit Service 3880ab
.B  proto
Packit Service 3880ab
.IR RTPROTO " ] [ "
Packit Service 3880ab
.B  scope
Packit Service 3880ab
.IR SCOPE " ] [ "
Packit Service 3880ab
.B  metric
Packit Service 3880ab
.IR METRIC " ] [ "
Packit Service 3880ab
.B  ttl-propagate
Packit Service 3880ab
.RB "{ " enabled " | " disabled " } ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR INFO_SPEC " := { " NH " | "
Packit Service 3880ab
.B nhid
Packit Service 3880ab
.IR ID " } " "OPTIONS FLAGS" " ["
Packit Service 3880ab
.B  nexthop
Packit Service 3880ab
.IR NH " ] ..."
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR NH " := [ "
Packit Service 3880ab
.B  encap
Packit Service 3880ab
.IR ENCAP " ] [ "
Packit Service 3880ab
.B  via
Packit Service 3880ab
[
Packit Service 3880ab
.IR FAMILY " ] " ADDRESS " ] [ "
Packit Service 3880ab
.B  dev
Packit Service 3880ab
.IR STRING " ] [ "
Packit Service 3880ab
.B  weight
Packit Service 3880ab
.IR NUMBER " ] " NHFLAGS
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR FAMILY " := [ "
Packit Service 3880ab
.BR inet " | " inet6 " | " mpls " | " bridge " | " link " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR OPTIONS " := " FLAGS " [ "
Packit Service 3880ab
.B  mtu
Packit Service 3880ab
.IR NUMBER " ] [ "
Packit Service 3880ab
.B  advmss
Packit Service 3880ab
.IR NUMBER " ] [ "
Packit Service 3880ab
.B  as
Packit Service 3880ab
[
Packit Service 3880ab
.B to
Packit Service 3880ab
]
Packit Service 3880ab
.IR ADDRESS " ]"
Packit Service 3880ab
.B  rtt
Packit Service 3880ab
.IR TIME " ] [ "
Packit Service 3880ab
.B  rttvar
Packit Service 3880ab
.IR TIME " ] [ "
Packit Service 3880ab
.B  reordering
Packit Service 3880ab
.IR NUMBER " ] [ "
Packit Service 3880ab
.B  window
Packit Service 3880ab
.IR NUMBER " ] [ "
Packit Service 3880ab
.B  cwnd
Packit Service 3880ab
.IR NUMBER " ] [ "
Packit Service 3880ab
.B  ssthresh
Packit Service 3880ab
.IR NUMBER " ] [ "
Packit Service 3880ab
.B  realms
Packit Service 3880ab
.IR REALM " ] [ "
Packit Service 3880ab
.B  rto_min
Packit Service 3880ab
.IR TIME " ] [ "
Packit Service 3880ab
.B  initcwnd
Packit Service 3880ab
.IR NUMBER " ] [ "
Packit Service 3880ab
.B  initrwnd
Packit Service 3880ab
.IR NUMBER " ] [ "
Packit Service 3880ab
.B  features
Packit Service 3880ab
.IR FEATURES " ] [ "
Packit Service 3880ab
.B  quickack
Packit Service 3880ab
.IR BOOL " ] [ "
Packit Service 3880ab
.B  congctl
Packit Service 3880ab
.IR NAME " ] [ "
Packit Service 3880ab
.B  pref
Packit Service 3880ab
.IR PREF " ] [ "
Packit Service 3880ab
.B  expires
Packit Service 3880ab
.IR TIME " ] ["
Packit Service 3880ab
.B  fastopen_no_cookie
Packit Service 3880ab
.IR BOOL " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR TYPE " := [ "
Packit Service 3880ab
.BR unicast " | " local " | " broadcast " | " multicast " | "\
Packit Service 3880ab
throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR TABLE_ID " := [ "
Packit Service 3880ab
.BR local "| " main " | " default " | " all " |"
Packit Service 3880ab
.IR NUMBER " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR SCOPE " := [ "
Packit Service 3880ab
.BR host " | " link " | " global " |"
Packit Service 3880ab
.IR NUMBER " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR NHFLAGS " := [ "
Packit Service 3880ab
.BR onlink " | " pervasive " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR RTPROTO " := [ "
Packit Service 3880ab
.BR kernel " | " boot " | " static " |"
Packit Service 3880ab
.IR NUMBER " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR FEATURES " := [ "
Packit Service 3880ab
.BR ecn " | ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR PREF " := [ "
Packit Service 3880ab
.BR low " | " medium " | " high " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR ENCAP " := [ "
Packit Service 3880ab
.IR ENCAP_MPLS " | " ENCAP_IP " | " ENCAP_BPF " | "
Packit Service 3880ab
.IR ENCAP_SEG6 " | " ENCAP_SEG6LOCAL " ] "
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR ENCAP_MPLS " := "
Packit Service 3880ab
.BR mpls " [ "
Packit Service 3880ab
.IR LABEL " ] ["
Packit Service 3880ab
.B  ttl
Packit Service 3880ab
.IR TTL " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR ENCAP_IP " := "
Packit Service 3880ab
.B ip
Packit Service 3880ab
.B id
Packit Service 3880ab
.IR TUNNEL_ID
Packit Service 3880ab
.B  dst
Packit Service 3880ab
.IR REMOTE_IP " [ "
Packit Service 3880ab
.B src
Packit Service 3880ab
.IR SRC " ] ["
Packit Service 3880ab
.B tos
Packit Service 3880ab
.IR TOS " ] ["
Packit Service 3880ab
.B  ttl
Packit Service 3880ab
.IR TTL " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR ENCAP_BPF " := "
Packit Service 3880ab
.BR bpf " [ "
Packit Service 3880ab
.B in
Packit Service 3880ab
.IR PROG " ] ["
Packit Service 3880ab
.B out
Packit Service 3880ab
.IR PROG " ] ["
Packit Service 3880ab
.B xmit
Packit Service 3880ab
.IR PROG " ] ["
Packit Service 3880ab
.B headroom
Packit Service 3880ab
.IR SIZE " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR ENCAP_SEG6 " := "
Packit Service 3880ab
.B seg6
Packit Service 3880ab
.BR mode " [ "
Packit Service 3880ab
.BR encap " | " inline " | " l2encap " ] "
Packit Service 3880ab
.B segs
Packit Service 3880ab
.IR SEGMENTS " [ "
Packit Service 3880ab
.B hmac
Packit Service 3880ab
.IR KEYID " ]"
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR ENCAP_SEG6LOCAL " := "
Packit Service 3880ab
.B seg6local
Packit Service 3880ab
.BR action
Packit Service 3880ab
.IR SEG6_ACTION " [ "
Packit Service 3880ab
.IR SEG6_ACTION_PARAM " ] "
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR ROUTE_GET_FLAGS " := "
Packit Service 3880ab
.BR " [ "
Packit Service 3880ab
.BR fibmatch
Packit Service 3880ab
.BR " ] "
Packit Service 3880ab
Packit Service 3880ab
.SH DESCRIPTION
Packit Service 3880ab
.B ip route
Packit Service 3880ab
is used to manipulate entries in the kernel routing tables.
Packit Service 3880ab
.sp
Packit Service 3880ab
.B Route types:
Packit Service 3880ab
Packit Service 3880ab
.in +8
Packit Service 3880ab
.B unicast
Packit Service 3880ab
- the route entry describes real paths to the destinations covered
Packit Service 3880ab
by the route prefix.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
.B unreachable
Packit Service 3880ab
- these destinations are unreachable. Packets are discarded and the
Packit Service 3880ab
ICMP message
Packit Service 3880ab
.I host unreachable
Packit Service 3880ab
is generated.
Packit Service 3880ab
The local senders get an
Packit Service 3880ab
.I EHOSTUNREACH
Packit Service 3880ab
error.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
.B blackhole
Packit Service 3880ab
- these destinations are unreachable. Packets are discarded silently.
Packit Service 3880ab
The local senders get an
Packit Service 3880ab
.I EINVAL
Packit Service 3880ab
error.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
.B prohibit
Packit Service 3880ab
- these destinations are unreachable. Packets are discarded and the
Packit Service 3880ab
ICMP message
Packit Service 3880ab
.I communication administratively prohibited
Packit Service 3880ab
is generated. The local senders get an
Packit Service 3880ab
.I EACCES
Packit Service 3880ab
error.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
.B local
Packit Service 3880ab
- the destinations are assigned to this host. The packets are looped
Packit Service 3880ab
back and delivered locally.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
.B broadcast
Packit Service 3880ab
- the destinations are broadcast addresses. The packets are sent as
Packit Service 3880ab
link broadcasts.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
.B throw
Packit Service 3880ab
- a special control route used together with policy rules. If such a
Packit Service 3880ab
route is selected, lookup in this table is terminated pretending that
Packit Service 3880ab
no route was found. Without policy routing it is equivalent to the
Packit Service 3880ab
absence of the route in the routing table. The packets are dropped
Packit Service 3880ab
and the ICMP message
Packit Service 3880ab
.I net unreachable
Packit Service 3880ab
is generated. The local senders get an
Packit Service 3880ab
.I ENETUNREACH
Packit Service 3880ab
error.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
.B nat
Packit Service 3880ab
- a special NAT route. Destinations covered by the prefix
Packit Service 3880ab
are considered to be dummy (or external) addresses which require translation
Packit Service 3880ab
to real (or internal) ones before forwarding. The addresses to translate to
Packit Service 3880ab
are selected with the attribute
Packit Service 3880ab
.BR "via" .
Packit Service 3880ab
.B Warning:
Packit Service 3880ab
Route NAT is no longer supported in Linux 2.6.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
.B anycast
Packit Service 3880ab
.RI "- " "not implemented"
Packit Service 3880ab
the destinations are
Packit Service 3880ab
.I anycast
Packit Service 3880ab
addresses assigned to this host. They are mainly equivalent
Packit Service 3880ab
to
Packit Service 3880ab
.B local
Packit Service 3880ab
with one difference: such addresses are invalid when used
Packit Service 3880ab
as the source address of any packet.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
.B multicast
Packit Service 3880ab
- a special type used for multicast routing. It is not present in
Packit Service 3880ab
normal routing tables.
Packit Service 3880ab
.in -8
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
.B Route tables:
Packit Service 3880ab
Linux-2.x can pack routes into several routing tables identified
Packit Service 3880ab
by a number in the range from 1 to 2^32-1 or by name from the file
Packit Service 3880ab
.B @SYSCONFDIR@/rt_tables
Packit Service 3880ab
By default all normal routes are inserted into the
Packit Service 3880ab
.B main
Packit Service 3880ab
table (ID 254) and the kernel only uses this table when calculating routes.
Packit Service 3880ab
Values (0, 253, 254, and 255) are reserved for built-in use.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
Actually, one other table always exists, which is invisible but
Packit Service 3880ab
even more important. It is the
Packit Service 3880ab
.B local
Packit Service 3880ab
table (ID 255). This table
Packit Service 3880ab
consists of routes for local and broadcast addresses. The kernel maintains
Packit Service 3880ab
this table automatically and the administrator usually need not modify it
Packit Service 3880ab
or even look at it.
Packit Service 3880ab
Packit Service 3880ab
The multiple routing tables enter the game when
Packit Service 3880ab
.I policy routing
Packit Service 3880ab
is used.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
ip route add
Packit Service 3880ab
add new route
Packit Service 3880ab
.TP
Packit Service 3880ab
ip route change
Packit Service 3880ab
change route
Packit Service 3880ab
.TP
Packit Service 3880ab
ip route replace
Packit Service 3880ab
change or add new one
Packit Service 3880ab
.RS
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI to " TYPE PREFIX " (default)
Packit Service 3880ab
the destination prefix of the route. If
Packit Service 3880ab
.I TYPE
Packit Service 3880ab
is omitted,
Packit Service 3880ab
.B ip
Packit Service 3880ab
assumes type
Packit Service 3880ab
.BR "unicast" .
Packit Service 3880ab
Other values of
Packit Service 3880ab
.I TYPE
Packit Service 3880ab
are listed above.
Packit Service 3880ab
.I PREFIX
Packit Service 3880ab
is an IP or IPv6 address optionally followed by a slash and the
Packit Service 3880ab
prefix length. If the length of the prefix is missing,
Packit Service 3880ab
.B ip
Packit Service 3880ab
assumes a full-length host route. There is also a special
Packit Service 3880ab
.I PREFIX
Packit Service 3880ab
.B default
Packit Service 3880ab
- which is equivalent to IP
Packit Service 3880ab
.B 0/0
Packit Service 3880ab
or to IPv6
Packit Service 3880ab
.BR "::/0" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI tos " TOS"
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI dsfield " TOS"
Packit Service 3880ab
the Type Of Service (TOS) key. This key has no associated mask and
Packit Service 3880ab
the longest match is understood as: First, compare the TOS
Packit Service 3880ab
of the route and of the packet. If they are not equal, then the packet
Packit Service 3880ab
may still match a route with a zero TOS.
Packit Service 3880ab
.I TOS
Packit Service 3880ab
is either an 8 bit hexadecimal number or an identifier
Packit Service 3880ab
from
Packit Service 3880ab
.BR "@SYSCONFDIR@/rt_dsfield" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI metric " NUMBER"
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI preference " NUMBER"
Packit Service 3880ab
the preference value of the route.
Packit Service 3880ab
.I NUMBER
Packit Service 3880ab
is an arbitrary 32bit number, where routes with lower values are preferred.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI table " TABLEID"
Packit Service 3880ab
the table to add this route to.
Packit Service 3880ab
.I TABLEID
Packit Service 3880ab
may be a number or a string from the file
Packit Service 3880ab
.BR "@SYSCONFDIR@/rt_tables" .
Packit Service 3880ab
If this parameter is omitted,
Packit Service 3880ab
.B ip
Packit Service 3880ab
assumes the
Packit Service 3880ab
.B main
Packit Service 3880ab
table, with the exception of
Packit Service 3880ab
.BR local ", " broadcast " and " nat
Packit Service 3880ab
routes, which are put into the
Packit Service 3880ab
.B local
Packit Service 3880ab
table by default.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI vrf " NAME"
Packit Service 3880ab
the vrf name to add this route to. Implicitly means the table
Packit Service 3880ab
associated with the VRF.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI dev " NAME"
Packit Service 3880ab
the output device name.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI via " [ FAMILY ] ADDRESS"
Packit Service 3880ab
the address of the nexthop router, in the address family FAMILY.
Packit Service 3880ab
Actually, the sense of this field depends on the route type.  For
Packit Service 3880ab
normal
Packit Service 3880ab
.B unicast
Packit Service 3880ab
routes it is either the true next hop router or, if it is a direct
Packit Service 3880ab
route installed in BSD compatibility mode, it can be a local address
Packit Service 3880ab
of the interface. For NAT routes it is the first address of the block
Packit Service 3880ab
of translated IP destinations.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI src " ADDRESS"
Packit Service 3880ab
the source address to prefer when sending to the destinations
Packit Service 3880ab
covered by the route prefix.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI realm " REALMID"
Packit Service 3880ab
the realm to which this route is assigned.
Packit Service 3880ab
.I REALMID
Packit Service 3880ab
may be a number or a string from the file
Packit Service 3880ab
.BR "@SYSCONFDIR@/rt_realms" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI mtu " MTU"
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI "mtu lock" " MTU"
Packit Service 3880ab
the MTU along the path to the destination. If the modifier
Packit Service 3880ab
.B lock
Packit Service 3880ab
is not used, the MTU may be updated by the kernel due to
Packit Service 3880ab
Path MTU Discovery. If the modifier
Packit Service 3880ab
.B lock
Packit Service 3880ab
is used, no path MTU discovery will be tried, all packets
Packit Service 3880ab
will be sent without the DF bit in IPv4 case or fragmented
Packit Service 3880ab
to MTU for IPv6.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI window " NUMBER"
Packit Service 3880ab
the maximal window for TCP to advertise to these destinations,
Packit Service 3880ab
measured in bytes. It limits maximal data bursts that our TCP
Packit Service 3880ab
peers are allowed to send to us.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI rtt " TIME"
Packit Service 3880ab
the initial RTT ('Round Trip Time') estimate. If no suffix is
Packit Service 3880ab
specified the units are raw values passed directly to the
Packit Service 3880ab
routing code to maintain compatibility with previous releases.
Packit Service 3880ab
Otherwise if a suffix of s, sec or secs is used to specify
Packit Service 3880ab
seconds and ms, msec or msecs to specify milliseconds.
Packit Service 3880ab
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI rttvar " TIME " "(Linux 2.3.15+ only)"
Packit Service 3880ab
the initial RTT variance estimate. Values are specified as with
Packit Service 3880ab
.BI rtt
Packit Service 3880ab
above.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI rto_min " TIME " "(Linux 2.6.23+ only)"
Packit Service 3880ab
the minimum TCP Retransmission TimeOut to use when communicating with this
Packit Service 3880ab
destination. Values are specified as with
Packit Service 3880ab
.BI rtt
Packit Service 3880ab
above.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI ssthresh " NUMBER " "(Linux 2.3.15+ only)"
Packit Service 3880ab
an estimate for the initial slow start threshold.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI cwnd " NUMBER " "(Linux 2.3.15+ only)"
Packit Service 3880ab
the clamp for congestion window. It is ignored if the
Packit Service 3880ab
.B lock
Packit Service 3880ab
flag is not used.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI initcwnd " NUMBER " "(Linux 2.5.70+ only)"
Packit Service 3880ab
the initial congestion window size for connections to this destination.
Packit Service 3880ab
Actual window size is this value multiplied by the MSS
Packit Service 3880ab
(``Maximal Segment Size'') for same connection. The default is
Packit Service 3880ab
zero, meaning to use the values specified in RFC2414.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI initrwnd " NUMBER " "(Linux 2.6.33+ only)"
Packit Service 3880ab
the initial receive window size for connections to this destination.
Packit Service 3880ab
Actual window size is this value multiplied by the MSS of the connection.
Packit Service 3880ab
The default value is zero, meaning to use Slow Start value.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI features " FEATURES " (Linux 3.18+ only)
Packit Service 3880ab
Enable or disable per-route features. Only available feature at this
Packit Service 3880ab
time is
Packit Service 3880ab
.B ecn
Packit Service 3880ab
to enable explicit congestion notification when initiating connections to the
Packit Service 3880ab
given destination network.
Packit Service 3880ab
When responding to a connection request from the given network, ecn will
Packit Service 3880ab
also be used even if the
Packit Service 3880ab
.B net.ipv4.tcp_ecn
Packit Service 3880ab
sysctl is set to 0.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI quickack " BOOL " "(Linux 3.11+ only)"
Packit Service 3880ab
Enable or disable quick ack for connections to this destination.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI fastopen_no_cookie " BOOL " "(Linux 4.15+ only)"
Packit Service 3880ab
Enable TCP Fastopen without a cookie for connections to this destination.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI congctl " NAME " "(Linux 3.20+ only)"
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI "congctl lock" " NAME " "(Linux 3.20+ only)"
Packit Service 3880ab
Sets a specific TCP congestion control algorithm only for a given destination.
Packit Service 3880ab
If not specified, Linux keeps the current global default TCP congestion control
Packit Service 3880ab
algorithm, or the one set from the application. If the modifier
Packit Service 3880ab
.B lock
Packit Service 3880ab
is not used, an application may nevertheless overwrite the suggested congestion
Packit Service 3880ab
control algorithm for that destination. If the modifier
Packit Service 3880ab
.B lock
Packit Service 3880ab
is used, then an application is not allowed to overwrite the specified congestion
Packit Service 3880ab
control algorithm for that destination, thus it will be enforced/guaranteed to
Packit Service 3880ab
use the proposed algorithm.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI advmss " NUMBER " "(Linux 2.3.15+ only)"
Packit Service 3880ab
the MSS ('Maximal Segment Size') to advertise to these
Packit Service 3880ab
destinations when establishing TCP connections. If it is not given,
Packit Service 3880ab
Linux uses a default value calculated from the first hop device MTU.
Packit Service 3880ab
(If the path to these destination is asymmetric, this guess may be wrong.)
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI reordering " NUMBER " "(Linux 2.3.15+ only)"
Packit Service 3880ab
Maximal reordering on the path to this destination.
Packit Service 3880ab
If it is not given, Linux uses the value selected with
Packit Service 3880ab
.B sysctl
Packit Service 3880ab
variable
Packit Service 3880ab
.BR "net/ipv4/tcp_reordering" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI nexthop " NEXTHOP"
Packit Service 3880ab
the nexthop of a multipath route.
Packit Service 3880ab
.I NEXTHOP
Packit Service 3880ab
is a complex value with its own syntax similar to the top level
Packit Service 3880ab
argument lists:
Packit Service 3880ab
Packit Service 3880ab
.in +8
Packit Service 3880ab
.BI via " [ FAMILY ] ADDRESS"
Packit Service 3880ab
- is the nexthop router.
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.BI dev " NAME"
Packit Service 3880ab
- is the output device.
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.BI weight " NUMBER"
Packit Service 3880ab
- is a weight for this element of a multipath
Packit Service 3880ab
route reflecting its relative bandwidth or quality.
Packit Service 3880ab
.in -8
Packit Service 3880ab
Packit Service 3880ab
The internal buffer used in iproute2 limits the maximum number of nexthops that
Packit Service 3880ab
may be specified in one go. If only
Packit Service 3880ab
.I ADDRESS
Packit Service 3880ab
is given, the current buffer size allows for 144 IPv6 nexthops and 253 IPv4
Packit Service 3880ab
ones. For IPv4, this effectively limits the number of nexthops possible per
Packit Service 3880ab
route. With IPv6, further nexthops may be appended to the same route via
Packit Service 3880ab
.B "ip route append"
Packit Service 3880ab
command.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI scope " SCOPE_VAL"
Packit Service 3880ab
the scope of the destinations covered by the route prefix.
Packit Service 3880ab
.I SCOPE_VAL
Packit Service 3880ab
may be a number or a string from the file
Packit Service 3880ab
.BR "@SYSCONFDIR@/rt_scopes" .
Packit Service 3880ab
If this parameter is omitted,
Packit Service 3880ab
.B ip
Packit Service 3880ab
assumes scope
Packit Service 3880ab
.B global
Packit Service 3880ab
for all gatewayed
Packit Service 3880ab
.B unicast
Packit Service 3880ab
routes, scope
Packit Service 3880ab
.B link
Packit Service 3880ab
for direct
Packit Service 3880ab
.BR unicast " and " broadcast
Packit Service 3880ab
routes and scope
Packit Service 3880ab
.BR host " for " local
Packit Service 3880ab
routes.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI protocol " RTPROTO"
Packit Service 3880ab
the routing protocol identifier of this route.
Packit Service 3880ab
.I RTPROTO
Packit Service 3880ab
may be a number or a string from the file
Packit Service 3880ab
.BR "@SYSCONFDIR@/rt_protos" .
Packit Service 3880ab
If the routing protocol ID is not given,
Packit Service 3880ab
.B ip assumes protocol
Packit Service 3880ab
.B boot
Packit Service 3880ab
(i.e. it assumes the route was added by someone who doesn't
Packit Service 3880ab
understand what they are doing). Several protocol values have
Packit Service 3880ab
a fixed interpretation.
Packit Service 3880ab
Namely:
Packit Service 3880ab
Packit Service 3880ab
.in +8
Packit Service 3880ab
.B redirect
Packit Service 3880ab
- the route was installed due to an ICMP redirect.
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B kernel
Packit Service 3880ab
- the route was installed by the kernel during autoconfiguration.
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B boot
Packit Service 3880ab
- the route was installed during the bootup sequence.
Packit Service 3880ab
If a routing daemon starts, it will purge all of them.
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B static
Packit Service 3880ab
- the route was installed by the administrator
Packit Service 3880ab
to override dynamic routing. Routing daemon will respect them
Packit Service 3880ab
and, probably, even advertise them to its peers.
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B ra
Packit Service 3880ab
- the route was installed by Router Discovery protocol.
Packit Service 3880ab
.in -8
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
The rest of the values are not reserved and the administrator is free
Packit Service 3880ab
to assign (or not to assign) protocol tags.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B onlink
Packit Service 3880ab
pretend that the nexthop is directly attached to this link,
Packit Service 3880ab
even if it does not match any interface prefix.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI pref " PREF"
Packit Service 3880ab
the IPv6 route preference.
Packit Service 3880ab
.I PREF
Packit Service 3880ab
is a string specifying the route preference as defined in RFC4191 for Router
Packit Service 3880ab
Discovery messages. Namely:
Packit Service 3880ab
Packit Service 3880ab
.in +8
Packit Service 3880ab
.B low
Packit Service 3880ab
- the route has a lowest priority
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B medium
Packit Service 3880ab
- the route has a default priority
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B high
Packit Service 3880ab
- the route has a highest priority
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI nhid " ID"
Packit Service 3880ab
use nexthop object with given id as nexthop specification.
Packit Service 3880ab
.sp
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI encap " ENCAPTYPE ENCAPHDR"
Packit Service 3880ab
attach tunnel encapsulation attributes to this route.
Packit Service 3880ab
.sp
Packit Service 3880ab
.I ENCAPTYPE
Packit Service 3880ab
is a string specifying the supported encapsulation type. Namely:
Packit Service 3880ab
Packit Service 3880ab
.in +8
Packit Service 3880ab
.BI mpls
Packit Service 3880ab
- encapsulation type MPLS
Packit Service 3880ab
.sp
Packit Service 3880ab
.BI ip
Packit Service 3880ab
- IP encapsulation (Geneve, GRE, VXLAN, ...)
Packit Service 3880ab
.sp
Packit Service 3880ab
.BI bpf
Packit Service 3880ab
- Execution of BPF program
Packit Service 3880ab
.sp
Packit Service 3880ab
.BI seg6
Packit Service 3880ab
- encapsulation type IPv6 Segment Routing
Packit Service 3880ab
.sp
Packit Service 3880ab
.BI seg6local
Packit Service 3880ab
- local SRv6 segment processing
Packit Service 3880ab
Packit Service 3880ab
.in -8
Packit Service 3880ab
.I ENCAPHDR
Packit Service 3880ab
is a set of encapsulation attributes specific to the
Packit Service 3880ab
.I ENCAPTYPE.
Packit Service 3880ab
Packit Service 3880ab
.in +8
Packit Service 3880ab
.B mpls
Packit Service 3880ab
.in +2
Packit Service 3880ab
.I MPLSLABEL
Packit Service 3880ab
- mpls label stack with labels separated by
Packit Service 3880ab
.I "/"
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B ttl
Packit Service 3880ab
.I TTL
Packit Service 3880ab
- TTL to use for MPLS header or 0 to inherit from IP header
Packit Service 3880ab
.in -2
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B ip
Packit Service 3880ab
.in +2
Packit Service 3880ab
.B id
Packit Service 3880ab
.I TUNNEL_ID
Packit Service 3880ab
.B  dst
Packit Service 3880ab
.IR REMOTE_IP " [ "
Packit Service 3880ab
.B src
Packit Service 3880ab
.IR SRC " ] ["
Packit Service 3880ab
.B tos
Packit Service 3880ab
.IR TOS " ] ["
Packit Service 3880ab
.B  ttl
Packit Service 3880ab
.IR TTL " ] [ "
Packit Service 3880ab
.BR key " ] [ " csum " ] [ " seq " ] "
Packit Service 3880ab
.in -2
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B bpf
Packit Service 3880ab
.in +2
Packit Service 3880ab
.B in
Packit Service 3880ab
.I PROG
Packit Service 3880ab
- BPF program to execute for incoming packets
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B out
Packit Service 3880ab
.I PROG
Packit Service 3880ab
- BPF program to execute for outgoing packets
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B xmit
Packit Service 3880ab
.I PROG
Packit Service 3880ab
- BPF program to execute for transmitted packets
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B headroom
Packit Service 3880ab
.I SIZE
Packit Service 3880ab
- Size of header BPF program will attach (xmit)
Packit Service 3880ab
.in -2
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B seg6
Packit Service 3880ab
.in +2
Packit Service 3880ab
.B mode inline
Packit Service 3880ab
- Directly insert Segment Routing Header after IPv6 header
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B mode encap
Packit Service 3880ab
- Encapsulate packet in an outer IPv6 header with SRH
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B mode l2encap
Packit Service 3880ab
- Encapsulate ingress L2 frame within an outer IPv6 header and SRH
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.I SEGMENTS
Packit Service 3880ab
- List of comma-separated IPv6 addresses
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.I KEYID
Packit Service 3880ab
- Numerical value in decimal representation. See \fBip-sr\fR(8).
Packit Service 3880ab
.in -2
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.B seg6local
Packit Service 3880ab
.in +2
Packit Service 3880ab
.IR SEG6_ACTION " [ "
Packit Service 3880ab
.IR SEG6_ACTION_PARAM " ] "
Packit Service 3880ab
- Operation to perform on matching packets.
Packit Service 3880ab
The following actions are currently supported (\fBLinux 4.14+ only\fR).
Packit Service 3880ab
.in +2
Packit Service 3880ab
Packit Service 3880ab
.B End
Packit Service 3880ab
- Regular SRv6 processing as intermediate segment endpoint.
Packit Service 3880ab
This action only accepts packets with a non-zero Segments Left
Packit Service 3880ab
value. Other matching packets are dropped.
Packit Service 3880ab
Packit Service 3880ab
.B End.X nh6
Packit Service 3880ab
.I NEXTHOP
Packit Service 3880ab
- Regular SRv6 processing as intermediate segment endpoint.
Packit Service 3880ab
Additionally, forward processed packets to given next-hop.
Packit Service 3880ab
This action only accepts packets with a non-zero Segments Left
Packit Service 3880ab
value. Other matching packets are dropped.
Packit Service 3880ab
Packit Service 3880ab
.B End.DX6 nh6
Packit Service 3880ab
.I NEXTHOP
Packit Service 3880ab
- Decapsulate inner IPv6 packet and forward it to the
Packit Service 3880ab
specified next-hop. If the argument is set to ::, then
Packit Service 3880ab
the next-hop is selected according to the local selection
Packit Service 3880ab
rules. This action only accepts packets with either a zero Segments
Packit Service 3880ab
Left value or no SRH at all, and an inner IPv6 packet. Other
Packit Service 3880ab
matching packets are dropped.
Packit Service 3880ab
Packit Service 3880ab
.B End.B6 srh segs
Packit Service 3880ab
.IR SEGMENTS " [ "
Packit Service 3880ab
.B hmac
Packit Service 3880ab
.IR KEYID " ] "
Packit Service 3880ab
- Insert the specified SRH immediately after the IPv6 header,
Packit Service 3880ab
update the DA with the first segment of the newly inserted SRH,
Packit Service 3880ab
then forward the resulting packet. The original SRH is not
Packit Service 3880ab
modified. This action only accepts packets with a non-zero
Packit Service 3880ab
Segments Left value. Other matching packets are dropped.
Packit Service 3880ab
Packit Service 3880ab
.B End.B6.Encaps srh segs
Packit Service 3880ab
.IR SEGMENTS " [ "
Packit Service 3880ab
.B hmac
Packit Service 3880ab
.IR KEYID " ] "
Packit Service 3880ab
- Regular SRv6 processing as intermediate segment endpoint.
Packit Service 3880ab
Additionally, encapsulate the matching packet within an outer IPv6 header
Packit Service 3880ab
followed by the specified SRH. The destination address of the outer IPv6
Packit Service 3880ab
header is set to the first segment of the new SRH. The source
Packit Service 3880ab
address is set as described in \fBip-sr\fR(8).
Packit Service 3880ab
.in -4
Packit Service 3880ab
Packit Service 3880ab
.in -8
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI expires " TIME " "(Linux 4.4+ only)"
Packit Service 3880ab
the route will be deleted after the expires time.
Packit Service 3880ab
.B Only
Packit Service 3880ab
support IPv6 at present.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR ttl-propagate " { " enabled " | " disabled " } "
Packit Service 3880ab
Control whether TTL should be propagated from any encap into the
Packit Service 3880ab
un-encapsulated packet, overriding any global configuration. Only
Packit Service 3880ab
supported for MPLS at present.
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
ip route delete
Packit Service 3880ab
delete route
Packit Service 3880ab
.RS
Packit Service 3880ab
.B ip route del
Packit Service 3880ab
has the same arguments as
Packit Service 3880ab
.BR "ip route add" ,
Packit Service 3880ab
but their semantics are a bit different.
Packit Service 3880ab
Packit Service 3880ab
Key values
Packit Service 3880ab
.RB "(" to ", " tos ", " preference " and " table ")"
Packit Service 3880ab
select the route to delete. If optional attributes are present,
Packit Service 3880ab
.B ip
Packit Service 3880ab
verifies that they coincide with the attributes of the route to delete.
Packit Service 3880ab
If no route with the given key and attributes was found,
Packit Service 3880ab
.B ip route del
Packit Service 3880ab
fails.
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
ip route show
Packit Service 3880ab
list routes
Packit Service 3880ab
.RS
Packit Service 3880ab
the command displays the contents of the routing tables or the route(s)
Packit Service 3880ab
selected by some criteria.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI to " SELECTOR " (default)
Packit Service 3880ab
only select routes from the given range of destinations.
Packit Service 3880ab
.I SELECTOR
Packit Service 3880ab
consists of an optional modifier
Packit Service 3880ab
.RB "(" root ", " match " or " exact ")"
Packit Service 3880ab
and a prefix.
Packit Service 3880ab
.BI root " PREFIX"
Packit Service 3880ab
selects routes with prefixes not shorter than
Packit Service 3880ab
.IR PREFIX "."
Packit Service 3880ab
F.e.
Packit Service 3880ab
.BI root " 0/0"
Packit Service 3880ab
selects the entire routing table.
Packit Service 3880ab
.BI match " PREFIX"
Packit Service 3880ab
selects routes with prefixes not longer than
Packit Service 3880ab
.IR PREFIX "."
Packit Service 3880ab
F.e.
Packit Service 3880ab
.BI match " 10.0/16"
Packit Service 3880ab
selects
Packit Service 3880ab
.IR 10.0/16 ","
Packit Service 3880ab
.IR 10/8 " and " 0/0 ,
Packit Service 3880ab
but it does not select
Packit Service 3880ab
.IR 10.1/16 " and " 10.0.0/24 .
Packit Service 3880ab
And
Packit Service 3880ab
.BI exact " PREFIX"
Packit Service 3880ab
(or just
Packit Service 3880ab
.IR PREFIX ")"
Packit Service 3880ab
selects routes with this exact prefix. If neither of these options
Packit Service 3880ab
are present,
Packit Service 3880ab
.B ip
Packit Service 3880ab
assumes
Packit Service 3880ab
.BI root " 0/0"
Packit Service 3880ab
i.e. it lists the entire table.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI tos " TOS"
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI dsfield " TOS"
Packit Service 3880ab
only select routes with the given TOS.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI table " TABLEID"
Packit Service 3880ab
show the routes from this table(s). The default setting is to show table
Packit Service 3880ab
.BR main "."
Packit Service 3880ab
.I TABLEID
Packit Service 3880ab
may either be the ID of a real table or one of the special values:
Packit Service 3880ab
.sp
Packit Service 3880ab
.in +8
Packit Service 3880ab
.B all
Packit Service 3880ab
- list all of the tables.
Packit Service 3880ab
.sp
Packit Service 3880ab
.B cache
Packit Service 3880ab
- dump the routing cache.
Packit Service 3880ab
.in -8
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI vrf " NAME"
Packit Service 3880ab
show the routes for the table associated with the vrf name
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B cloned
Packit Service 3880ab
.TP
Packit Service 3880ab
.B cached
Packit Service 3880ab
list cloned routes i.e. routes which were dynamically forked from
Packit Service 3880ab
other routes because some route attribute (f.e. MTU) was updated.
Packit Service 3880ab
Actually, it is equivalent to
Packit Service 3880ab
.BR "table cache" "."
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI from " SELECTOR"
Packit Service 3880ab
the same syntax as for
Packit Service 3880ab
.BR to ","
Packit Service 3880ab
but it binds the source address range rather than destinations.
Packit Service 3880ab
Note that the
Packit Service 3880ab
.B from
Packit Service 3880ab
option only works with cloned routes.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI protocol " RTPROTO"
Packit Service 3880ab
only list routes of this protocol.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI scope " SCOPE_VAL"
Packit Service 3880ab
only list routes with this scope.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI type " TYPE"
Packit Service 3880ab
only list routes of this type.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI dev " NAME"
Packit Service 3880ab
only list routes going via this device.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI via " [ FAMILY ] PREFIX"
Packit Service 3880ab
only list routes going via the nexthop routers selected by
Packit Service 3880ab
.IR PREFIX "."
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI src " PREFIX"
Packit Service 3880ab
only list routes with preferred source addresses selected
Packit Service 3880ab
by
Packit Service 3880ab
.IR PREFIX "."
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI realm " REALMID"
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI realms " FROMREALM/TOREALM"
Packit Service 3880ab
only list routes with these realms.
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
ip route flush
Packit Service 3880ab
flush routing tables
Packit Service 3880ab
.RS
Packit Service 3880ab
this command flushes routes selected by some criteria.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
The arguments have the same syntax and semantics as the arguments of
Packit Service 3880ab
.BR "ip route show" ,
Packit Service 3880ab
but routing tables are not listed but purged. The only difference is
Packit Service 3880ab
the default action:
Packit Service 3880ab
.B show
Packit Service 3880ab
dumps all the IP main routing table but
Packit Service 3880ab
.B flush
Packit Service 3880ab
prints the helper page.
Packit Service 3880ab
Packit Service 3880ab
.sp
Packit Service 3880ab
With the
Packit Service 3880ab
.B -statistics
Packit Service 3880ab
option, the command becomes verbose. It prints out the number of
Packit Service 3880ab
deleted routes and the number of rounds made to flush the routing
Packit Service 3880ab
table. If the option is given
Packit Service 3880ab
twice,
Packit Service 3880ab
.B ip route flush
Packit Service 3880ab
also dumps all the deleted routes in the format described in the
Packit Service 3880ab
previous subsection.
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
ip route get
Packit Service 3880ab
get a single route
Packit Service 3880ab
.RS
Packit Service 3880ab
this command gets a single route to a destination and prints its
Packit Service 3880ab
contents exactly as the kernel sees it.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI fibmatch
Packit Service 3880ab
Return full fib lookup matched route. Default is to return the resolved
Packit Service 3880ab
dst entry
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI to " ADDRESS " (default)
Packit Service 3880ab
the destination address.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI from " ADDRESS"
Packit Service 3880ab
the source address.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI tos " TOS"
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI dsfield " TOS"
Packit Service 3880ab
the Type Of Service.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI iif " NAME"
Packit Service 3880ab
the device from which this packet is expected to arrive.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI oif " NAME"
Packit Service 3880ab
force the output device on which this packet will be routed.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI mark " MARK"
Packit Service 3880ab
the firewall mark
Packit Service 3880ab
.RB ( "fwmark" )
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI vrf " NAME"
Packit Service 3880ab
force the vrf device on which this packet will be routed.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI ipproto " PROTOCOL"
Packit Service 3880ab
ip protocol as seen by the route lookup
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI sport " NUMBER"
Packit Service 3880ab
source port as seen by the route lookup
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BI dport " NUMBER"
Packit Service 3880ab
destination port as seen by the route lookup
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B connected
Packit Service 3880ab
if no source address
Packit Service 3880ab
.RB "(option " from ")"
Packit Service 3880ab
was given, relookup the route with the source set to the preferred
Packit Service 3880ab
address received from the first lookup.
Packit Service 3880ab
If policy routing is used, it may be a different route.
Packit Service 3880ab
Packit Service 3880ab
.P
Packit Service 3880ab
Note that this operation is not equivalent to
Packit Service 3880ab
.BR "ip route show" .
Packit Service 3880ab
.B show
Packit Service 3880ab
shows existing routes.
Packit Service 3880ab
.B get
Packit Service 3880ab
resolves them and creates new clones if necessary. Essentially,
Packit Service 3880ab
.B get
Packit Service 3880ab
is equivalent to sending a packet along this path.
Packit Service 3880ab
If the
Packit Service 3880ab
.B iif
Packit Service 3880ab
argument is not given, the kernel creates a route
Packit Service 3880ab
to output packets towards the requested destination.
Packit Service 3880ab
This is equivalent to pinging the destination
Packit Service 3880ab
with a subsequent
Packit Service 3880ab
.BR "ip route ls cache" ,
Packit Service 3880ab
however, no packets are actually sent. With the
Packit Service 3880ab
.B iif
Packit Service 3880ab
argument, the kernel pretends that a packet arrived from this interface
Packit Service 3880ab
and searches for a path to forward the packet.
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
ip route save
Packit Service 3880ab
save routing table information to stdout
Packit Service 3880ab
.RS
Packit Service 3880ab
This command behaves like
Packit Service 3880ab
.BR "ip route show"
Packit Service 3880ab
except that the output is raw data suitable for passing to
Packit Service 3880ab
.BR "ip route restore" .
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
ip route restore
Packit Service 3880ab
restore routing table information from stdin
Packit Service 3880ab
.RS
Packit Service 3880ab
This command expects to read a data stream as returned from
Packit Service 3880ab
.BR "ip route save" .
Packit Service 3880ab
It will attempt to restore the routing table information exactly as
Packit Service 3880ab
it was at the time of the save, so any translation of information
Packit Service 3880ab
in the stream (such as device indexes) must be done first. Any existing
Packit Service 3880ab
routes are left unchanged. Any routes specified in the data stream that
Packit Service 3880ab
already exist in the table will be ignored.
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.SH NOTES
Packit Service 3880ab
Starting with Linux kernel version 3.6, there is no routing cache for IPv4
Packit Service 3880ab
anymore. Hence
Packit Service 3880ab
.B "ip route show cached"
Packit Service 3880ab
will never print any entries on systems with this or newer kernel versions.
Packit Service 3880ab
Packit Service 3880ab
.SH EXAMPLES
Packit Service 3880ab
.PP
Packit Service 3880ab
ip ro
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Show all route entries in the kernel.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip route add default via 192.168.1.1 dev eth0
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Adds a default route (for all addresses) via the local gateway 192.168.1.1 that can
Packit Service 3880ab
be reached on device eth0.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip route add 10.1.1.0/30 encap mpls 200/300 via 10.1.1.1 dev eth0
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Adds an ipv4 route with mpls encapsulation attributes attached to it.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip -6 route add 2001:db8:1::/64 encap seg6 mode encap segs 2001:db8:42::1,2001:db8:ffff::2 dev eth0
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Adds an IPv6 route with SRv6 encapsulation and two segments attached.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip route add 10.1.1.0/30 nhid 10
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Adds an ipv4 route using nexthop object with id 10.
Packit Service 3880ab
.RE
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.br
Packit Service 3880ab
.BR ip (8)
Packit Service 3880ab
Packit Service 3880ab
.SH AUTHOR
Packit Service 3880ab
Original Manpage by Michail Litvak <mci@owl.openwall.com>