]>
Commit | Line | Data |
---|---|---|
77987911 | 1 | .TH IP\-LINK 8 "13 Dec 2012" "iproute2" "Linux" |
761a1e60 CT |
2 | .SH "NAME" |
3 | ip-link \- network device configuration | |
4 | .SH "SYNOPSIS" | |
5 | .sp | |
6 | .ad l | |
7 | .in +8 | |
8 | .ti -8 | |
9 | .B ip | |
10 | .RI "[ " OPTIONS " ]" | |
11 | .B link | |
12 | .RI " { " COMMAND " | " | |
13 | .BR help " }" | |
14 | .sp | |
15 | ||
16 | .ti -8 | |
17 | .IR OPTIONS " := { " | |
18 | \fB\-V\fR[\fIersion\fR] | | |
b68d9837 | 19 | \fB\-h\fR[\fIuman-readable\fR] | |
761a1e60 CT |
20 | \fB\-s\fR[\fItatistics\fR] | |
21 | \fB\-r\fR[\fIesolve\fR] | | |
22 | \fB\-f\fR[\fIamily\fR] { | |
23 | .BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | " | |
5d295bb8 AG |
24 | \fB\-o\fR[\fIneline\fR] | |
25 | \fB\-br\fR[\fIief\fR] } | |
761a1e60 CT |
26 | |
27 | .ti -8 | |
9fc56974 AH |
28 | .BI "ip link add" |
29 | .RB "[ " link | |
30 | .IR DEVICE " ]" | |
761a1e60 CT |
31 | .RB "[ " name " ]" |
32 | .I NAME | |
33 | .br | |
34 | .RB "[ " txqueuelen | |
35 | .IR PACKETS " ]" | |
36 | .br | |
37 | .RB "[ " address | |
38 | .IR LLADDR " ]" | |
39 | .RB "[ " broadcast | |
40 | .IR LLADDR " ]" | |
41 | .br | |
42 | .RB "[ " mtu | |
43 | .IR MTU " ]" | |
4de8d885 PE |
44 | .RB "[ " index |
45 | .IR IDX " ]" | |
761a1e60 | 46 | .br |
d992f3e6 JP |
47 | .RB "[ " numtxqueues |
48 | .IR QUEUE_COUNT " ]" | |
49 | .RB "[ " numrxqueues | |
50 | .IR QUEUE_COUNT " ]" | |
51 | .br | |
761a1e60 CT |
52 | .BR type " TYPE" |
53 | .RI "[ " ARGS " ]" | |
54 | ||
55 | .ti -8 | |
56 | .IR TYPE " := [ " | |
f1a6f4e9 | 57 | .BR bridge " | " |
e37a9c73 | 58 | .BR bond " | " |
f1a6f4e9 SH |
59 | .BR can " | " |
60 | .BR dummy " | " | |
5c0aec93 | 61 | .BR hsr " | " |
f1a6f4e9 SH |
62 | .BR ifb " | " |
63 | .BR ipoib " |" | |
64 | .BR macvlan " | " | |
e4c35682 | 65 | .BR macvtap " | " |
f1a6f4e9 SH |
66 | .BR vcan " | " |
67 | .BR veth " | " | |
68 | .BR vlan " | " | |
77987911 ND |
69 | .BR vxlan " |" |
70 | .BR ip6tnl " |" | |
71 | .BR ipip " |" | |
9abde37c | 72 | .BR sit " |" |
73 | .BR gre " |" | |
74 | .BR gretap " |" | |
75 | .BR ip6gre " |" | |
b6d6b5a1 VK |
76 | .BR ip6gretap " |" |
77 | .BR vti " |" | |
78 | .BR nlmon " |" | |
2c0feda8 | 79 | .BR ipvlan " |" |
c1a1d8bc JL |
80 | .BR lowpan " |" |
81 | .BR geneve " ]" | |
761a1e60 CT |
82 | |
83 | .ti -8 | |
7f74cf6d VK |
84 | .BR "ip link delete " { |
85 | .IR DEVICE " | " | |
86 | .BI "group " GROUP | |
87 | } | |
761a1e60 CT |
88 | .BI type " TYPE" |
89 | .RI "[ " ARGS " ]" | |
90 | ||
91 | .ti -8 | |
92 | .BR "ip link set " { | |
93 | .IR DEVICE " | " | |
94 | .BI "group " GROUP | |
95 | .RB "} { " up " | " down " | " arp " { " on " | " off " } |" | |
96 | .br | |
97 | .BR promisc " { " on " | " off " } |" | |
98 | .br | |
99 | .BR allmulticast " { " on " | " off " } |" | |
100 | .br | |
101 | .BR dynamic " { " on " | " off " } |" | |
102 | .br | |
103 | .BR multicast " { " on " | " off " } |" | |
104 | .br | |
18864827 AK |
105 | .BR protodown " { " on " | " off " } |" |
106 | .br | |
761a1e60 CT |
107 | .B txqueuelen |
108 | .IR PACKETS " |" | |
109 | .br | |
110 | .B name | |
111 | .IR NEWNAME " |" | |
112 | .br | |
113 | .B address | |
114 | .IR LLADDR " |" | |
115 | .B broadcast | |
116 | .IR LLADDR " |" | |
117 | .br | |
118 | .B mtu | |
119 | .IR MTU " |" | |
120 | .br | |
121 | .B netns | |
122 | .IR PID " |" | |
123 | .br | |
124 | .B netns | |
125 | .IR NETNSNAME " |" | |
126 | .br | |
127 | .B alias | |
128 | .IR NAME " |" | |
129 | .br | |
130 | .B vf | |
131 | .IR NUM " [" | |
132 | .B mac | |
133 | .IR LLADDR " ] [" | |
134 | .B vlan | |
135 | .IR VLANID " [ " | |
136 | .B qos | |
137 | .IR VLAN-QOS " ] ] [" | |
138 | .B rate | |
139 | .IR TXRATE " ] [" | |
f89a2a05 SC |
140 | .B max_tx_rate |
141 | .IR TXRATE " ] [" | |
142 | .B min_tx_rate | |
143 | .IR TXRATE " ] [" | |
63f60e3a OG |
144 | .B spoofchk { on | off } ] [ |
145 | .B state { auto | enable | disable} | |
761a1e60 CT |
146 | ] | |
147 | .br | |
148 | .B master | |
503aa4e2 | 149 | .IR DEVICE " |" |
761a1e60 | 150 | .br |
503aa4e2 PŠ |
151 | .B nomaster " |" |
152 | .br | |
8f0777a8 | 153 | .B addrgenmode { eui64 | none | stable_secret | random } |
503aa4e2 PŠ |
154 | .br |
155 | .B link-netnsid ID | |
761a1e60 CT |
156 | .BR " }" |
157 | ||
158 | ||
159 | .ti -8 | |
160 | .B ip link show | |
161 | .RI "[ " DEVICE " | " | |
162 | .B group | |
1b944148 VK |
163 | .IR GROUP " | " |
164 | .BR up " | " | |
165 | .B master | |
712249d8 VK |
166 | .IR DEVICE " | " |
167 | .B type | |
168 | .IR TYPE " ]" | |
761a1e60 | 169 | |
1f299e92 | 170 | .ti -8 |
171 | .B ip link help | |
172 | .RI "[ " TYPE " ]" | |
173 | ||
761a1e60 CT |
174 | .SH "DESCRIPTION" |
175 | .SS ip link add - add virtual link | |
176 | ||
177 | .TP | |
178 | .BI link " DEVICE " | |
179 | specifies the physical device to act operate on. | |
180 | ||
181 | .I NAME | |
182 | specifies the name of the new virtual device. | |
183 | ||
184 | .I TYPE | |
185 | specifies the type of the new device. | |
186 | .sp | |
187 | Link types: | |
188 | ||
189 | .in +8 | |
f1a6f4e9 SH |
190 | .B bridge |
191 | - Ethernet Bridge device | |
761a1e60 | 192 | .sp |
cc26a890 JP |
193 | .B bond |
194 | - Bonding device | |
503aa4e2 PŠ |
195 | .B can |
196 | - Controller Area Network interface | |
cc26a890 | 197 | .sp |
761a1e60 CT |
198 | .B dummy |
199 | - Dummy network interface | |
200 | .sp | |
2f937359 | 201 | .B hsr |
202 | - High-availability Seamless Redundancy device | |
203 | .sp | |
761a1e60 CT |
204 | .B ifb |
205 | - Intermediate Functional Block device | |
206 | .sp | |
f1a6f4e9 SH |
207 | .B ipoib |
208 | - IP over Infiniband device | |
209 | .sp | |
761a1e60 | 210 | .B macvlan |
f1a6f4e9 | 211 | - Virtual interface base on link layer address (MAC) |
761a1e60 | 212 | .sp |
e4c35682 RR |
213 | .B macvtap |
214 | - Virtual interface based on link layer address (MAC) and TAP. | |
215 | .sp | |
f1a6f4e9 | 216 | .B vcan |
2b70fe15 | 217 | - Virtual Controller Area Network interface |
761a1e60 | 218 | .sp |
f1a6f4e9 SH |
219 | .B veth |
220 | - Virtual ethernet interface | |
de038993 | 221 | .sp |
f1a6f4e9 SH |
222 | .BR vlan |
223 | - 802.1q tagged virtual LAN interface | |
224 | .sp | |
225 | .BR vxlan | |
226 | - Virtual eXtended LAN | |
77987911 ND |
227 | .sp |
228 | .BR ip6tnl | |
229 | - Virtual tunnel interface IPv4|IPv6 over IPv6 | |
230 | .sp | |
231 | .BR ipip | |
232 | - Virtual tunnel interface IPv4 over IPv4 | |
233 | .sp | |
234 | .BR sit | |
235 | - Virtual tunnel interface IPv6 over IPv4 | |
9abde37c | 236 | .sp |
237 | .BR gre | |
238 | - Virtual tunnel interface GRE over IPv4 | |
239 | .sp | |
240 | .BR gretap | |
d36d9d41 | 241 | - Virtual L2 tunnel interface GRE over IPv4 |
9abde37c | 242 | .sp |
243 | .BR ip6gre | |
d36d9d41 | 244 | - Virtual tunnel interface GRE over IPv6 |
9abde37c | 245 | .sp |
246 | .BR ip6gretap | |
d36d9d41 | 247 | - Virtual L2 tunnel interface GRE over IPv6 |
b6d6b5a1 VK |
248 | .sp |
249 | .BR vti | |
250 | - Virtual tunnel interface | |
251 | .sp | |
252 | .BR nlmon | |
253 | - Netlink monitoring device | |
254 | .sp | |
255 | .BR ipvlan | |
256 | - Interface for L3 (IPv6/IPv4) based VLANs | |
2c0feda8 LB |
257 | .sp |
258 | .BR lowpan | |
259 | - Interface for 6LoWPAN (IPv6) over IEEE 802.15.4 / Bluetooth | |
c1a1d8bc JL |
260 | .sp |
261 | .BR geneve | |
262 | - GEneric NEtwork Virtualization Encapsulation | |
761a1e60 CT |
263 | .in -8 |
264 | ||
d992f3e6 JP |
265 | .TP |
266 | .BI numtxqueues " QUEUE_COUNT " | |
267 | specifies the number of transmit queues for new device. | |
268 | ||
269 | .TP | |
270 | .BI numrxqueues " QUEUE_COUNT " | |
271 | specifies the number of receive queues for new device. | |
272 | ||
4de8d885 PE |
273 | .TP |
274 | .BI index " IDX " | |
275 | specifies the desired index of the new virtual device. The link creation fails, if the index is busy. | |
276 | ||
503aa4e2 PŠ |
277 | .TP |
278 | VLAN Type Support | |
279 | For a link of type | |
280 | .I VLAN | |
281 | the following additional arguments are supported: | |
282 | ||
283 | .BI "ip link add | |
284 | .BI link " DEVICE " | |
285 | .BI name " NAME " | |
286 | .BI type " vlan " | |
287 | .R " [ " | |
288 | .BI protocol " VLAN_PROTO " | |
289 | .R " ] " | |
290 | .BI id " VLANID " | |
291 | .R " [ " | |
292 | .BR reorder_hdr " { " on " | " off " } " | |
293 | .R " ] " | |
294 | .R " [ " | |
295 | .BR gvrp " { " on " | " off " } " | |
296 | .R " ] " | |
297 | .R " [ " | |
298 | .BR mvrp " { " on " | " off " } " | |
299 | .R " ] " | |
300 | .R " [ " | |
301 | .BR loose_binding " { " on " | " off " } " | |
302 | .R " ] " | |
303 | .R " [ " | |
304 | .BI ingress-qos-map " QOS-MAP " | |
305 | .R " ] " | |
306 | .R " [ " | |
307 | .BI egress-qos-map " QOS-MAP " | |
308 | .R " ] " | |
309 | ||
310 | .in +8 | |
311 | .sp | |
312 | .BI protocol " VLAN_PROTO " | |
313 | - either 802.1Q or 802.1ad. | |
314 | ||
315 | .BI id " VLANID " | |
316 | - specifies the VLAN Identifer to use. Note that numbers with a leading " 0 " or " 0x " are interpreted as octal or hexadeimal, respectively. | |
317 | ||
318 | .BR reorder_hdr " { " on " | " off " } " | |
e612883c VK |
319 | - specifies whether ethernet headers are reordered or not (default is |
320 | .BR on ")." | |
321 | ||
322 | .in +4 | |
323 | If | |
324 | .BR reorder_hdr " is " on | |
325 | then VLAN header will be not inserted immediately but only before passing to the | |
326 | physical device (if this device does not support VLAN offloading), the similar | |
327 | on the RX direction - by default the packet will be untagged before being | |
328 | received by VLAN device. Reordering allows to accelerate tagging on egress and | |
329 | to hide VLAN header on ingress so the packet looks like regular Ethernet packet, | |
79c7078e | 330 | at the same time it might be confusing for packet capture as the VLAN header |
e612883c VK |
331 | does not exist within the packet. |
332 | ||
333 | VLAN offloading can be checked by | |
334 | .BR ethtool "(8):" | |
335 | .in +4 | |
336 | .sp | |
337 | .B ethtool -k | |
338 | <phy_dev> | | |
339 | .RB grep " tx-vlan-offload" | |
340 | .sp | |
341 | .in -4 | |
342 | where <phy_dev> is the physical device to which VLAN device is bound. | |
343 | .in -4 | |
503aa4e2 PŠ |
344 | |
345 | .BR gvrp " { " on " | " off " } " | |
346 | - specifies whether this VLAN should be registered using GARP VLAN Registration Protocol. | |
347 | ||
348 | .BR mvrp " { " on " | " off " } " | |
349 | - specifies whether this VLAN should be registered using Multiple VLAN Registration Protocol. | |
350 | ||
351 | .BR loose_binding " { " on " | " off " } " | |
352 | - specifies whether the VLAN device state is bound to the physical device state. | |
353 | ||
354 | .BI ingress-qos-map " QOS-MAP " | |
ab872442 VK |
355 | - defines a mapping of VLAN header prio field to the Linux internal packet |
356 | priority on incoming frames. The format is FROM:TO with multiple mappings | |
357 | separated by spaces. | |
503aa4e2 PŠ |
358 | |
359 | .BI egress-qos-map " QOS-MAP " | |
ab872442 VK |
360 | - defines a mapping of Linux internal packet priority to VLAN header prio field |
361 | but for outgoing frames. The format is the same as for ingress-qos-map. | |
362 | .in +4 | |
363 | ||
364 | Linux packet priority can be set by | |
365 | .BR iptables "(8)": | |
366 | .in +4 | |
367 | .sp | |
368 | .B iptables | |
369 | -t mangle -A POSTROUTING [...] -j CLASSIFY --set-class 0:4 | |
370 | .sp | |
371 | .in -4 | |
372 | and this "4" priority can be used in the egress qos mapping to set VLAN prio "5": | |
373 | .sp | |
374 | .in +4 | |
375 | .B ip | |
376 | link set veth0.10 type vlan egress 4:5 | |
377 | .in -4 | |
378 | .in -4 | |
503aa4e2 PŠ |
379 | .in -8 |
380 | ||
2816a568 TR |
381 | .TP |
382 | VXLAN Type Support | |
63f60e3a | 383 | For a link of type |
2816a568 TR |
384 | .I VXLAN |
385 | the following additional arguments are supported: | |
386 | ||
387 | .BI "ip link add " DEVICE | |
f66611d8 | 388 | .BI type " vxlan " id " ID" |
2816a568 TR |
389 | .R " [ " |
390 | .BI dev " PHYS_DEV " | |
7cfa3802 AW |
391 | .RB " ] [ { " group " | " remote " } " |
392 | .I IPADDR | |
2816a568 | 393 | .R " ] [ " |
5cd64c97 TF |
394 | .B local |
395 | .RI "{ "IPADDR " | "any " } " | |
2816a568 TR |
396 | .R " ] [ " |
397 | .BI ttl " TTL " | |
398 | .R " ] [ " | |
399 | .BI tos " TOS " | |
400 | .R " ] [ " | |
503aa4e2 PŠ |
401 | .BI dstport " PORT " |
402 | .R " ] [ " | |
403 | .BI srcport " MIN MAX " | |
2816a568 TR |
404 | .R " ] [ " |
405 | .I "[no]learning " | |
406 | .R " ] [ " | |
407 | .I "[no]proxy " | |
408 | .R " ] [ " | |
409 | .I "[no]rsc " | |
410 | .R " ] [ " | |
411 | .I "[no]l2miss " | |
412 | .R " ] [ " | |
413 | .I "[no]l3miss " | |
c2fbc57e | 414 | .R " ] [ " |
503aa4e2 PŠ |
415 | .I "[no]udpcsum " |
416 | .R " ] [ " | |
417 | .I "[no]udp6zerocsumtx " | |
418 | .R " ] [ " | |
419 | .I "[no]udp6zerocsumrx " | |
420 | .R " ] [ " | |
c2fbc57e ND |
421 | .BI ageing " SECONDS " |
422 | .R " ] [ " | |
423 | .BI maxaddress " NUMBER " | |
2eb90dc7 TG |
424 | .R " ] [ " |
425 | .B gbp | |
2816a568 TR |
426 | .R " ]" |
427 | ||
428 | .in +8 | |
429 | .sp | |
430 | .BI id " VNI " | |
431 | - specifies the VXLAN Network Identifer (or VXLAN Segment | |
432 | Identifier) to use. | |
433 | ||
434 | .BI dev " PHYS_DEV" | |
435 | - specifies the physical device to use for tunnel endpoint communication. | |
436 | ||
437 | .sp | |
438 | .BI group " IPADDR" | |
439 | - specifies the multicast IP address to join. | |
7cfa3802 AW |
440 | This parameter cannot be specified with the |
441 | .B remote | |
442 | parameter. | |
443 | ||
444 | .sp | |
445 | .BI remote " IPADDR" | |
446 | - specifies the unicast destination IP address to use in outgoing packets | |
447 | when the destination link layer address is not known in the VXLAN device | |
a89d5329 | 448 | forwarding database. This parameter cannot be specified with the |
7cfa3802 AW |
449 | .B group |
450 | parameter. | |
2816a568 TR |
451 | |
452 | .sp | |
453 | .BI local " IPADDR" | |
454 | - specifies the source IP address to use in outgoing packets. | |
455 | ||
456 | .sp | |
457 | .BI ttl " TTL" | |
458 | - specifies the TTL value to use in outgoing packets. | |
459 | ||
460 | .sp | |
461 | .BI tos " TOS" | |
462 | - specifies the TOS value to use in outgoing packets. | |
463 | ||
464 | .sp | |
503aa4e2 PŠ |
465 | .BI dstport " PORT" |
466 | - specifies the UDP destination port to communicate to the remote VXLAN tunnel endpoint. | |
467 | ||
468 | .sp | |
469 | .BI srcport " MIN MAX" | |
2816a568 TR |
470 | - specifies the range of port numbers to use as UDP |
471 | source ports to communicate to the remote VXLAN tunnel endpoint. | |
472 | ||
473 | .sp | |
474 | .I [no]learning | |
475 | - specifies if unknown source link layer addresses and IP addresses | |
476 | are entered into the VXLAN device forwarding database. | |
477 | ||
478 | .sp | |
479 | .I [no]rsc | |
480 | - specifies if route short circuit is turned on. | |
481 | ||
482 | .sp | |
483 | .I [no]proxy | |
484 | - specifies ARP proxy is turned on. | |
485 | ||
486 | .sp | |
487 | .I [no]l2miss | |
488 | - specifies if netlink LLADDR miss notifications are generated. | |
489 | ||
490 | .sp | |
491 | .I [no]l3miss | |
492 | - specifies if netlink IP ADDR miss notifications are generated. | |
493 | ||
503aa4e2 PŠ |
494 | .sp |
495 | .I [no]udpcsum | |
496 | - specifies if UDP checksum is filled in | |
497 | ||
498 | .sp | |
499 | .I [no]udp6zerocsumtx | |
500 | - specifies if UDP checksum is filled in | |
501 | ||
502 | .sp | |
503 | .I [no]udp6zerocsumrx | |
504 | - specifies if UDP checksum is received | |
505 | ||
c2fbc57e ND |
506 | .sp |
507 | .BI ageing " SECONDS" | |
508 | - specifies the lifetime in seconds of FDB entries learnt by the kernel. | |
509 | ||
510 | .sp | |
511 | .BI maxaddress " NUMBER" | |
512 | - specifies the maximum number of FDB entries. | |
513 | ||
2eb90dc7 TG |
514 | .sp |
515 | .B gbp | |
516 | - enables the Group Policy extension (VXLAN-GBP). | |
517 | ||
518 | .in +4 | |
519 | Allows to transport group policy context across VXLAN network peers. | |
520 | If enabled, includes the mark of a packet in the VXLAN header for outgoing | |
521 | packets and fills the packet mark based on the information found in the | |
522 | VXLAN header for incomming packets. | |
523 | ||
524 | Format of upper 16 bits of packet mark (flags); | |
525 | ||
526 | .in +2 | |
527 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
528 | .br | |
529 | |-|-|-|-|-|-|-|-|-|D|-|-|A|-|-|-| | |
530 | .br | |
531 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
532 | ||
533 | .B D := | |
534 | Don't Learn bit. When set, this bit indicates that the egress | |
535 | VTEP MUST NOT learn the source address of the encapsulated frame. | |
536 | ||
537 | .B A := | |
538 | Indicates that the group policy has already been applied to | |
539 | this packet. Policies MUST NOT be applied by devices when the A bit is set. | |
540 | .in -2 | |
541 | ||
542 | Format of lower 16 bits of packet mark (policy ID): | |
543 | ||
544 | .in +2 | |
545 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
546 | .br | |
547 | | Group Policy ID | | |
548 | .br | |
549 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
550 | .in -2 | |
551 | ||
552 | Example: | |
553 | iptables -A OUTPUT [...] -j MARK --set-mark 0x800FF | |
554 | ||
555 | .in -4 | |
556 | ||
2816a568 TR |
557 | .in -8 |
558 | ||
90f1df71 TH |
559 | .TP |
560 | GRE, IPIP, SIT Type Support | |
561 | For a link of types | |
562 | .I GRE/IPIP/SIT | |
563 | the following additional arguments are supported: | |
564 | ||
565 | .BI "ip link add " DEVICE | |
566 | .BR type " { gre | ipip | sit } " | |
567 | .BI " remote " ADDR " local " ADDR | |
568 | .R " [ " | |
569 | .BR encap " { fou | gue | none } " | |
570 | .R " ] [ " | |
571 | .BI "encap-sport { " PORT " | auto } " | |
572 | .R " ] [ " | |
573 | .BI "encap-dport " PORT | |
574 | .R " ] [ " | |
575 | .I " [no]encap-csum " | |
576 | .R " ] [ " | |
577 | .I " [no]encap-remcsum " | |
578 | .R " ]" | |
579 | ||
580 | .in +8 | |
581 | .sp | |
582 | .BI remote " ADDR " | |
583 | - specifies the remote address of the tunnel. | |
584 | ||
585 | .sp | |
586 | .BI local " ADDR " | |
587 | - specifies the fixed local address for tunneled packets. | |
588 | It must be an address on another interface on this host. | |
589 | ||
590 | .sp | |
591 | .BR encap " { fou | gue | none } " | |
592 | - specifies type of secondary UDP encapsulation. "fou" indicates | |
593 | Foo-Over-UDP, "gue" indicates Generic UDP Encapsulation. | |
594 | ||
595 | .sp | |
596 | .BI "encap-sport { " PORT " | auto } " | |
597 | - specifies the source port in UDP encapsulation. | |
598 | .IR PORT | |
599 | indicates the port by number, "auto" | |
600 | indicates that the port number should be chosen automatically | |
601 | (the kernel picks a flow based on the flow hash of the | |
602 | encapsulated packet). | |
603 | ||
604 | .sp | |
605 | .I [no]encap-csum | |
606 | - specifies if UDP checksums are enabled in the secondary | |
607 | encapsulation. | |
608 | ||
609 | .sp | |
610 | .I [no]encap-remcsum | |
611 | - specifies if Remote Checksum Offload is enabled. This is only | |
612 | applicable for Generic UDP Encapsulation. | |
613 | ||
614 | .in -8 | |
615 | ||
9abde37c | 616 | .TP |
617 | IP6GRE/IP6GRETAP Type Support | |
63f60e3a | 618 | For a link of type |
9abde37c | 619 | .I IP6GRE/IP6GRETAP |
620 | the following additional arguments are supported: | |
621 | ||
622 | .BI "ip link add " DEVICE | |
623 | .BI type " { ip6gre | ip6gretap } " remote " ADDR " local " ADDR | |
624 | .R " [ " | |
625 | .I "[i|o]seq]" | |
626 | .R " ] [ " | |
627 | .I "[i|o]key" KEY | |
628 | .R " ] [ " | |
629 | .I " [i|o]csum " | |
630 | .R " ] [ " | |
631 | .BI hoplimit " TTL " | |
632 | .R " ] [ " | |
633 | .BI encaplimit " ELIM " | |
634 | .R " ] [ " | |
635 | .BI tclass " TCLASS " | |
636 | .R " ] [ " | |
637 | .BI flowlabel " FLOWLABEL " | |
638 | .R " ] [ " | |
639 | .BI "dscp inherit" | |
640 | .R " ] [ " | |
641 | .BI dev " PHYS_DEV " | |
642 | .R " ]" | |
643 | ||
644 | .in +8 | |
645 | .sp | |
646 | .BI remote " ADDR " | |
647 | - specifies the remote IPv6 address of the tunnel. | |
648 | ||
649 | .sp | |
650 | .BI local " ADDR " | |
651 | - specifies the fixed local IPv6 address for tunneled packets. | |
90f1df71 | 652 | It must be an address on another interface on this host. |
9abde37c | 653 | |
654 | .sp | |
655 | .BI [i|o]seq | |
656 | - serialize packets. | |
657 | The | |
658 | .B oseq | |
659 | flag enables sequencing of outgoing packets. | |
660 | The | |
661 | .B iseq | |
662 | flag requires that all input packets are serialized. | |
663 | ||
664 | .sp | |
665 | .BI [i|o]key " KEY" | |
666 | - use keyed GRE with key | |
667 | .IR KEY ". "KEY | |
668 | is either a number or an IPv4 address-like dotted quad. | |
669 | The | |
670 | .B key | |
671 | parameter specifies the same key to use in both directions. | |
672 | The | |
673 | .BR ikey " and " okey | |
674 | parameters specify different keys for input and output. | |
675 | ||
676 | .sp | |
677 | .BI [i|o]csum | |
678 | - generate/require checksums for tunneled packets. | |
679 | The | |
680 | .B ocsum | |
681 | flag calculates checksums for outgoing packets. | |
682 | The | |
683 | .B icsum | |
684 | flag requires that all input packets have the correct | |
a89d5329 | 685 | checksum. The |
9abde37c | 686 | .B csum |
687 | flag is equivalent to the combination | |
688 | .BR "icsum ocsum" . | |
689 | ||
690 | .sp | |
691 | .BI hoplimit " TTL" | |
692 | - specifies Hop Limit value to use in outgoing packets. | |
693 | ||
694 | .sp | |
695 | .BI encaplimit " ELIM" | |
a89d5329 | 696 | - specifies a fixed encapsulation limit. Default is 4. |
9abde37c | 697 | |
698 | .sp | |
699 | .BI flowlabel " FLOWLABEL" | |
63f60e3a | 700 | - specifies a fixed flowlabel. |
9abde37c | 701 | |
702 | .sp | |
703 | .BI tclass " TCLASS" | |
704 | - specifies the traffic class field on | |
705 | tunneled packets, which can be specified as either a two-digit | |
706 | hex value (e.g. c0) or a predefined string (e.g. internet). | |
707 | The value | |
708 | .B inherit | |
709 | causes the field to be copied from the original IP header. The | |
710 | values | |
711 | .BI "inherit/" STRING | |
712 | or | |
713 | .BI "inherit/" 00 ".." ff | |
714 | will set the field to | |
715 | .I STRING | |
716 | or | |
717 | .IR 00 ".." ff | |
718 | when tunneling non-IP packets. The default value is 00. | |
719 | ||
720 | .in -8 | |
721 | ||
8ca8fac7 OG |
722 | .TP |
723 | IPoIB Type Support | |
724 | For a link of type | |
725 | .I IPoIB | |
726 | the following additional arguments are supported: | |
727 | ||
728 | .BI "ip link add " DEVICE " name " NAME | |
729 | .BI type " ipoib [ " pkey " PKEY ] [" mode " MODE " ] | |
730 | ||
731 | .in +8 | |
732 | .sp | |
733 | .BI pkey " PKEY " | |
734 | - specifies the IB P-Key to use. | |
735 | ||
736 | .BI mode " MODE " | |
737 | - specifies the mode (datagram or connected) to use. | |
738 | ||
c1a1d8bc JL |
739 | .TP |
740 | GENEVE Type Support | |
741 | For a link of type | |
742 | .I GENEVE | |
743 | the following additional arguments are supported: | |
744 | ||
745 | .BI "ip link add " DEVICE | |
746 | .BI type " geneve " id " ID " remote " IPADDR" | |
f4c05c2e JL |
747 | .R " [ " |
748 | .BI ttl " TTL " | |
f4739b2e JL |
749 | .R " ] [ " |
750 | .BI tos " TOS " | |
f4c05c2e | 751 | .R " ]" |
c1a1d8bc JL |
752 | |
753 | .in +8 | |
754 | .sp | |
755 | .BI id " VNI " | |
756 | - specifies the Virtual Network Identifer to use. | |
757 | ||
758 | .sp | |
759 | .BI remote " IPADDR" | |
760 | - specifies the unicast destination IP address to use in outgoing packets. | |
761 | ||
f4c05c2e JL |
762 | .sp |
763 | .BI ttl " TTL" | |
764 | - specifies the TTL value to use in outgoing packets. | |
765 | ||
f4739b2e JL |
766 | .sp |
767 | .BI tos " TOS" | |
768 | - specifies the TOS value to use in outgoing packets. | |
769 | ||
c1a1d8bc JL |
770 | .in -8 |
771 | ||
a60223bc PS |
772 | .TP |
773 | MACVLAN and MACVTAP Type Support | |
774 | For a link of type | |
775 | .I MACVLAN | |
776 | or | |
777 | .I MACVTAP | |
778 | the following additional arguments are supported: | |
779 | ||
780 | .BI "ip link add link " DEVICE " name " NAME | |
781 | .BR type " { " macvlan " | " macvtap " } " | |
782 | .BR mode " { " private " | " vepa " | " bridge " | " passthru | |
783 | .BR " [ " nopromisc " ] } " | |
784 | ||
785 | .in +8 | |
786 | .sp | |
787 | .BR type " { " macvlan " | " macvtap " } " | |
788 | - specifies the link type to use. | |
789 | .BR macvlan " creates just a virtual interface, while " | |
790 | .BR macvtap " in addition creates a character device " | |
791 | .BR /dev/tapX " to be used just like a " tuntap " device." | |
792 | ||
793 | .B mode private | |
794 | - Do not allow communication between | |
795 | .B macvlan | |
796 | instances on the same physical interface, even if the external switch supports | |
797 | hairpin mode. | |
798 | ||
799 | .B mode vepa | |
800 | - Virtual Ethernet Port Aggregator mode. Data from one | |
801 | .B macvlan | |
802 | instance to the other on the same physical interface is transmitted over the | |
803 | physical interface. Either the attached switch needs to support hairpin mode, | |
804 | or there must be a TCP/IP router forwarding the packets in order to allow | |
805 | communication. This is the default mode. | |
806 | ||
807 | .B mode bridge | |
808 | - In bridge mode, all endpoints are directly connected to each other, | |
809 | communication is not redirected through the physical interface's peer. | |
810 | ||
811 | .BR mode " " passthru " [ " nopromisc " ] " | |
812 | - This mode gives more power to a single endpoint, usually in | |
813 | .BR macvtap " mode. It is not allowed for more than one endpoint on the same " | |
814 | physical interface. All traffic will be forwarded to this endpoint, allowing | |
815 | virtio guests to change MAC address or set promiscuous mode in order to bridge | |
816 | the interface or create vlan interfaces on top of it. By default, this mode | |
817 | forces the underlying interface into promiscuous mode. Passing the | |
818 | .BR nopromisc " flag prevents this, so the promisc flag may be controlled " | |
819 | using standard tools. | |
820 | .in -8 | |
821 | ||
761a1e60 | 822 | .SS ip link delete - delete virtual link |
761a1e60 CT |
823 | |
824 | .TP | |
825 | .BI dev " DEVICE " | |
7f74cf6d VK |
826 | specifies the virtual device to act operate on. |
827 | ||
828 | .TP | |
829 | .BI group " GROUP " | |
830 | specifies the group of virtual links to delete. Group 0 is not allowed to be | |
831 | deleted since it is the default group. | |
832 | ||
833 | .TP | |
834 | .BI type " TYPE " | |
835 | specifies the type of the device. | |
761a1e60 CT |
836 | |
837 | .SS ip link set - change device attributes | |
838 | ||
839 | .TP | |
840 | .BI dev " DEVICE " | |
841 | .I DEVICE | |
6274b0b7 | 842 | specifies network device to operate on. When configuring SR-IOV Virtual Function |
761a1e60 CT |
843 | (VF) devices, this keyword should specify the associated Physical Function (PF) |
844 | device. | |
845 | ||
846 | .TP | |
847 | .BI group " GROUP " | |
848 | .I GROUP | |
849 | has a dual role: If both group and dev are present, then move the device to the | |
a89d5329 | 850 | specified group. If only a group is specified, then the command operates on |
761a1e60 CT |
851 | all devices in that group. |
852 | ||
853 | .TP | |
854 | .BR up " and " down | |
855 | change the state of the device to | |
856 | .B UP | |
857 | or | |
858 | .BR "DOWN" . | |
859 | ||
860 | .TP | |
861 | .BR "arp on " or " arp off" | |
862 | change the | |
863 | .B NOARP | |
864 | flag on the device. | |
865 | ||
866 | .TP | |
867 | .BR "multicast on " or " multicast off" | |
868 | change the | |
869 | .B MULTICAST | |
870 | flag on the device. | |
871 | ||
18864827 AK |
872 | .TP |
873 | .BR "protodown on " or " protodown off" | |
874 | change the | |
875 | .B PROTODOWN | |
876 | state on the device. Indicates that a protocol error has been detected on the port. Switch drivers can react to this error by doing a phys down on the switch port. | |
877 | ||
761a1e60 CT |
878 | .TP |
879 | .BR "dynamic on " or " dynamic off" | |
880 | change the | |
881 | .B DYNAMIC | |
34c8a95c VK |
882 | flag on the device. Indicates that address can change when interface goes down (currently |
883 | .B NOT | |
884 | used by the Linux). | |
761a1e60 CT |
885 | |
886 | .TP | |
887 | .BI name " NAME" | |
a89d5329 | 888 | change the name of the device. This operation is not |
761a1e60 CT |
889 | recommended if the device is running or has some addresses |
890 | already configured. | |
891 | ||
892 | .TP | |
893 | .BI txqueuelen " NUMBER" | |
894 | .TP | |
895 | .BI txqlen " NUMBER" | |
896 | change the transmit queue length of the device. | |
897 | ||
898 | .TP | |
899 | .BI mtu " NUMBER" | |
900 | change the | |
901 | .I MTU | |
902 | of the device. | |
903 | ||
904 | .TP | |
905 | .BI address " LLADDRESS" | |
906 | change the station address of the interface. | |
907 | ||
908 | .TP | |
909 | .BI broadcast " LLADDRESS" | |
910 | .TP | |
911 | .BI brd " LLADDRESS" | |
912 | .TP | |
913 | .BI peer " LLADDRESS" | |
914 | change the link layer broadcast address or the peer address when | |
915 | the interface is | |
916 | .IR "POINTOPOINT" . | |
917 | ||
918 | .TP | |
36324eba | 919 | .BI netns " NETNSNAME " \fR| " PID" |
761a1e60 | 920 | move the device to the network namespace associated with name |
36324eba VK |
921 | .IR "NETNSNAME " or |
922 | .RI process " PID". | |
923 | ||
924 | Some devices are not allowed to change network namespace: loopback, bridge, | |
925 | ppp, wireless. These are network namespace local devices. In such case | |
926 | .B ip | |
927 | tool will return "Invalid argument" error. It is possible to find out if device is local | |
928 | to a single network namespace by checking | |
929 | .B netns-local | |
930 | flag in the output of the | |
931 | .BR ethtool ":" | |
932 | ||
933 | .in +8 | |
934 | .B ethtool -k | |
935 | .I DEVICE | |
936 | .in -8 | |
937 | ||
938 | To change network namespace for wireless devices the | |
939 | .B iw | |
940 | tool can be used. But it allows to change network namespace only for physical devices and by process | |
941 | .IR PID . | |
761a1e60 CT |
942 | |
943 | .TP | |
944 | .BI alias " NAME" | |
945 | give the device a symbolic name for easy reference. | |
946 | ||
503aa4e2 PŠ |
947 | .TP |
948 | .BI group " GROUP" | |
949 | specify the group the device belongs to. | |
950 | The available groups are listed in file | |
951 | .BR "@SYSCONFDIR@/group" . | |
952 | ||
761a1e60 CT |
953 | .TP |
954 | .BI vf " NUM" | |
955 | specify a Virtual Function device to be configured. The associated PF device | |
956 | must be specified using the | |
957 | .B dev | |
958 | parameter. | |
959 | ||
960 | .in +8 | |
961 | .BI mac " LLADDRESS" | |
962 | - change the station address for the specified VF. The | |
963 | .B vf | |
964 | parameter must be specified. | |
965 | ||
966 | .sp | |
967 | .BI vlan " VLANID" | |
968 | - change the assigned VLAN for the specified VF. When specified, all traffic | |
969 | sent from the VF will be tagged with the specified VLAN ID. Incoming traffic | |
970 | will be filtered for the specified VLAN ID, and will have all VLAN tags | |
971 | stripped before being passed to the VF. Setting this parameter to 0 disables | |
972 | VLAN tagging and filtering. The | |
973 | .B vf | |
974 | parameter must be specified. | |
975 | ||
976 | .sp | |
977 | .BI qos " VLAN-QOS" | |
978 | - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN | |
979 | tags transmitted by the VF will include the specified priority bits in the | |
980 | VLAN tag. If not specified, the value is assumed to be 0. Both the | |
981 | .B vf | |
982 | and | |
983 | .B vlan | |
984 | parameters must be specified. Setting both | |
985 | .B vlan | |
986 | and | |
987 | .B qos | |
988 | as 0 disables VLAN tagging and filtering for the VF. | |
989 | ||
990 | .sp | |
991 | .BI rate " TXRATE" | |
f89a2a05 SC |
992 | -- change the allowed transmit bandwidth, in Mbps, for the specified VF. |
993 | Setting this parameter to 0 disables rate limiting. | |
994 | .B vf | |
995 | parameter must be specified. | |
996 | Please use new API | |
997 | .B "max_tx_rate" | |
998 | option instead. | |
999 | ||
1000 | .sp | |
1001 | .BI max_tx_rate " TXRATE" | |
1002 | - change the allowed maximum transmit bandwidth, in Mbps, for the specified VF. | |
1003 | .B vf | |
1004 | parameter must be specified. | |
1005 | ||
1006 | .sp | |
1007 | .BI min_tx_rate " TXRATE" | |
1008 | - change the allowed minimum transmit bandwidth, in Mbps, for the specified VF. | |
1009 | Minimum TXRATE should be always <= Maximum TXRATE. | |
761a1e60 CT |
1010 | .B vf |
1011 | parameter must be specified. | |
1012 | ||
1013 | .sp | |
1014 | .BI spoofchk " on|off" | |
1015 | - turn packet spoof checking on or off for the specified VF. | |
63f60e3a OG |
1016 | .sp |
1017 | .BI state " auto|enable|disable" | |
1018 | - set the virtual link state as seen by the specified VF. Setting to auto means a | |
1019 | reflection of the PF link state, enable lets the VF to communicate with other VFs on | |
1020 | this host even if the PF link state is down, disable causes the HW to drop any packets | |
1021 | sent by the VF. | |
761a1e60 CT |
1022 | .in -8 |
1023 | ||
1024 | .TP | |
1025 | .BI master " DEVICE" | |
1026 | set master device of the device (enslave device). | |
1027 | ||
1028 | .TP | |
1029 | .BI nomaster | |
1030 | unset master device of the device (release device). | |
1031 | ||
503aa4e2 | 1032 | .TP |
8f0777a8 BM |
1033 | .BI addrgenmode " eui64|none|stable_secret|random" |
1034 | set the IPv6 address generation mode | |
1035 | ||
1036 | .I eui64 | |
1037 | - use a Modified EUI-64 format interface identifier | |
1038 | ||
1039 | .I none | |
1040 | - disable automatic address generation | |
1041 | ||
1042 | .I stable_secret | |
1043 | - generate the interface identifier based on a preset /proc/sys/net/ipv6/conf/{default,DEVICE}/stable_secret | |
1044 | ||
1045 | .I random | |
1046 | - like stable_secret, but auto-generate a new random secret if none is set | |
503aa4e2 PŠ |
1047 | |
1048 | .TP | |
1049 | .BR "link-netnsid " | |
1050 | set peer netnsid for a cross-netns interface | |
1051 | ||
761a1e60 CT |
1052 | .PP |
1053 | .B Warning: | |
1054 | If multiple parameter changes are requested, | |
1055 | .B ip | |
1056 | aborts immediately after any of the changes have failed. | |
1057 | This is the only case when | |
1058 | .B ip | |
a89d5329 | 1059 | can move the system to an unpredictable state. The solution |
761a1e60 CT |
1060 | is to avoid changing several parameters with one |
1061 | .B ip link set | |
1062 | call. | |
1063 | ||
1064 | .SS ip link show - display device attributes | |
1065 | ||
1066 | .TP | |
1067 | .BI dev " NAME " (default) | |
1068 | .I NAME | |
1069 | specifies the network device to show. | |
1070 | If this argument is omitted all devices in the default group are listed. | |
1071 | ||
1072 | .TP | |
1073 | .BI group " GROUP " | |
1074 | .I GROUP | |
1075 | specifies what group of devices to show. | |
1076 | ||
1077 | .TP | |
1078 | .B up | |
1079 | only display running interfaces. | |
1080 | ||
1b944148 VK |
1081 | .TP |
1082 | .BI master " DEVICE " | |
1083 | .I DEVICE | |
1084 | specifies the master device which enslaves devices to show. | |
1085 | ||
712249d8 VK |
1086 | .TP |
1087 | .BI type " TYPE " | |
1088 | .I TYPE | |
1089 | specifies the type of devices to show. | |
1090 | ||
8322d28d | 1091 | .TP |
1e264abc SH |
1092 | The show command has additional formatting options: |
1093 | ||
8322d28d | 1094 | .RS |
1e264abc SH |
1095 | .TP |
1096 | .BR "\-s" , " \-stats", " \-statistics" | |
1097 | output more statistics about packet usage. | |
1098 | ||
1099 | .TP | |
1100 | .BR "\-d", " \-details" | |
1101 | output more detailed information. | |
1102 | ||
1103 | .TP | |
e52f3ef7 | 1104 | .BR "\-h", " \-human", " \-human-readable" |
1e264abc SH |
1105 | output statistics with human readable values number followed by suffix |
1106 | ||
1107 | .TP | |
1108 | .BR "\-iec" | |
1109 | print human readable rates in IEC units (ie. 1K = 1024). | |
8322d28d | 1110 | .RE |
b68d9837 | 1111 | |
1f299e92 | 1112 | .SS ip link help - display help |
1113 | ||
1114 | .PP | |
1115 | .I "TYPE" | |
1116 | specifies which help of link type to dislpay. | |
1117 | ||
032b4f4d VK |
1118 | .SS |
1119 | .I GROUP | |
1120 | may be a number or a string from the file | |
699589f6 | 1121 | .B @SYSCONFDIR@/group |
032b4f4d VK |
1122 | which can be manually filled. |
1123 | ||
761a1e60 CT |
1124 | .SH "EXAMPLES" |
1125 | .PP | |
1126 | ip link show | |
1127 | .RS 4 | |
1128 | Shows the state of all network interfaces on the system. | |
1129 | .RE | |
1130 | .PP | |
712249d8 VK |
1131 | ip link show type bridge |
1132 | .RS 4 | |
1133 | Shows the bridge devices. | |
1134 | .RE | |
1135 | .PP | |
1136 | ip link show type vlan | |
1137 | .RS 4 | |
1138 | Shows the vlan devices. | |
1139 | .RE | |
1140 | .PP | |
417b2180 VK |
1141 | ip link show master br0 |
1142 | .RS 4 | |
1143 | Shows devices enslaved by br0 | |
1144 | .RE | |
1145 | .PP | |
761a1e60 CT |
1146 | ip link set dev ppp0 mtu 1400 |
1147 | .RS 4 | |
1148 | Change the MTU the ppp0 device. | |
1149 | .RE | |
1150 | .PP | |
1151 | ip link add link eth0 name eth0.10 type vlan id 10 | |
1152 | .RS 4 | |
1153 | Creates a new vlan device eth0.10 on device eth0. | |
1154 | .RE | |
1155 | .PP | |
1156 | ip link delete dev eth0.10 | |
1157 | .RS 4 | |
1158 | Removes vlan device. | |
1159 | .RE | |
1160 | ||
1f299e92 | 1161 | ip link help gre |
1162 | .RS 4 | |
1163 | Display help for the gre link type. | |
90f1df71 TH |
1164 | .RE |
1165 | .PP | |
1166 | ip link add name tun1 type ipip remote 192.168.1.1 | |
1167 | local 192.168.1.2 ttl 225 encap gue encap-sport auto | |
1168 | encap-dport 5555 encap-csum encap-remcsum | |
1169 | .RS 4 | |
1170 | Creates an IPIP that is encapsulated with Generic UDP Encapsulation, | |
1171 | and the outer UDP checksum and remote checksum offload are enabled. | |
1172 | ||
2c0feda8 LB |
1173 | .RE |
1174 | .PP | |
1175 | ip link add link wpan0 lowpan0 type lowpan | |
1176 | .RS 4 | |
1177 | Creates a 6LoWPAN interface named lowpan0 on the underlying | |
1178 | IEEE 802.15.4 device wpan0. | |
1f299e92 | 1179 | .RE |
1180 | ||
761a1e60 CT |
1181 | .SH SEE ALSO |
1182 | .br | |
d5910297 | 1183 | .BR ip (8), |
e612883c | 1184 | .BR ip-netns (8), |
ab872442 VK |
1185 | .BR ethtool (8), |
1186 | .BR iptables (8) | |
761a1e60 CT |
1187 | |
1188 | .SH AUTHOR | |
1189 | Original Manpage by Michail Litvak <mci@owl.openwall.com> |