Blame man/man8/ip.8

Packit Service 3880ab
.TH IP 8 "20 Dec 2011" "iproute2" "Linux"
Packit Service 3880ab
.SH NAME
Packit Service 3880ab
ip \- show / manipulate routing, network devices, interfaces and tunnels
Packit Service 3880ab
.SH SYNOPSIS
Packit Service 3880ab
Packit Service 3880ab
.ad l
Packit Service 3880ab
.in +8
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.B ip
Packit Service 3880ab
.RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
Packit Service 3880ab
.BR help " }"
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.B ip
Packit Service 3880ab
.RB "[ " -force " ] "
Packit Service 3880ab
.BI "-batch " filename
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR OBJECT " := { "
Packit Service 3880ab
.BR link " | " address " | " addrlabel " | " route " | " rule " | " neigh " | "\
Packit Service 3880ab
 ntable " | " tunnel " | " tuntap " | " maddress " | "  mroute " | " mrule " | "\
Packit Service 3880ab
 monitor " | " xfrm " | " netns " | "  l2tp " | "  tcp_metrics " | " token " | "\
Packit Service 3880ab
 macsec " | " vrf " | " mptcp " }"
Packit Service 3880ab
.sp
Packit Service 3880ab
Packit Service 3880ab
.ti -8
Packit Service 3880ab
.IR OPTIONS " := { "
Packit Service 3880ab
\fB\-V\fR[\fIersion\fR] |
Packit Service 3880ab
\fB\-h\fR[\fIuman-readable\fR] |
Packit Service 3880ab
\fB\-s\fR[\fItatistics\fR] |
Packit Service 3880ab
\fB\-d\fR[\fIetails\fR] |
Packit Service 3880ab
\fB\-r\fR[\fIesolve\fR] |
Packit Service 3880ab
\fB\-iec\fR |
Packit Service 3880ab
\fB\-f\fR[\fIamily\fR] {
Packit Service 3880ab
.BR inet " | " inet6 " | " link " } | "
Packit Service 3880ab
\fB-4\fR |
Packit Service 3880ab
\fB-6\fR |
Packit Service 3880ab
\fB-I\fR |
Packit Service 3880ab
\fB-D\fR |
Packit Service 3880ab
\fB-B\fR |
Packit Service 3880ab
\fB-0\fR |
Packit Service 3880ab
\fB-l\fR[\fIoops\fR] { \fBmaximum-addr-flush-attempts\fR } |
Packit Service 3880ab
\fB\-o\fR[\fIneline\fR] |
Packit Service 3880ab
\fB\-rc\fR[\fIvbuf\fR] [\fBsize\fR] |
Packit Service 3880ab
\fB\-t\fR[\fIimestamp\fR] |
Packit Service 3880ab
\fB\-ts\fR[\fIhort\fR] |
Packit Service 3880ab
\fB\-n\fR[\fIetns\fR] name |
Packit Service 3880ab
\fB\-N\fR[\fIumeric\fR] |
Packit Service 3880ab
\fB\-a\fR[\fIll\fR] |
Packit Service 3880ab
\fB\-c\fR[\fIolor\fR] |
Packit Service 3880ab
\fB\-br\fR[\fIief\fR] |
Packit Service 3880ab
\fB\-j\fR[son\fR] |
Packit Service 3880ab
\fB\-p\fR[retty\fR] }
Packit Service 3880ab
Packit Service 3880ab
.SH OPTIONS
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-V" , " -Version"
Packit Service 3880ab
Print the version of the
Packit Service 3880ab
.B ip
Packit Service 3880ab
utility and exit.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-h", " \-human", " \-human-readable"
Packit Service 3880ab
output statistics with human readable values followed by suffix.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-b", " \-batch " <FILENAME>
Packit Service 3880ab
Read commands from provided file or standard input and invoke them.
Packit Service 3880ab
First failure will cause termination of ip.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-force"
Packit Service 3880ab
Don't terminate ip on errors in batch mode.  If there were any errors
Packit Service 3880ab
during execution of the commands, the application return code will be
Packit Service 3880ab
non zero.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-s" , " \-stats" , " \-statistics"
Packit Service 3880ab
Output more information. If the option
Packit Service 3880ab
appears twice or more, the amount of information increases.
Packit Service 3880ab
As a rule, the information is statistics or some time values.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-d" , " \-details"
Packit Service 3880ab
Output more detailed information.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-l" , " \-loops " <COUNT>
Packit Service 3880ab
Specify maximum number of loops the 'ip address flush' logic
Packit Service 3880ab
will attempt before giving up. The default is 10.
Packit Service 3880ab
Zero (0) means loop until all addresses are removed.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-f" , " \-family " <FAMILY>
Packit Service 3880ab
Specifies the protocol family to use. The protocol family identifier
Packit Service 3880ab
can be one of
Packit Service 3880ab
.BR "inet" , " inet6" , " bridge" ,  " mpls"
Packit Service 3880ab
or
Packit Service 3880ab
.BR link .
Packit Service 3880ab
If this option is not present,
Packit Service 3880ab
the protocol family is guessed from other arguments. If the rest
Packit Service 3880ab
of the command line does not give enough information to guess the
Packit Service 3880ab
family,
Packit Service 3880ab
.B ip
Packit Service 3880ab
falls back to the default one, usually
Packit Service 3880ab
.B inet
Packit Service 3880ab
or
Packit Service 3880ab
.BR "any" .
Packit Service 3880ab
.B link
Packit Service 3880ab
is a special family identifier meaning that no networking protocol
Packit Service 3880ab
is involved.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B \-4
Packit Service 3880ab
shortcut for
Packit Service 3880ab
.BR "-family inet" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B \-6
Packit Service 3880ab
shortcut for
Packit Service 3880ab
.BR "\-family inet6" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B \-B
Packit Service 3880ab
shortcut for
Packit Service 3880ab
.BR "\-family bridge" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B \-M
Packit Service 3880ab
shortcut for
Packit Service 3880ab
.BR "\-family mpls" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B \-0
Packit Service 3880ab
shortcut for
Packit Service 3880ab
.BR "\-family link" .
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-o" , " \-oneline"
Packit Service 3880ab
output each record on a single line, replacing line feeds
Packit Service 3880ab
with the
Packit Service 3880ab
.B '\e'
Packit Service 3880ab
character. This is convenient when you want to count records
Packit Service 3880ab
with
Packit Service 3880ab
.BR wc (1)
Packit Service 3880ab
or to
Packit Service 3880ab
.BR grep (1)
Packit Service 3880ab
the output.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-r" , " \-resolve"
Packit Service 3880ab
use the system's name resolver to print DNS names instead of
Packit Service 3880ab
host addresses.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-n" , " \-netns " <NETNS>
Packit Service 3880ab
switches
Packit Service 3880ab
.B ip
Packit Service 3880ab
to the specified network namespace
Packit Service 3880ab
.IR NETNS .
Packit Service 3880ab
Actually it just simplifies executing of:
Packit Service 3880ab
Packit Service 3880ab
.B ip netns exec
Packit Service 3880ab
.IR NETNS
Packit Service 3880ab
.B ip
Packit Service 3880ab
.RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
Packit Service 3880ab
.BR help " }"
Packit Service 3880ab
Packit Service 3880ab
to
Packit Service 3880ab
Packit Service 3880ab
.B ip
Packit Service 3880ab
.RI "-n[etns] " NETNS " [ " OPTIONS " ] " OBJECT " { " COMMAND " | "
Packit Service 3880ab
.BR help " }"
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-N" , " \-Numeric"
Packit Service 3880ab
Print the number of protocol, scope, dsfield, etc directly instead of
Packit Service 3880ab
converting it to human readable name.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-a" , " \-all"
Packit Service 3880ab
executes specified command over all objects, it depends if command
Packit Service 3880ab
supports this option.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR \-c [ color ][ = { always | auto | never }
Packit Service 3880ab
Configure color output. If parameter is omitted or
Packit Service 3880ab
.BR always ,
Packit Service 3880ab
color output is enabled regardless of stdout state. If parameter is
Packit Service 3880ab
.BR auto ,
Packit Service 3880ab
stdout is checked to be a terminal before enabling color output. If
Packit Service 3880ab
parameter is
Packit Service 3880ab
.BR never ,
Packit Service 3880ab
color output is disabled. If specified multiple times, the last one takes
Packit Service 3880ab
precedence. This flag is ignored if
Packit Service 3880ab
.B \-json
Packit Service 3880ab
is also given.
Packit Service 3880ab
Packit Service 3880ab
Used color palette can be influenced by
Packit Service 3880ab
.BR COLORFGBG
Packit Service 3880ab
environment variable
Packit Service 3880ab
(see
Packit Service 3880ab
.BR ENVIRONMENT ).
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-t" , " \-timestamp"
Packit Service 3880ab
display current time when using monitor option.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-ts" , " \-tshort"
Packit Service 3880ab
Like
Packit Service 3880ab
.BR \-timestamp ,
Packit Service 3880ab
but use shorter format.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-rc" , " \-rcvbuf" <SIZE>
Packit Service 3880ab
Set the netlink socket receive buffer size, defaults to 1MB.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-iec"
Packit Service 3880ab
print human readable rates in IEC units (e.g. 1Ki = 1024).
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-br" , " \-brief"
Packit Service 3880ab
Print only basic information in a tabular format for better
Packit Service 3880ab
readability. This option is currently only supported by
Packit Service 3880ab
.BR "ip addr show " and " ip link show " commands.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-j", " \-json"
Packit Service 3880ab
Output results in JavaScript Object Notation (JSON).
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.BR "\-p", " \-pretty"
Packit Service 3880ab
The default JSON format is compact and more efficient to parse but
Packit Service 3880ab
hard for most users to read.  This flag adds indentation for
Packit Service 3880ab
readability.
Packit Service 3880ab
Packit Service 3880ab
.SH IP - COMMAND SYNTAX
Packit Service 3880ab
Packit Service 3880ab
.SS
Packit Service 3880ab
.I OBJECT
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B address
Packit Service 3880ab
- protocol (IP or IPv6) address on a device.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B addrlabel
Packit Service 3880ab
- label configuration for protocol address selection.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B l2tp
Packit Service 3880ab
- tunnel ethernet over IP (L2TPv3).
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B link
Packit Service 3880ab
- network device.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B maddress
Packit Service 3880ab
- multicast address.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B monitor
Packit Service 3880ab
- watch for netlink messages.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B mptcp
Packit Service 3880ab
- manage MPTCP path manager.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B mroute
Packit Service 3880ab
- multicast routing cache entry.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B mrule
Packit Service 3880ab
- rule in multicast routing policy database.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B neighbour
Packit Service 3880ab
- manage ARP or NDISC cache entries.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B netns
Packit Service 3880ab
- manage network namespaces.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B ntable
Packit Service 3880ab
- manage the neighbor cache's operation.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B route
Packit Service 3880ab
- routing table entry.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B rule
Packit Service 3880ab
- rule in routing policy database.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B tcp_metrics/tcpmetrics
Packit Service 3880ab
- manage TCP Metrics
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B token
Packit Service 3880ab
- manage tokenized interface identifiers.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B tunnel
Packit Service 3880ab
- tunnel over IP.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B tuntap
Packit Service 3880ab
- manage TUN/TAP devices.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B vrf
Packit Service 3880ab
- manage virtual routing and forwarding devices.
Packit Service 3880ab
Packit Service 3880ab
.TP
Packit Service 3880ab
.B xfrm
Packit Service 3880ab
- manage IPSec policies.
Packit Service 3880ab
Packit Service 3880ab
.PP
Packit Service 3880ab
The names of all objects may be written in full or
Packit Service 3880ab
abbreviated form, for example
Packit Service 3880ab
.B address
Packit Service 3880ab
can be abbreviated as
Packit Service 3880ab
.B addr
Packit Service 3880ab
or just
Packit Service 3880ab
.B a.
Packit Service 3880ab
Packit Service 3880ab
.SS
Packit Service 3880ab
.I COMMAND
Packit Service 3880ab
Packit Service 3880ab
Specifies the action to perform on the object.
Packit Service 3880ab
The set of possible actions depends on the object type.
Packit Service 3880ab
As a rule, it is possible to
Packit Service 3880ab
.BR "add" , " delete"
Packit Service 3880ab
and
Packit Service 3880ab
.B show
Packit Service 3880ab
(or
Packit Service 3880ab
.B list
Packit Service 3880ab
) objects, but some objects do not allow all of these operations
Packit Service 3880ab
or have some additional commands. The
Packit Service 3880ab
.B help
Packit Service 3880ab
command is available for all objects. It prints
Packit Service 3880ab
out a list of available commands and argument syntax conventions.
Packit Service 3880ab
.sp
Packit Service 3880ab
If no command is given, some default command is assumed.
Packit Service 3880ab
Usually it is
Packit Service 3880ab
.B list
Packit Service 3880ab
or, if the objects of this class cannot be listed,
Packit Service 3880ab
.BR "help" .
Packit Service 3880ab
Packit Service 3880ab
.SH ENVIRONMENT
Packit Service 3880ab
.TP
Packit Service 3880ab
.B COLORFGBG
Packit Service 3880ab
If set, it's value is used for detection whether background is dark or
Packit Service 3880ab
light and use contrast colors for it.
Packit Service 3880ab
Packit Service 3880ab
COLORFGBG environment variable usually contains either two or three
Packit Service 3880ab
values separated by semicolons; we want the last value in either case.
Packit Service 3880ab
If this value is 0-6 or 8, chose colors suitable for dark background:
Packit Service 3880ab
Packit Service 3880ab
COLORFGBG=";0" ip -c a
Packit Service 3880ab
Packit Service 3880ab
.SH EXIT STATUS
Packit Service 3880ab
Exit status is 0 if command was successful, and 1 if there is a syntax error.
Packit Service 3880ab
If an error was reported by the kernel exit status is 2.
Packit Service 3880ab
Packit Service 3880ab
.SH "EXAMPLES"
Packit Service 3880ab
.PP
Packit Service 3880ab
ip addr
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Shows addresses assigned to all network interfaces.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip neigh
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Shows the current neighbour table in kernel.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip link set x up
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Bring up interface x.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip link set x down
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Bring down interface x.
Packit Service 3880ab
.RE
Packit Service 3880ab
.PP
Packit Service 3880ab
ip route
Packit Service 3880ab
.RS 4
Packit Service 3880ab
Show table routes.
Packit Service 3880ab
.RE
Packit Service 3880ab
Packit Service 3880ab
.SH HISTORY
Packit Service 3880ab
.B ip
Packit Service 3880ab
was written by Alexey N. Kuznetsov and added in Linux 2.2.
Packit Service 3880ab
.SH SEE ALSO
Packit Service 3880ab
.BR ip-address (8),
Packit Service 3880ab
.BR ip-addrlabel (8),
Packit Service 3880ab
.BR ip-l2tp (8),
Packit Service 3880ab
.BR ip-link (8),
Packit Service 3880ab
.BR ip-maddress (8),
Packit Service 3880ab
.BR ip-monitor (8),
Packit Service 3880ab
.BR ip-mptcp (8),
Packit Service 3880ab
.BR ip-mroute (8),
Packit Service 3880ab
.BR ip-neighbour (8),
Packit Service 3880ab
.BR ip-netns (8),
Packit Service 3880ab
.BR ip-ntable (8),
Packit Service 3880ab
.BR ip-route (8),
Packit Service 3880ab
.BR ip-rule (8),
Packit Service 3880ab
.BR ip-tcp_metrics (8),
Packit Service 3880ab
.BR ip-token (8),
Packit Service 3880ab
.BR ip-tunnel (8),
Packit Service 3880ab
.BR ip-vrf (8),
Packit Service 3880ab
.BR ip-xfrm (8)
Packit Service 3880ab
.br
Packit Service 3880ab
.RB "IP Command reference " ip-cref.ps
Packit Service 3880ab
.SH REPORTING BUGS
Packit Service 3880ab
Report any bugs to the Network Developers mailing list
Packit Service 3880ab
.B <netdev@vger.kernel.org>
Packit Service 3880ab
where the development and maintenance is primarily done.
Packit Service 3880ab
You do not have to be subscribed to the list to send a message there.
Packit Service 3880ab
Packit Service 3880ab
.SH AUTHOR
Packit Service 3880ab
Original Manpage by Michail Litvak <mci@owl.openwall.com>