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 | stats }
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
164       -echo  Request the kernel to send the applied configuration back.
165
166

IP - COMMAND SYNTAX

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

ENVIRONMENT

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

EXIT STATUS

271       Exit status is 0 if command was successful, and 1 if there is a syntax
272       error.  If an error was reported by the kernel exit status is 2.
273
274

EXAMPLES

276       ip addr
277           Shows addresses assigned to all network interfaces.
278
279       ip neigh
280           Shows the current neighbour table in kernel.
281
282       ip link set x up
283           Bring up interface x.
284
285       ip link set x down
286           Bring down interface x.
287
288       ip route
289           Show table routes.
290
291

HISTORY

293       ip was written by Alexey N. Kuznetsov and added in Linux 2.2.
294

SEE ALSO

296       ip-address(8), ip-addrlabel(8), ip-ioam(8), ip-l2tp(8), ip-link(8), ip-
297       maddress(8), ip-monitor(8), ip-mptcp(8), ip-mroute(8), ip-neighbour(8),
298       ip-netns(8), ip-ntable(8), ip-route(8), ip-rule(8), ip-stats(8) ip-
299       tcp_metrics(8), ip-token(8), ip-tunnel(8), ip-vrf(8), ip-xfrm(8)
300       IP Command reference ip-cref.ps
301

REPORTING BUGS

303       Report any bugs to the Network Developers mailing list <net‐
304       dev@vger.kernel.org> where the development and maintenance is primarily
305       done.  You do not have to be subscribed to the list to send a message
306       there.
307
308

AUTHOR

310       Original Manpage by Michail Litvak <mci@owl.openwall.com>
311
312
313
314iproute2                          20 Dec 2011                            IP(8)
Impressum