1IP(8)                                Linux                               IP(8)
2
3
4

NAME

6       ip - show / manipulate routing, network devices, interfaces and tunnels
7

SYNOPSIS

9       ip [ OPTIONS ] OBJECT { COMMAND | help }
10
11
12       ip [ -force ] -batch filename
13
14
15       OBJECT := { link | address | addrlabel | route | rule | neigh | ntable
16               | tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm
17               | netns | l2tp | tcp_metrics | token | macsec | vrf | mptcp |
18               ioam }
19
20
21       OPTIONS := { -V[ersion] | -h[uman-readable] | -s[tatistics] |
22               -d[etails] | -r[esolve] | -iec | -f[amily] { inet | inet6 |
23               link } | -4 | -6 | -B | -0 | -l[oops] { maximum-addr-flush-at‐
24               tempts } | -o[neline] | -rc[vbuf] [size] | -t[imestamp] |
25               -ts[hort] | -n[etns] name | -N[umeric] | -a[ll] | -c[olor] |
26               -br[ief] | -j[son] | -p[retty] }
27
28

OPTIONS

30       -V, -Version
31              Print the version of the ip utility and exit.
32
33
34       -h, -human, -human-readable
35              output statistics with human readable values followed by suffix.
36
37
38       -b, -batch <FILENAME>
39              Read commands from provided file or standard input and invoke
40              them.  First failure will cause termination of ip.
41
42
43       -force Don't terminate ip on errors in batch mode.  If there were any
44              errors during execution of the commands, the application return
45              code will be non zero.
46
47
48       -s, -stats, -statistics
49              Output more information. If the option appears twice or more,
50              the amount of information increases.  As a rule, the information
51              is statistics or some time values.
52
53
54       -d, -details
55              Output more detailed information.
56
57
58       -l, -loops <COUNT>
59              Specify maximum number of loops the 'ip address flush' logic
60              will attempt before giving up. The default is 10.  Zero (0)
61              means loop until all addresses are removed.
62
63
64       -f, -family <FAMILY>
65              Specifies the protocol family to use. The protocol family iden‐
66              tifier can be one of inet, inet6, bridge, mpls or link.  If this
67              option is not present, the protocol family is guessed from other
68              arguments. If the rest of the command line does not give enough
69              information to guess the family, ip falls back to the default
70              one, usually inet or any.  link is a special family identifier
71              meaning that no networking protocol is involved.
72
73
74       -4     shortcut for -family inet.
75
76
77       -6     shortcut for -family inet6.
78
79
80       -B     shortcut for -family bridge.
81
82
83       -M     shortcut for -family mpls.
84
85
86       -0     shortcut for -family link.
87
88
89       -o, -oneline
90              output each record on a single line, replacing line feeds with
91              the '\' character. This is convenient when you want to count
92              records with wc(1) or to grep(1) the output.
93
94
95       -r, -resolve
96              use the system's name resolver to print DNS names instead of
97              host addresses.
98
99
100       -n, -netns <NETNS>
101              switches ip to the specified network namespace NETNS.  Actually
102              it just simplifies executing of:
103
104              ip netns exec NETNS ip [ OPTIONS ] OBJECT { COMMAND | help }
105
106              to
107
108              ip -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }
109
110
111       -N, -Numeric
112              Print the number of protocol, scope, dsfield, etc directly in‐
113              stead of converting it to human readable name.
114
115
116       -a, -all
117              executes specified command over all objects, it depends if com‐
118              mand supports this option.
119
120
121       -c[color][={always|auto|never}
122              Configure color output. If parameter is omitted or always, color
123              output is enabled regardless of stdout state. If parameter is
124              auto, stdout is checked to be a terminal before enabling color
125              output. If parameter is never, color output is disabled. If
126              specified multiple times, the last one takes precedence. This
127              flag is ignored if -json is also given.
128
129              Used color palette can be influenced by COLORFGBG environment
130              variable (see ENVIRONMENT).
131
132
133       -t, -timestamp
134              display current time when using monitor option.
135
136
137       -ts, -tshort
138              Like -timestamp, but use shorter format.
139
140
141       -rc, -rcvbuf<SIZE>
142              Set the netlink socket receive buffer size, defaults to 1MB.
143
144
145       -iec   print human readable rates in IEC units (e.g. 1Ki = 1024).
146
147
148       -br, -brief
149              Print only basic information in a tabular format for better
150              readability. This option is currently only supported by ip addr
151              show , ip link show & ip neigh show commands.
152
153
154       -j, -json
155              Output results in JavaScript Object Notation (JSON).
156
157
158       -p, -pretty
159              The default JSON format is compact and more efficient to parse
160              but hard for most users to read.  This flag adds indentation for
161              readability.
162
163

IP - COMMAND SYNTAX

165   OBJECT
166       address
167              - protocol (IP or IPv6) address on a device.
168
169
170       addrlabel
171              - label configuration for protocol address selection.
172
173
174       ioam   - manage IOAM namespaces and IOAM schemas.
175
176
177       l2tp   - tunnel ethernet over IP (L2TPv3).
178
179
180       link   - network device.
181
182
183       maddress
184              - multicast address.
185
186
187       monitor
188              - watch for netlink messages.
189
190
191       mptcp  - manage MPTCP path manager.
192
193
194       mroute - multicast routing cache entry.
195
196
197       mrule  - rule in multicast routing policy database.
198
199
200       neighbour
201              - manage ARP or NDISC cache entries.
202
203
204       netns  - manage network namespaces.
205
206
207       ntable - manage the neighbor cache's operation.
208
209
210       route  - routing table entry.
211
212
213       rule   - rule in routing policy database.
214
215
216       tcp_metrics/tcpmetrics
217              - manage TCP Metrics
218
219
220       token  - manage tokenized interface identifiers.
221
222
223       tunnel - tunnel over IP.
224
225
226       tuntap - manage TUN/TAP devices.
227
228
229       vrf    - manage virtual routing and forwarding devices.
230
231
232       xfrm   - manage IPSec policies.
233
234
235       The names of all objects may be written in full or abbreviated form,
236       for example address can be abbreviated as addr or just a.
237
238
239   COMMAND
240       Specifies the action to perform on the object.  The set of possible ac‐
241       tions depends on the object type.  As a rule, it is possible to add,
242       delete and show (or list ) objects, but some objects do not allow all
243       of these operations or have some additional commands. The help command
244       is available for all objects. It prints out a list of available com‐
245       mands and argument syntax conventions.
246
247       If no command is given, some default command is assumed.  Usually it is
248       list or, if the objects of this class cannot be listed, help.
249
250

ENVIRONMENT

252       COLORFGBG
253              If set, it's value is used for detection whether background is
254              dark or light and use contrast colors for it.
255
256              COLORFGBG environment variable usually contains either two or
257              three values separated by semicolons; we want the last value in
258              either case.  If this value is 0-6 or 8, chose colors suitable
259              for dark background:
260
261              COLORFGBG=";0" ip -c a
262
263

EXIT STATUS

265       Exit status is 0 if command was successful, and 1 if there is a syntax
266       error.  If an error was reported by the kernel exit status is 2.
267
268

EXAMPLES

270       ip addr
271           Shows addresses assigned to all network interfaces.
272
273       ip neigh
274           Shows the current neighbour table in kernel.
275
276       ip link set x up
277           Bring up interface x.
278
279       ip link set x down
280           Bring down interface x.
281
282       ip route
283           Show table routes.
284
285

HISTORY

287       ip was written by Alexey N. Kuznetsov and added in Linux 2.2.
288

SEE ALSO

290       ip-address(8), ip-addrlabel(8), ip-ioam(8), ip-l2tp(8), ip-link(8), ip-
291       maddress(8), ip-monitor(8), ip-mptcp(8), ip-mroute(8), ip-neighbour(8),
292       ip-netns(8), ip-ntable(8), ip-route(8), ip-rule(8), ip-tcp_metrics(8),
293       ip-token(8), ip-tunnel(8), ip-vrf(8), ip-xfrm(8)
294       IP Command reference ip-cref.ps
295

REPORTING BUGS

297       Report any bugs to the Network Developers mailing list <net‐
298       dev@vger.kernel.org> where the development and maintenance is primarily
299       done.  You do not have to be subscribed to the list to send a message
300       there.
301
302

AUTHOR

304       Original Manpage by Michail Litvak <mci@owl.openwall.com>
305
306
307
308iproute2                          20 Dec 2011                            IP(8)
Impressum