1IP(8) Linux IP(8)
2
3
4
6 ip - show / manipulate routing, network devices, interfaces and tunnels
7
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 }
18
19
20 OPTIONS := { -V[ersion] | -h[uman-readable] | -s[tatistics] |
21 -d[etails] | -r[esolve] | -iec | -f[amily] { inet | inet6 |
22 link } | -4 | -6 | -I | -D | -B | -0 | -l[oops] { maximum-addr-
23 flush-attempts } | -o[neline] | -rc[vbuf] [size] | -t[imestamp]
24 | -ts[hort] | -n[etns] name | -N[umeric] | -a[ll] | -c[olor] |
25 -br[ief] | -j[son] | -p[retty] }
26
27
29 -V, -Version
30 Print the version of the ip utility and exit.
31
32
33 -h, -human, -human-readable
34 output statistics with human readable values followed by suffix.
35
36
37 -b, -batch <FILENAME>
38 Read commands from provided file or standard input and invoke
39 them. First failure will cause termination of ip.
40
41
42 -force Don't terminate ip on errors in batch mode. If there were any
43 errors during execution of the commands, the application return
44 code will be non zero.
45
46
47 -s, -stats, -statistics
48 Output more information. If the option appears twice or more,
49 the amount of information increases. As a rule, the information
50 is statistics or some time values.
51
52
53 -d, -details
54 Output more detailed information.
55
56
57 -l, -loops <COUNT>
58 Specify maximum number of loops the 'ip address flush' logic
59 will attempt before giving up. The default is 10. Zero (0)
60 means loop until all addresses are removed.
61
62
63 -f, -family <FAMILY>
64 Specifies the protocol family to use. The protocol family iden‐
65 tifier can be one of inet, inet6, bridge, mpls or link. If this
66 option is not present, the protocol family is guessed from other
67 arguments. If the rest of the command line does not give enough
68 information to guess the family, ip falls back to the default
69 one, usually inet or any. link is a special family identifier
70 meaning that no networking protocol is involved.
71
72
73 -4 shortcut for -family inet.
74
75
76 -6 shortcut for -family inet6.
77
78
79 -B shortcut for -family bridge.
80
81
82 -M shortcut for -family mpls.
83
84
85 -0 shortcut for -family link.
86
87
88 -o, -oneline
89 output each record on a single line, replacing line feeds with
90 the '\' character. This is convenient when you want to count
91 records with wc(1) or to grep(1) the output.
92
93
94 -r, -resolve
95 use the system's name resolver to print DNS names instead of
96 host addresses.
97
98
99 -n, -netns <NETNS>
100 switches ip to the specified network namespace NETNS. Actually
101 it just simplifies executing of:
102
103 ip netns exec NETNS ip [ OPTIONS ] OBJECT { COMMAND | help }
104
105 to
106
107 ip -n[etns] NETNS [ OPTIONS ] OBJECT { COMMAND | help }
108
109
110 -N, -Numeric
111 Print the number of protocol, scope, dsfield, etc directly
112 instead of converting it to human readable name.
113
114
115 -a, -all
116 executes specified command over all objects, it depends if com‐
117 mand supports this option.
118
119
120 -c[color][={always|auto|never}
121 Configure color output. If parameter is omitted or always, color
122 output is enabled regardless of stdout state. If parameter is
123 auto, stdout is checked to be a terminal before enabling color
124 output. If parameter is never, color output is disabled. If
125 specified multiple times, the last one takes precedence. This
126 flag is ignored if -json is also given.
127
128 Used color palette can be influenced by COLORFGBG environment
129 variable (see ENVIRONMENT).
130
131
132 -t, -timestamp
133 display current time when using monitor option.
134
135
136 -ts, -tshort
137 Like -timestamp, but use shorter format.
138
139
140 -rc, -rcvbuf<SIZE>
141 Set the netlink socket receive buffer size, defaults to 1MB.
142
143
144 -iec print human readable rates in IEC units (e.g. 1Ki = 1024).
145
146
147 -br, -brief
148 Print only basic information in a tabular format for better
149 readability. This option is currently only supported by ip addr
150 show and ip link show commands.
151
152
153 -j, -json
154 Output results in JavaScript Object Notation (JSON).
155
156
157 -p, -pretty
158 The default JSON format is compact and more efficient to parse
159 but hard for most users to read. This flag adds indentation for
160 readability.
161
162
164 OBJECT
165 address
166 - protocol (IP or IPv6) address on a device.
167
168
169 addrlabel
170 - label configuration for protocol address selection.
171
172
173 l2tp - tunnel ethernet over IP (L2TPv3).
174
175
176 link - network device.
177
178
179 maddress
180 - multicast address.
181
182
183 monitor
184 - watch for netlink messages.
185
186
187 mroute - multicast routing cache entry.
188
189
190 mrule - rule in multicast routing policy database.
191
192
193 neighbour
194 - manage ARP or NDISC cache entries.
195
196
197 netns - manage network namespaces.
198
199
200 ntable - manage the neighbor cache's operation.
201
202
203 route - routing table entry.
204
205
206 rule - rule in routing policy database.
207
208
209 tcp_metrics/tcpmetrics
210 - manage TCP Metrics
211
212
213 token - manage tokenized interface identifiers.
214
215
216 tunnel - tunnel over IP.
217
218
219 tuntap - manage TUN/TAP devices.
220
221
222 xfrm - manage IPSec policies.
223
224
225 The names of all objects may be written in full or abbreviated form,
226 for example address can be abbreviated as addr or just a.
227
228
229 COMMAND
230 Specifies the action to perform on the object. The set of possible
231 actions depends on the object type. As a rule, it is possible to add,
232 delete and show (or list ) objects, but some objects do not allow all
233 of these operations or have some additional commands. The help command
234 is available for all objects. It prints out a list of available com‐
235 mands and argument syntax conventions.
236
237 If no command is given, some default command is assumed. Usually it is
238 list or, if the objects of this class cannot be listed, help.
239
240
242 COLORFGBG
243 If set, it's value is used for detection whether background is
244 dark or light and use contrast colors for it.
245
246 COLORFGBG environment variable usually contains either two or
247 three values separated by semicolons; we want the last value in
248 either case. If this value is 0-6 or 8, chose colors suitable
249 for dark background:
250
251 COLORFGBG=";0" ip -c a
252
253
255 Exit status is 0 if command was successful, and 1 if there is a syntax
256 error. If an error was reported by the kernel exit status is 2.
257
258
260 ip addr
261 Shows addresses assigned to all network interfaces.
262
263 ip neigh
264 Shows the current neighbour table in kernel.
265
266 ip link set x up
267 Bring up interface x.
268
269 ip link set x down
270 Bring down interface x.
271
272 ip route
273 Show table routes.
274
275
277 ip was written by Alexey N. Kuznetsov and added in Linux 2.2.
278
280 ip-address(8), ip-addrlabel(8), ip-l2tp(8), ip-link(8), ip-maddress(8),
281 ip-monitor(8), ip-mroute(8), ip-neighbour(8), ip-netns(8), ip-
282 ntable(8), ip-route(8), ip-rule(8), ip-tcp_metrics(8), ip-token(8), ip-
283 tunnel(8), ip-xfrm(8)
284 IP Command reference ip-cref.ps
285
287 Report any bugs to the Network Developers mailing list <net‐
288 dev@vger.kernel.org> where the development and maintenance is primarily
289 done. You do not have to be subscribed to the list to send a message
290 there.
291
292
294 Original Manpage by Michail Litvak <mci@owl.openwall.com>
295
296
297
298iproute2 20 Dec 2011 IP(8)