next up previous contents
Next: ip error Up: ip command Previous: ip command   Contents

Example:

kuznet@kaiser $ cat /tmp/ip_batch.ip
# This is a comment
tuntap add mode tap tap1 # This is an another comment
link set up dev tap1
addr add 10.0.0.1/24 dev tap1
kuznet@kaiser $ sudo ip -b /tmp/ip_batch.ip
or from standart input:
kuznet@kaiser $ cat /tmp/ip_batch.ip | sudo ip -b -

-force

-- don't terminate ip on errors in batch mode. If there were any errors during execution of the commands, the application return code will be non zero.

-l, -loops COUNT

-- specify maximum number of loops the 'ip addr flush' logic will attempt before giving up. The default is 10. Zero (0) means loop until all addresses are removed.

OBJECT is the object to manage or to get information about. The object types currently understood by ip are:

Again, the names of all objects may be written in full or abbreviated form, f.e. address is 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 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, help.

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.


next up previous contents
Next: ip error Up: ip command Previous: ip command   Contents