IP(8)
โจ NAME โจ
Okay so the manual name here is ip, and it's the Swiss Army knife for networking ๐ชโจ. It lets you show and manipulate routing, network devices, interfaces and tunnels. Literally everything networky, bestie ๐
๐ธ SYNOPSIS ๐ธ
Here's how you call it ๐ซถ
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 ๐
Okay, these are the flags you can slap on the end of your command ๐
-V,-Versionโ Prints the version of the ip utility and then exits. Bye bye ๐-h,-human,-human-readableโ Shows statistics with human readable values, followed by a suffix. So much easier to read ๐ฅน-b,-batch <FILENAME>โ Reads commands from the file you give it (or standard input) and runs them. Heads up: the first failure kills ip dead ๐-forceโ Don't terminate ip on errors in batch mode ๐ But if any errors happened while running the commands, the return code of the application will be non zero, so you'll still know something went wrong.-s,-stats,-statisticsโ Outputs more info. Repeat it twice or more and the info keeps growing ๐ As a rule, the extra stuff is statistics or some time values.-d,-detailsโ Outputs more detailed info ๐-l,-loops <COUNT>โ Sets the max number of loops theip address flushlogic will try before giving up. The default is 10. Zero (0) means keep looping until every address is gone ๐งน-f,-family <FAMILY>โ Picks the protocol family to use. It can be inet, inet6, bridge, mpls or link. If you skip this, the family gets guessed from your other arguments. If there still isn't enough info to guess, ip falls back to the default one, which is usually inet or any. Oh, and link is a special one that means no networking protocol is involved at all ๐ฆ-4โ shortcut for-family inet-6โ shortcut for-family inet6-Bโ shortcut for-family bridge-Mโ shortcut for-family mpls-0โ shortcut for-family link-o,-onelineโ Outputs each record on a single line, swapping line feeds for the\character. This is so convenient when you want to count records withwc(1)or search them withgrep(1)๐ง-r,-resolveโ Uses the system's name resolver to print DNS names instead of host addresses ๐-n,-netns <NETNS>โ Switches ip to the network namespace you name, NETNS. This is basically a shortcut for the long way of running it. So instead of typing this:
ip netns exec NETNS ip [ OPTIONS ] OBJECT { COMMAND | help }
you can just type this:
ip -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }
-N,-Numericโ Prints the number of the protocol, scope, dsfield, etc. directly, instead of turning it into a human readable name ๐ข-a,-allโ Runs the specified command over all objects. Whether it works depends on if the command supports this option ๐คทโโ๏ธ-c[color][={always|auto|never}โ Configures color output ๐ If you leave the parameter out, or pick always, color output is on no matter what stdout is doing. If you pick auto, stdout gets checked to see if it's a terminal before color turns on. If you pick never, color is off. If you use this flag more than once, the last one wins. This flag gets ignored if-jsonis also given.
The color palette can be influenced by the COLORFGBG environment variable (see ENVIRONMENT).
-t,-timestampโ Displays the current time when you use the monitor option โฐ-ts,-tshortโ Same as-timestamp, but with a shorter format โฑ๏ธ-rc,-rcvbuf<SIZE>โ Sets the netlink socket receive buffer size. It defaults to 1MB ๐ฆ-iecโ Prints human readable rates in IEC units (e.g. 1Ki = 1024) ๐งฎ-br,-briefโ Prints only the basic info in a tabular format, which is way easier to read. Right now this only works withip addr show,ip link show&ip neigh show๐-j,-jsonโ Outputs results in JavaScript Object Notation (JSON) ๐-p,-prettyโ The default JSON format is compact and super efficient to parse, but honestly kinda hard for most humans to read. This flag adds indentation so it's readable ๐-echoโ Asks the kernel to send the applied configuration back to you ๐ช
โจ IP - COMMAND SYNTAX โจ
๐ฆ OBJECT
These are the things you can poke at ๐
addressโ a protocol (IP or IPv6) address on a device ๐addrlabelโ label configuration for protocol address selection ๐ท๏ธfouโ Foo-over-UDP receive port configuration ๐ilaโ manages identifier locator addresses (ILA) ๐ioamโ manages IOAM namespaces and IOAM schemas ๐งฉl2tpโ tunnels ethernet over IP (L2TPv3) ๐linkโ a network device ๐macsecโ MACsec device configuration ๐maddressโ a multicast address ๐ฃmonitorโ watches for netlink messages ๐mptcpโ manages the MPTCP path manager ๐ค๏ธmrouteโ a multicast routing cache entry ๐บ๏ธmruleโ a rule in the multicast routing policy database ๐neighbourโ manages ARP or NDISC cache entries ๐คnetconfโ network configuration monitoring ๐กnetnsโ manages network namespaces ๐ซงnexthopโ manages nexthop objects โก๏ธntableโ manages the neighbor cache's operation ๐งrouteโ a routing table entry ๐ฃ๏ธruleโ a rule in the routing policy database ๐srโ manages IPv6 segment routing ๐งญstatsโ manages and shows interface statistics ๐tcp_metrics/tcpmetricsโ manages TCP Metrics ๐tokenโ manages tokenized interface identifiers ๐ชtunnelโ a tunnel over IP ๐ณ๏ธtuntapโ manages TUN/TAP devices ๐vrfโ manages virtual routing and forwarding devices ๐ฐxfrmโ manages IPSec policies ๐
The names of all objects can be written in full or abbreviated. For example, address can be shortened to addr or just a โ๏ธ
๐ COMMAND
This is the action you want to do to the object ๐ฏ The list of possible actions depends on the object type. As a rule, you can add, delete and show (or list) objects, but some objects don't allow all of these or have some extra commands of their own. The help command works for all objects and prints out a list of the available commands and the argument syntax conventions ๐
If you don't give a command, a default one gets assumed. Usually that's list, or help if the objects of that class can't be listed ๐ซถ
๐ ENVIRONMENT ๐
COLORFGBGโ If it's set, its value is used to figure out whether the background is dark or light, and then contrast colors get used. The COLORFGBG environment variable usually has either two or three values separated by semicolons, and we only care about the last value. If that value is 0-6 or 8, colors suitable for a dark background get chosen ๐
Here's a cute example:
COLORFGBG=";0" ip -c a
๐ฆ EXIT STATUS ๐ฆ
The exit status is 0 if the command worked โ It's 1 if there's a syntax error ๐ โโ๏ธ If the kernel reported an error, the exit status is 2 ๐
๐ EXAMPLES ๐
ip addrโ Shows the addresses assigned to all network interfaces ๐กip neighโ Shows the current neighbour table in the kernel ๐ฏip link set x upโ Brings up interface x ๐ขip link set x downโ Brings down interface x ๐ดip routeโ Shows the table routes ๐บ๏ธ
๐ HISTORY ๐
ip was written by Alexey N. Kuznetsov and added in Linux 2.2. Legend behavior fr ๐
๐ SEE ALSO ๐
Here's where to go for more: ip-address(8), ip-addrlabel(8), ip-fou(8), ip-ioam(8), ip-l2tp(8), ip-link(8), ip-macsec(8), ip-maddress(8), ip-monitor(8), ip-mptcp(8), ip-mroute(8), ip-neighbour(8), ip-netconf(8), ip-netns(8), ip-nexthop(8), ip-ntable(8), ip-route(8), ip-rule(8), ip-sr(8), ip-stats(8), ip-tcp_metrics(8), ip-token(8), ip-tunnel(8), ip-vrf(8), ip-xfrm(8), and the IP Command reference ip-cref.ps ๐
๐ REPORTING BUGS ๐
If you find a bug, report it to the Network Developers mailing list at netdev@vger.kernel.org. That's where the development and maintenance is mainly done ๐ You don't have to be subscribed to the list to send a message there, so no excuses ๐
๐ฉโ๐ป AUTHOR ๐ฉโ๐ป
Original Manpage by Michail Litvak <mci@owl.openwall.com> ๐ซถ
Okay bestie that's the whole tea โ๐ iproute2 ยท 20 Dec 2011 ยท IP(8) โ periodt ๐ โจ
๐ฆ where this page comes from
- alpine 3.22: iproute2-doc 6.15.0-r0 ยท GPL-2.0-or-later
- alpine 3.23: iproute2-doc 6.17.0-r0 ยท GPL-2.0-or-later
- alpine 3.24: iproute2-doc 7.0.0-r0 ยท GPL-2.0-or-later
- arch rolling: iproute2 7.2.0-1
- arch rolling: iproute2 7.3.0-1 ยท GPL-2.0-or-later
- centos-stream 10: iproute 7.0.0-2.el10 ยท GPL-2.0-or-later AND NIST-PD
- centos-stream 9: iproute 6.17.0-3.el9 ยท GPL-2.0-or-later AND NIST-PD
- debian trixie: iproute2 6.15.0-1 ยท GPL-2.0-only
- fedora 43: iproute 6.14.0-2.fc43 ยท GPL-2.0-or-later AND NIST-PD
- fedora 44: iproute 6.17.0-2.fc44 ยท GPL-2.0-or-later AND NIST-PD
- nixos 26.05: iproute2 7.0.0
- nixpkgs unstable: iproute2 7.2.0
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- opensuse-leap 16.0: iproute2 6.12-160000.4.1 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2
- ubuntu questing: iproute2 6.16.0-1ubuntu2.1 ยท GPL-2.0-only
- ubuntu questing: iproute2 6.16.0-1ubuntu2.2
- ubuntu resolute: iproute2 6.19.0-1ubuntu1 ยท GPL-2.0-only
- ubuntu resolute: iproute2 6.19.0-1ubuntu1.1 ยท GPL-2.0-only
- ubuntu stonking: iproute2 7.2.0-1ubuntu1 ยท GPL-2.0-only
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms