# phpman > man > ip(8)

[IP(8)](https://www.chedong.com/phpMan.php/man/IP/8/markdown)                                           Linux                                          [IP(8)](https://www.chedong.com/phpMan.php/man/IP/8/markdown)



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

## SYNOPSIS
       **ip** [ _OPTIONS_ ] _OBJECT_ { _COMMAND_ | **help** }


       **ip** [ **-force** ] **-batch** _filename_


       _OBJECT_ := { **link** | **address** | **addrlabel** | **route** | **rule** | **neigh** | **ntable** | **tunnel** | **tuntap** |
               **maddress** | **mroute** | **mrule** | **monitor** | **xfrm** | **netns** | **l2tp** | **tcp**___**metrics** | **token** |
               **macsec** | **vrf** | **mptcp** | **ioam** }


       _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
### -V -Version
              Print the version of the **ip** utility and exit.


### -h -human -human-readable
              output statistics with human readable values followed by suffix.


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


### -force
              of the commands, the application return code will be non zero.


### -s -stats -statistics
              Output more information. If the option appears twice or more, the amount of informa‐
              tion increases.  As a rule, the information is statistics or some time values.


### -d -details
              Output more detailed information.


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


### -f -family
              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 in‐
              volved.


### -4 -family


### -6 -family


### -B -family


### -M -family


### -0 -family


### -o -oneline
              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)](https://www.chedong.com/phpMan.php/man/wc/1/markdown) or to [**grep**(1)](https://www.chedong.com/phpMan.php/man/grep/1/markdown) the output.


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


### -n -netns
              switches **ip** to the specified network namespace _NETNS_.  Actually it just simplifies ex‐
              ecuting of:

              **ip** **netns** **exec** _NETNS_ **ip** [ _OPTIONS_ ] _OBJECT_ { _COMMAND_ | **help** }

              to

              **ip** -n[etns] _NETNS_ [ _OPTIONS_ ] _OBJECT_ { _COMMAND_ | **help** }


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


### -a -all
              executes specified command over all objects, it depends if command supports this op‐
              tion.


### -c
              Configure color output. If parameter is omitted or **always**, color output is enabled re‐
              gardless of stdout state. If parameter is **auto**, stdout is checked to be a terminal be‐
              fore enabling color output. If parameter is **never**, color output is disabled. If speci‐
              fied 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 **ENVIRON**‐‐
              **MENT**).


### -t -timestamp
              display current time when using monitor option.


### -ts -tshort
              Like **-timestamp**, but use shorter format.


### -rc -rcvbuf
              Set the netlink socket receive buffer size, defaults to 1MB.


### -iec


### -br -brief
              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
              Output results in JavaScript Object Notation (JSON).


### -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.


## IP - COMMAND SYNTAX
   _OBJECT_
### address
              - protocol (IP or IPv6) address on a device.


### addrlabel
              - label configuration for protocol address selection.


       **ioam**   - manage IOAM namespaces and IOAM schemas.


       **l2tp**   - tunnel ethernet over IP (L2TPv3).


       **link**   - network device.


### maddress
              - multicast address.


### monitor
              - watch for netlink messages.


       **mptcp**  - manage MPTCP path manager.


       **mroute** - multicast routing cache entry.


       **mrule**  - rule in multicast routing policy database.


### neighbour
              - manage ARP or NDISC cache entries.


       **netns**  - manage network namespaces.


       **ntable** - manage the neighbor cache's operation.


       **route**  - routing table entry.


       **rule**   - rule in routing policy database.


       **tcp**___**metrics/tcpmetrics**
              - manage TCP Metrics


       **token**  - manage tokenized interface identifiers.


       **tunnel** - tunnel over IP.


       **tuntap** - manage TUN/TAP devices.


       **vrf**    - manage virtual routing and forwarding devices.


       **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_
       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** com‐
       mand 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 ob‐
       jects of this class cannot be listed, **help**.


## ENVIRONMENT
       **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 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
       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
       **ip** was written by Alexey N. Kuznetsov and added in Linux 2.2.

## SEE ALSO
       [**ip-address**(8)](https://www.chedong.com/phpMan.php/man/ip-address/8/markdown), [**ip-addrlabel**(8)](https://www.chedong.com/phpMan.php/man/ip-addrlabel/8/markdown), [**ip-ioam**(8)](https://www.chedong.com/phpMan.php/man/ip-ioam/8/markdown), [**ip-l2tp**(8)](https://www.chedong.com/phpMan.php/man/ip-l2tp/8/markdown), [**ip-link**(8)](https://www.chedong.com/phpMan.php/man/ip-link/8/markdown), [**ip-maddress**(8)](https://www.chedong.com/phpMan.php/man/ip-maddress/8/markdown), **ip-moni**‐‐
       [**tor**(8)](https://www.chedong.com/phpMan.php/man/tor/8/markdown), [**ip-mptcp**(8)](https://www.chedong.com/phpMan.php/man/ip-mptcp/8/markdown), [**ip-mroute**(8)](https://www.chedong.com/phpMan.php/man/ip-mroute/8/markdown), [**ip-neighbour**(8)](https://www.chedong.com/phpMan.php/man/ip-neighbour/8/markdown), [**ip-netns**(8)](https://www.chedong.com/phpMan.php/man/ip-netns/8/markdown), [**ip-ntable**(8)](https://www.chedong.com/phpMan.php/man/ip-ntable/8/markdown), [**ip-route**(8)](https://www.chedong.com/phpMan.php/man/ip-route/8/markdown),
       [**ip-rule**(8)](https://www.chedong.com/phpMan.php/man/ip-rule/8/markdown), **ip-tcp**___**[metrics**(8)](https://www.chedong.com/phpMan.php/man/metrics/8/markdown), [**ip-token**(8)](https://www.chedong.com/phpMan.php/man/ip-token/8/markdown), [**ip-tunnel**(8)](https://www.chedong.com/phpMan.php/man/ip-tunnel/8/markdown), [**ip-vrf**(8)](https://www.chedong.com/phpMan.php/man/ip-vrf/8/markdown), [**ip-xfrm**(8)](https://www.chedong.com/phpMan.php/man/ip-xfrm/8/markdown)
       IP Command reference **ip-cref.ps**

## REPORTING BUGS
       Report any bugs to the Network Developers mailing list **<<netdev@vger.kernel.org>>** where the de‐
       velopment and maintenance is primarily done.  You do not have to be subscribed to the list to
       send a message there.


## AUTHOR
       Original Manpage by Michail Litvak <<mci@owl.openwall.com>>



iproute2                                     20 Dec 2011                                       [IP(8)](https://www.chedong.com/phpMan.php/man/IP/8/markdown)
