.TH IP 8 "20 Dec 2011" "iproute2" "Linux"
.SH NAME
-ip \- show / manipulate routing, devices, policy routing and tunnels
+ip \- show / manipulate routing, network devices, interfaces and tunnels
.SH SYNOPSIS
.ad l
\fB\-r\fR[\fIesolve\fR] |
\fB\-iec\fR |
\fB\-f\fR[\fIamily\fR] {
-.BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | "
+.BR inet " | " inet6 " | " link " } | "
\fB-4\fR |
\fB-6\fR |
\fB-I\fR |
\fB\-t\fR[\fIimestamp\fR] |
\fB\-ts\fR[\fIhort\fR] |
\fB\-n\fR[\fIetns\fR] name |
+\fB\-N\fR[\fIumeric\fR] |
\fB\-a\fR[\fIll\fR] |
-\fB\-c\fR[\fIolor\fR] }
-
+\fB\-c\fR[\fIolor\fR] |
+\fB\-br\fR[\fIief\fR] |
+\fB\-j\fR[son\fR] |
+\fB\-p\fR[retty\fR] }
.SH OPTIONS
.TP
.BR "\-force"
-Don't terminate ip on errors in batch mode.
-If there were any errors during execution of the commands, the application return code will be non zero.
+Don't terminate ip on errors in batch mode. If there were any errors
+during execution of the commands, the application return code will be
+non zero.
.TP
.BR "\-s" , " \-stats" , " \-statistics"
.TP
.BR "\-f" , " \-family " <FAMILY>
-Specifies the protocol family to use. The protocol family identifier can be one of
-.BR "inet" , " inet6" , " bridge" , " ipx" , " dnet" , " mpls"
+Specifies the protocol family to use. The protocol family identifier
+can be one of
+.BR "inet" , " inet6" , " bridge" , " mpls"
or
.BR link .
If this option is not present,
shortcut for
.BR "\-family bridge" .
-.TP
-.B \-D
-shortcut for
-.BR "\-family decnet" .
-
-.TP
-.B \-I
-shortcut for
-.BR "\-family ipx" .
-
.TP
.B \-M
shortcut for
.BR help " }"
.TP
-.BR "\-a" , " \-all"
-executes specified command over all objects, it depends if command supports this option.
+.BR "\-N" , " \-Numeric"
+Print the number of protocol, scope, dsfield, etc directly instead of
+converting it to human readable name.
.TP
-.BR "\-c" , " -color"
-Use color output.
+.BR "\-a" , " \-all"
+executes specified command over all objects, it depends if command
+supports this option.
+
+.TP
+.BR \-c [ color ][ = { always | auto | never }
+Configure color output. If parameter is omitted or
+.BR always ,
+color output is enabled regardless of stdout state. If parameter is
+.BR auto ,
+stdout is checked to be a terminal before enabling color output. If
+parameter is
+.BR never ,
+color output is disabled. If specified multiple times, the last one takes
+precedence. This flag is ignored if
+.B \-json
+is also given.
+
+Used color palette can be influenced by
+.BR COLORFGBG
+environment variable
+(see
+.BR ENVIRONMENT ).
.TP
.BR "\-t" , " \-timestamp"
.BR "\-iec"
print human readable rates in IEC units (e.g. 1Ki = 1024).
+.TP
+.BR "\-br" , " \-brief"
+Print only basic information in a tabular format for better
+readability. This option is currently only supported by
+.BR "ip addr show " and " ip link show " commands.
+
+.TP
+.BR "\-j", " \-json"
+Output results in JavaScript Object Notation (JSON).
+
+.TP
+.BR "\-p", " \-pretty"
+The default JSON format is compact and more efficient to parse but
+hard for most users to read. This flag adds indentation for
+readability.
+
.SH IP - COMMAND SYNTAX
.SS
or, if the objects of this class cannot be listed,
.BR "help" .
+.SH ENVIRONMENT
+.TP
+.B COLORFGBG
+If set, it's value is used for detection whether background is dark or
+light and use contrast colors for it.
+
+COLORFGBG environment variable usually contains either two or three
+values separated by semicolons; we want the last value in either case.
+If this value is 0-6 or 8, chose colors suitable for dark background:
+
+COLORFGBG=";0" ip -c a
+
.SH EXIT STATUS
Exit status is 0 if command was successful, and 1 if there is a syntax error.
If an error was reported by the kernel exit status is 2.
+.SH "EXAMPLES"
+.PP
+ip addr
+.RS 4
+Shows addresses assigned to all network interfaces.
+.RE
+.PP
+ip neigh
+.RS 4
+Shows the current neighbour table in kernel.
+.RE
+.PP
+ip link set x up
+.RS 4
+Bring up interface x.
+.RE
+.PP
+ip link set x down
+.RE
+.RS 4
+Bring down interface x.
+.RE
+.PP
+ip route
+.RS 4
+Show table routes.
+.RE
+
.SH HISTORY
.B ip
was written by Alexey N. Kuznetsov and added in Linux 2.2.