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