The generic form of an
ip command is:
ip [ OPTIONS ] OBJECT [ COMMAND [ ARGUMENTS ]]where
OPTIONSis a set of optional modifiers affecting the general behaviour of the
iputility or changing its output. All options begin with the character
'-'and may be used in either long or abbreviated forms. Currently, the following options are available:
-- print the version of the
ip utility and exit.
-- 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.
-familyfollowed by a protocol family identifier:
-- enforce the protocol family to use. If the 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
link is a special family
identifier meaning that no networking protocol is involved.
-- shortcut for
-- shortcut for
-- shortcut for
-- output each record on a single line, replacing line feeds
'\' character. This is convenient when you want to
count records with
wc or to
grep the output. The trivial
rtpr converts the output back into readable form.
-- use the system's name resolver to print DNS names instead of host addresses.
1cm NB. Do not use this option when reporting bugs or asking for advice.
ip never uses DNS to resolve names to addresses.
OBJECT is the object to manage or to get information about.
The object types currently understood by
link-- network device
address-- protocol (IP or IPv6) address on a device
neighbour-- ARP or NDISC cache entry
route-- routing table entry
rule-- rule in routing policy database
maddress-- multicast address
mroute-- multicast routing cache entry
tunnel-- tunnel over IP
Again, the names of all objects may be written in full or
abbreviated form, f.e.
address is abbreviated as
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
list) objects, but some objects
do not allow all of these operations or have some additional commands.
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,
ARGUMENTS is a list of arguments to the command.
The arguments depend on the command and object. There are two types of arguments:
flags, consisting of a single keyword, and parameters,
consisting of a keyword followed by a value. For convenience,
each command has some default parameter
which may be omitted. F.e. parameter
dev is the default
for the ip link command, so ip link ls eth0 is equivalent
to ip link ls dev eth0.
In the command descriptions below such parameters
are distinguished with the marker: ``(default)''.
Almost all keywords may be abbreviated with several first (or even single)
letters. The shortcuts are convenient when
ip is used interactively,
but they are not recommended in scripts or when reporting bugs
or asking for advice. ``Officially'' allowed abbreviations are listed
in the document body.