IP(8) Linux IP(8)

# [NAME](#NAME)

ip - show / manipulate routing, network devices, interfaces and tunnels

# [SYNOPSIS](#SYNOPSIS)

**ip** \[ *OPTIONS* ] *OBJECT* { *COMMAND* | **help** }

**ip** \[ **-force** ] **-batch filename**

*OBJECT* := { **address** | **addrlabel** | **fou** | **help** | **ila** | **ioam** | **l2tp** | **link** | **macsec** | **maddress** | **monitor** | **mptcp** | **mroute** | **mrule** | **neighbor** | **neighbour** | **netconf** | **netns** | **nexthop** | **ntable** | **ntbl** | **route** | **rule** | **sr** | **tap** | **tcpmetrics** | **token** | **tunnel** | **tuntap** | **vrf** | **xfrm** }

*OPTIONS* := { **-V**\[*ersion*] | **-h**\[*uman-readable*] | **-s**\[*tatistics*] | **-d**\[*etails*] | **-r**\[*esolve*] | **-iec** | **-f**\[*amily*] { **inet** | **inet6** | **link** } | **-4** | **-6** | **-B** | **-0** | **-l**\[*oops*] { **maximum-addr-flush-attempts** } | **-o**\[*neline*] | **-rc**\[*vbuf*] \[**size**] | **-t**\[*imestamp*] | **-ts**\[*hort*] | **-n**\[*etns*] name | **-N**\[*umeric*] | **-a**\[*ll*] | **-c**\[*olor*] | **-br**\[*ief*] | **-j**\[son] | **-p**\[retty] }

# [OPTIONS](#OPTIONS)

[**-V**, **-Version**](#V)

Print the version of the **ip** utility and exit.

[**-h**, **-human**, **-human-readable**](#h)

output statistics with human readable values followed by suffix.

[**-b**, **-batch** &lt;FILENAME&gt;](#b)

Read commands from provided file or standard input and invoke them. First failure will cause termination of ip.

[**-force**](#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.

[**-s**, **-stats**, **-statistics**](#s)

Output more information. If the option appears twice or more, the amount of information increases. As a rule, the information is statistics or some time values.

[**-d**, **-details**](#d)

Output more detailed information.

[**-l**, **-loops** &lt;COUNT&gt;](#l)

Specify maximum number of loops the 'ip address flush' logic will attempt before giving up. The default is 10. Zero (0) means loop until all addresses are removed.

[**-f**, **-family** &lt;FAMILY&gt;](#f)

Specifies the protocol family to use. The protocol family identifier can be one of **inet**, **inet6**, **bridge**, **mpls** or **link**. If this option is not present, the protocol family is guessed from other arguments. If the rest of the command line does not give enough information to guess the family, **ip** falls back to the default one, usually **inet** or **any**. **link** is a special family identifier meaning that no networking protocol is involved.

**-4**

shortcut for **-family inet**.

**-6**

shortcut for **-family inet6**.

[**-B**](#B)

shortcut for **-family bridge**.

[**-M**](#M)

shortcut for **-family mpls**.

**-0**

shortcut for **-family link**.

[**-o**, **-oneline**](#o)

output each record on a single line, replacing line feeds with the **'\\'** character. This is convenient when you want to count records with [**wc**(1)](/man/os/iproute2/wc.1) or to [**grep**(1)](/man/os/iproute2/grep.1) the output.

[**-r**, **-resolve**](#r)

use the system's name resolver to print DNS names instead of host addresses.

[**-n**, **-netns** &lt;NETNS&gt;](#n)

switches **ip** to the specified network namespace *NETNS*. Actually it just simplifies executing of:

**ip netns exec** *NETNS* **ip** \[ *OPTIONS* ] *OBJECT* { *COMMAND* | **help** }

to

**ip** -n\[etns] *NETNS* \[ *OPTIONS* ] *OBJECT* { *COMMAND* | **help** }

[**-N**, **-Numeric**](#N)

Print the number of protocol, scope, dsfield, etc directly instead of converting it to human readable name.

[**-a**, **-all**](#a)

executes specified command over all objects, it depends if command supports this option.

[**-c**\[**color**\]\[**=**{**always**|**auto**|**never**}](#c)

Configure color output. If parameter is omitted or **always**, color output is enabled regardless of stdout state. If parameter is **auto**, stdout is checked to be a terminal before enabling color output. If parameter is **never**, color output is disabled. If specified multiple times, the last one takes precedence. This flag is ignored if **-json** is also given.

Used color palette can be influenced by **COLORFGBG** environment variable (see **ENVIRONMENT**).

[**-t**, **-timestamp**](#t)

display current time when using monitor option.

[**-ts**, **-tshort**](#ts)

Like **-timestamp**, but use shorter format.

[**-rc**, **-rcvbuf**&lt;SIZE&gt;](#rc)

Set the netlink socket receive buffer size, defaults to 1MB.

[**-iec**](#iec)

print human readable rates in IEC units (e.g. 1Ki = 1024).

[**-br**, **-brief**](#br)

Print only basic information in a tabular format for better readability. This option is currently only supported by **ip addr show** , **ip link show** & **ip neigh show** commands.

[**-j**, **-json**](#j)

Output results in JavaScript Object Notation (JSON).

[**-p**, **-pretty**](#p)

The default JSON format is compact and more efficient to parse but hard for most users to read. This flag adds indentation for readability.

[**-echo**](#echo)

Request the kernel to send the applied configuration back.

# [IP - COMMAND SYNTAX](#IP_-_COMMAND_SYNTAX)

## [*OBJECT*](#OBJECT)

[**address**](#address)

\- protocol (IP or IPv6) address on a device.

[**addrlabel**](#addrlabel)

\- label configuration for protocol address selection.

[**fou**](#fou)

\- Foo-over-UDP receive port configuration.

[**ila**](#ila)

\- manage identifier locator addresses (ILA).

[**ioam**](#ioam)

\- manage IOAM namespaces and IOAM schemas.

[**l2tp**](#l2tp)

\- tunnel ethernet over IP (L2TPv3).

[**link**](#link)

\- network device.

[**macsec**](#macsec)

\- MACsec device configuration.

[**maddress**](#maddress)

\- multicast address.

[**monitor**](#monitor)

\- watch for netlink messages.

[**mptcp**](#mptcp)

\- manage MPTCP path manager.

[**mroute**](#mroute)

\- multicast routing cache entry.

[**mrule**](#mrule)

\- rule in multicast routing policy database.

[**neighbour**](#neighbour)

\- manage ARP or NDISC cache entries.

[**netconf**](#netconf)

\- network configuration monitoring.

[**netns**](#netns)

\- manage network namespaces.

[**nexthop**](#nexthop)

\- manage nexthop objects.

[**ntable**](#ntable)

\- manage the neighbor cache's operation.

[**route**](#route)

\- routing table entry.

[**rule**](#rule)

\- rule in routing policy database.

[**sr**](#sr)

\- manage IPv6 segment routing.

[**stats**](#stats)

\- manage and show interface statistics.

[**tcp\_metrics/tcpmetrics**](#tcp_metrics/tcpmetrics)

\- manage TCP Metrics.

[**token**](#token)

\- manage tokenized interface identifiers.

[**tunnel**](#tunnel)

\- tunnel over IP.

[**tuntap**](#tuntap)

\- manage TUN/TAP devices.

[**vrf**](#vrf)

\- manage virtual routing and forwarding devices.

[**xfrm**](#xfrm)

\- manage IPSec policies.

The names of all objects may be written in full or abbreviated form, for example **address** can be abbreviated as **addr** or just **a.**

## [*COMMAND*](#COMMAND)

Specifies the action to perform on the object. The set of possible actions depends on the object type. As a rule, it is possible to **add**, **delete** and **show** (or **list** ) objects, but some objects do not allow all of these operations or have some additional commands. The **help** command is available for all objects. It prints out a list of available commands and argument syntax conventions.

If no command is given, some default command is assumed. Usually it is **list** or, if the objects of this class cannot be listed, **help**.

# [ENVIRONMENT](#ENVIRONMENT)

[**COLORFGBG**](#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

# [EXIT STATUS](#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.

# [EXAMPLES](#EXAMPLES)

ip addr

Shows addresses assigned to all network interfaces.

ip neigh

Shows the current neighbour table in kernel.

ip link set x up

Bring up interface x.

ip link set x down

Bring down interface x.

ip route

Show table routes.

# [HISTORY](#HISTORY)

**ip** was written by Alexey N. Kuznetsov and added in Linux 2.2.

# [SEE ALSO](#SEE_ALSO)

[**ip-address**(8)](/man/os/iproute2/ip-address.8), [**ip-addrlabel**(8)](/man/os/iproute2/ip-addrlabel.8), [**ip-fou**(8)](/man/os/iproute2/ip-fou.8), [**ip-ioam**(8)](/man/os/iproute2/ip-ioam.8), [**ip-l2tp**(8)](/man/os/iproute2/ip-l2tp.8), [**ip-link**(8)](/man/os/iproute2/ip-link.8), [**ip-macsec**(8)](/man/os/iproute2/ip-macsec.8), [**ip-maddress**(8)](/man/os/iproute2/ip-maddress.8), [**ip-monitor**(8)](/man/os/iproute2/ip-monitor.8), [**ip-mptcp**(8)](/man/os/iproute2/ip-mptcp.8), [**ip-mroute**(8)](/man/os/iproute2/ip-mroute.8), [**ip-neighbour**(8)](/man/os/iproute2/ip-neighbour.8), [**ip-netconf**(8)](/man/os/iproute2/ip-netconf.8), [**ip-netns**(8)](/man/os/iproute2/ip-netns.8), [**ip-nexthop**(8)](/man/os/iproute2/ip-nexthop.8), [**ip-ntable**(8)](/man/os/iproute2/ip-ntable.8), [**ip-route**(8)](/man/os/iproute2/ip-route.8), [**ip-rule**(8)](/man/os/iproute2/ip-rule.8), [**ip-sr**(8)](/man/os/iproute2/ip-sr.8), [**ip-stats**(8)](/man/os/iproute2/ip-stats.8), [**ip-tcp\_metrics**(8)](/man/os/iproute2/ip-tcp_metrics.8), [**ip-token**(8)](/man/os/iproute2/ip-token.8), [**ip-tunnel**(8)](/man/os/iproute2/ip-tunnel.8), [**ip-vrf**(8)](/man/os/iproute2/ip-vrf.8), [**ip-xfrm**(8)](/man/os/iproute2/ip-xfrm.8)  
IP Command reference **ip-cref.ps**

# [REPORTING BUGS](#REPORTING_BUGS)

Report any bugs to the Network Developers mailing list **&lt;netdev@vger.kernel.org&gt;** where the development and maintenance is primarily done. You do not have to be subscribed to the list to send a message there.

# [AUTHOR](#AUTHOR)

Original Manpage by Michail Litvak &lt;mci@owl.openwall.com&gt;

20 Dec 2011 iproute2

---

Document: ip(8) from iproute2 7.2.0-r1 (Chainguard OS)
Source: https://kernel.googlesource.com/pub/scm/network/iproute2/iproute2
