{
    "mode": "man",
    "parameter": "ip",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/ip/8/json",
    "generated": "2026-06-02T19:34:21Z",
    "synopsis": "ip [ OPTIONS ] OBJECT { COMMAND | help }\nip [ -force ] -batch filename\nOBJECT := { link | address | addrlabel | route | rule | neigh | ntable | tunnel | tuntap |\nmaddress | mroute | mrule | monitor | xfrm | netns | l2tp | tcpmetrics | token |\nmacsec | vrf | mptcp | ioam }\nOPTIONS := { -V[ersion] | -h[uman-readable] | -s[tatistics] | -d[etails] | -r[esolve] | -iec\n| -f[amily] { inet | inet6 | link } | -4 | -6 | -B | -0 | -l[oops] { maximum-addr-\nflush-attempts } | -o[neline] | -rc[vbuf] [size] | -t[imestamp] | -ts[hort] |\n-n[etns] name | -N[umeric] | -a[ll] | -c[olor] | -br[ief] | -j[son] | -p[retty] }",
    "sections": {
        "NAME": {
            "content": "ip - show / manipulate routing, network devices, interfaces and tunnels\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "ip [ OPTIONS ] OBJECT { COMMAND | help }\n\n\nip [ -force ] -batch filename\n\n\nOBJECT := { link | address | addrlabel | route | rule | neigh | ntable | tunnel | tuntap |\nmaddress | mroute | mrule | monitor | xfrm | netns | l2tp | tcpmetrics | token |\nmacsec | vrf | mptcp | ioam }\n\n\nOPTIONS := { -V[ersion] | -h[uman-readable] | -s[tatistics] | -d[etails] | -r[esolve] | -iec\n| -f[amily] { inet | inet6 | link } | -4 | -6 | -B | -0 | -l[oops] { maximum-addr-\nflush-attempts } | -o[neline] | -rc[vbuf] [size] | -t[imestamp] | -ts[hort] |\n-n[etns] name | -N[umeric] | -a[ll] | -c[olor] | -br[ief] | -j[son] | -p[retty] }\n\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-V -Version",
                    "content": "Print the version of the ip utility and exit.\n\n",
                    "flag": "-V"
                },
                {
                    "name": "-h -human -human-readable",
                    "content": "output statistics with human readable values followed by suffix.\n\n",
                    "flag": "-h"
                },
                {
                    "name": "-b -batch",
                    "content": "Read commands from provided file or standard input and invoke them.  First failure\nwill cause termination of ip.\n\n",
                    "flag": "-b"
                },
                {
                    "name": "-force",
                    "content": "of the commands, the application return code will be non zero.\n\n"
                },
                {
                    "name": "-s -stats -statistics",
                    "content": "Output more information. If the option appears twice or more, the amount of informa‐\ntion increases.  As a rule, the information is statistics or some time values.\n\n",
                    "flag": "-s"
                },
                {
                    "name": "-d -details",
                    "content": "Output more detailed information.\n\n",
                    "flag": "-d"
                },
                {
                    "name": "-l -loops",
                    "content": "Specify maximum number of loops the 'ip address flush' logic will attempt before giv‐\ning up. The default is 10.  Zero (0) means loop until all addresses are removed.\n\n",
                    "flag": "-l"
                },
                {
                    "name": "-f -family",
                    "content": "Specifies the protocol family to use. The protocol family identifier can be one of\ninet, inet6, bridge, mpls or link.  If this option is not present, the protocol family\nis guessed from other arguments. If the rest of the command line does not give enough\ninformation to guess the family, ip falls back to the default one, usually inet or\nany.  link is a special family identifier meaning that no networking protocol is in‐\nvolved.\n\n",
                    "flag": "-f"
                },
                {
                    "name": "-4 -family",
                    "content": "",
                    "flag": "-4"
                },
                {
                    "name": "-6 -family",
                    "content": "",
                    "flag": "-6"
                },
                {
                    "name": "-B -family",
                    "content": "",
                    "flag": "-B"
                },
                {
                    "name": "-M -family",
                    "content": "",
                    "flag": "-M"
                },
                {
                    "name": "-0 -family",
                    "content": "",
                    "flag": "-0"
                },
                {
                    "name": "-o -oneline",
                    "content": "output each record on a single line, replacing line feeds with the '\\' character. This\nis convenient when you want to count records with wc(1) or to grep(1) the output.\n\n",
                    "flag": "-o"
                },
                {
                    "name": "-r -resolve",
                    "content": "use the system's name resolver to print DNS names instead of host addresses.\n\n",
                    "flag": "-r"
                },
                {
                    "name": "-n -netns",
                    "content": "switches ip to the specified network namespace NETNS.  Actually it just simplifies ex‐\necuting of:\n\nip netns exec NETNS ip [ OPTIONS ] OBJECT { COMMAND | help }\n\nto\n\nip -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }\n\n",
                    "flag": "-n"
                },
                {
                    "name": "-N -Numeric",
                    "content": "Print the number of protocol, scope, dsfield, etc directly instead of converting it to\nhuman readable name.\n\n",
                    "flag": "-N"
                },
                {
                    "name": "-a -all",
                    "content": "executes specified command over all objects, it depends if command supports this op‐\ntion.\n\n",
                    "flag": "-a"
                },
                {
                    "name": "-c",
                    "content": "Configure color output. If parameter is omitted or always, color output is enabled re‐\ngardless of stdout state. If parameter is auto, stdout is checked to be a terminal be‐\nfore enabling color output. If parameter is never, color output is disabled. If speci‐\nfied multiple times, the last one takes precedence. This flag is ignored if -json is\nalso given.\n\nUsed color palette can be influenced by COLORFGBG environment variable (see ENVIRON‐‐\nMENT).\n\n",
                    "flag": "-c"
                },
                {
                    "name": "-t -timestamp",
                    "content": "display current time when using monitor option.\n\n",
                    "flag": "-t"
                },
                {
                    "name": "-ts -tshort",
                    "content": "Like -timestamp, but use shorter format.\n\n"
                },
                {
                    "name": "-rc -rcvbuf",
                    "content": "Set the netlink socket receive buffer size, defaults to 1MB.\n\n"
                },
                {
                    "name": "-iec",
                    "content": ""
                },
                {
                    "name": "-br -brief",
                    "content": "Print only basic information in a tabular format for better readability. This option\nis currently only supported by ip addr show , ip link show & ip neigh show commands.\n\n"
                },
                {
                    "name": "-j -json",
                    "content": "Output results in JavaScript Object Notation (JSON).\n\n",
                    "flag": "-j"
                },
                {
                    "name": "-p -pretty",
                    "content": "The default JSON format is compact and more efficient to parse but hard for most users\nto read.  This flag adds indentation for readability.\n\n",
                    "flag": "-p"
                }
            ]
        },
        "IP - COMMAND SYNTAX": {
            "content": "OBJECT",
            "subsections": [
                {
                    "name": "address",
                    "content": "- protocol (IP or IPv6) address on a device.\n\n"
                },
                {
                    "name": "addrlabel",
                    "content": "- label configuration for protocol address selection.\n\n\nioam   - manage IOAM namespaces and IOAM schemas.\n\n\nl2tp   - tunnel ethernet over IP (L2TPv3).\n\n\nlink   - network device.\n\n"
                },
                {
                    "name": "maddress",
                    "content": "- multicast address.\n\n"
                },
                {
                    "name": "monitor",
                    "content": "- watch for netlink messages.\n\n\nmptcp  - manage MPTCP path manager.\n\n\nmroute - multicast routing cache entry.\n\n\nmrule  - rule in multicast routing policy database.\n\n"
                },
                {
                    "name": "neighbour",
                    "content": "- manage ARP or NDISC cache entries.\n\n\nnetns  - manage network namespaces.\n\n\nntable - manage the neighbor cache's operation.\n\n\nroute  - routing table entry.\n\n\nrule   - rule in routing policy database.\n\n\ntcpmetrics/tcpmetrics\n- manage TCP Metrics\n\n\ntoken  - manage tokenized interface identifiers.\n\n\ntunnel - tunnel over IP.\n\n\ntuntap - manage TUN/TAP devices.\n\n\nvrf    - manage virtual routing and forwarding devices.\n\n\nxfrm   - manage IPSec policies.\n\n\nThe names of all objects may be written in full or abbreviated form, for example address can\nbe abbreviated as addr or just a.\n\n\nCOMMAND\nSpecifies the action to perform on the object.  The set of possible actions depends on the\nobject type.  As a rule, it is possible to add, delete and show (or list ) objects, but some\nobjects do not allow all of these operations or have some additional commands. The help com‐\nmand is available for all objects. It prints out a list of available commands and argument\nsyntax conventions.\n\nIf no command is given, some default command is assumed.  Usually it is list or, if the ob‐\njects of this class cannot be listed, help.\n\n"
                }
            ]
        },
        "ENVIRONMENT": {
            "content": "COLORFGBG\nIf set, it's value is used for detection whether background is dark or light and use\ncontrast colors for it.\n\nCOLORFGBG environment variable usually contains either two or three values separated\nby semicolons; we want the last value in either case.  If this value is 0-6 or 8,\nchose colors suitable for dark background:\n\nCOLORFGBG=\";0\" ip -c a\n\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "Exit status is 0 if command was successful, and 1 if there is a syntax error.  If an error\nwas reported by the kernel exit status is 2.\n\n",
            "subsections": []
        },
        "EXAMPLES": {
            "content": "ip addr\nShows addresses assigned to all network interfaces.\n\nip neigh\nShows the current neighbour table in kernel.\n\nip link set x up\nBring up interface x.\n\nip link set x down\nBring down interface x.\n\nip route\nShow table routes.\n\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "ip was written by Alexey N. Kuznetsov and added in Linux 2.2.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ip-address(8), ip-addrlabel(8), ip-ioam(8), ip-l2tp(8), ip-link(8), ip-maddress(8), ip-moni‐‐\ntor(8), ip-mptcp(8), ip-mroute(8), ip-neighbour(8), ip-netns(8), ip-ntable(8), ip-route(8),\nip-rule(8), ip-tcpmetrics(8), ip-token(8), ip-tunnel(8), ip-vrf(8), ip-xfrm(8)\nIP Command reference ip-cref.ps\n",
            "subsections": []
        },
        "REPORTING BUGS": {
            "content": "Report any bugs to the Network Developers mailing list <netdev@vger.kernel.org> where the de‐\nvelopment and maintenance is primarily done.  You do not have to be subscribed to the list to\nsend a message there.\n\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Original Manpage by Michail Litvak <mci@owl.openwall.com>\n\n\n\niproute2                                     20 Dec 2011                                       IP(8)",
            "subsections": []
        }
    },
    "summary": "ip - show / manipulate routing, network devices, interfaces and tunnels",
    "flags": [
        {
            "flag": "-V",
            "long": null,
            "arg": null,
            "description": "Print the version of the ip utility and exit."
        },
        {
            "flag": "-h",
            "long": null,
            "arg": null,
            "description": "output statistics with human readable values followed by suffix."
        },
        {
            "flag": "-b",
            "long": null,
            "arg": null,
            "description": "Read commands from provided file or standard input and invoke them. First failure will cause termination of ip."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "of the commands, the application return code will be non zero."
        },
        {
            "flag": "-s",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-d",
            "long": null,
            "arg": null,
            "description": "Output more detailed information."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-4",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-6",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-B",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-M",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-0",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-o",
            "long": null,
            "arg": null,
            "description": "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) or to grep(1) the output."
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": "use the system's name resolver to print DNS names instead of host addresses."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "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 }"
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": "Print the number of protocol, scope, dsfield, etc directly instead of converting it to human readable name."
        },
        {
            "flag": "-a",
            "long": null,
            "arg": null,
            "description": "executes specified command over all objects, it depends if command supports this op‐ tion."
        },
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "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)."
        },
        {
            "flag": "-t",
            "long": null,
            "arg": null,
            "description": "display current time when using monitor option."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Like -timestamp, but use shorter format."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "Set the netlink socket receive buffer size, defaults to 1MB."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "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."
        },
        {
            "flag": "-j",
            "long": null,
            "arg": null,
            "description": "Output results in JavaScript Object Notation (JSON)."
        },
        {
            "flag": "-p",
            "long": null,
            "arg": null,
            "description": "The default JSON format is compact and more efficient to parse but hard for most users to read. This flag adds indentation for readability."
        }
    ],
    "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."
    ],
    "see_also": [
        {
            "name": "ip-address",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-address/8/json"
        },
        {
            "name": "ip-addrlabel",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-addrlabel/8/json"
        },
        {
            "name": "ip-ioam",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-ioam/8/json"
        },
        {
            "name": "ip-l2tp",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-l2tp/8/json"
        },
        {
            "name": "ip-link",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-link/8/json"
        },
        {
            "name": "ip-maddress",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-maddress/8/json"
        },
        {
            "name": "tor",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/tor/8/json"
        },
        {
            "name": "ip-mptcp",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-mptcp/8/json"
        },
        {
            "name": "ip-mroute",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-mroute/8/json"
        },
        {
            "name": "ip-neighbour",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-neighbour/8/json"
        },
        {
            "name": "ip-netns",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-netns/8/json"
        },
        {
            "name": "ip-ntable",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-ntable/8/json"
        },
        {
            "name": "ip-route",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-route/8/json"
        },
        {
            "name": "ip-rule",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-rule/8/json"
        },
        {
            "name": "ip-tcpmetrics",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-tcpmetrics/8/json"
        },
        {
            "name": "ip-token",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-token/8/json"
        },
        {
            "name": "ip-tunnel",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-tunnel/8/json"
        },
        {
            "name": "ip-vrf",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-vrf/8/json"
        },
        {
            "name": "ip-xfrm",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ip-xfrm/8/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Show/manipulate routing, devices, policy routing and tunnels.",
        "examples": [
            {
                "description": "List interfaces with detailed info",
                "command": "ip {{a|address}}"
            },
            {
                "description": "List interfaces with brief network layer info",
                "command": "ip {{-br|-brief}} {{a|address}}"
            },
            {
                "description": "List interfaces with brief link layer info",
                "command": "ip {{-br|-brief}} {{l|link}}"
            },
            {
                "description": "Display the routing table",
                "command": "ip {{r|route}}"
            },
            {
                "description": "Show neighbors (ARP table)",
                "command": "ip {{n|neighbour}}"
            },
            {
                "description": "Make an interface up/down",
                "command": "sudo ip {{l|link}} {{s|set}} {{ethX}} {{up|down}}"
            },
            {
                "description": "Add/Delete an IP address to an interface",
                "command": "sudo ip {{a|address}} {{add|delete}} {{ip_address}}/{{mask}} dev {{ethX}}"
            },
            {
                "description": "Add a default route",
                "command": "sudo ip {{r|route}} {{a|add}} default via {{ip_address}} dev {{ethX}}"
            }
        ]
    }
}