Chapter 9. Kernel 2.2 IP Command Reference (Work In Progress)

9.1. ip

If you have the iproute2 tools installed, executing the ip command will allow the basic syntax to be displayed.


[root@jd Net4]# ip
Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }
where  OBJECT := { link | addr | route | rule | neigh | tunnel |
                   maddr | mroute | monitor }
       OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] |
                    -f[amily] { inet | inet6 | dnet | link } | -o[neline] }

There are also several options available:

-V, -Version -- print the version of the ip utility you are using and exit.

-s, -stats, -statistics -- obtain more output on the speficied device. You can issue this option more than once to increase the amount of information being displayed.

-f, -family followed by a protocol family identifier such as: inet, inet6 or link. -- Specify the exact protocol family to use, inet uses the standard IPv4 (e.g.; current internet standard), inet6 uses IPv6 (ground breadking, never to be implemented internet standard), and link (a physical link). If you do not present the option the protocol family is guessed and if not enough information is present it will fallback to the default setting.

-o, -oneline Show the output each device record in a single line.

-r, -resolve Use the system resolver (e.g.; DNS) to print actual names versus IP numbers.

OBJECT Is the object/device to manage or get information about. The current device types understood by the current implementation are:

The amount of possible options allowed on each object type depend on the type of action being taken. As a basic rule it is possible to add, delete, or to show the object(s), but not all object will allow additional commands to be used. Of course, command help is available for all objects and when used will print out a list of available sytanx conventions for the given object.

If you do not give a command, the default command will be assumed. Typically the default command is to list the objects or if the the objects can not be listed to provide the standard help output.

ARGUMENTS is the list of arguments that can be passed to the command. The number of arguments depend on the command and object being used. There is two types of arguments:

Flags consist of a keyword followed by a value. For convenience each command has some default parameters, which can be left out for easier use. For example, the paramater dev> defaults to an ip link.

Mistakes... thank god for smart coders. All the operations within the ip commands are dynamic. If the sytanx of the ip utility fails, it will not change the configuration of the system. As always, there is an exception to this rule, the ip link command which is used to change part of a device parameters.

It is difficult to list all the error messages (especially, about syntax errors), however as rule their meaning is clear in the context of the command. The most common mistakes are: 1. Netlink is not configured in the kernel. The message is: Cannot open netlink socket: Invalid value

2. RTNETLINK is not configured in the kernel. In this case one of the following messages may be printed, depending on the command: Cannot talk to rtnetlink: Connection refused Cannot send dump request: Connection refused

3. Option CONFIG_IP_MULTIPLE_TABLES was not selected when configuring kernel. In this case any attempt to use commandip rule will fail, e.g.;

jd@home $ ip rule list RTNETLINK error: Invalid argument dump terminated