]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blob - man/man8/ip.8
a20eca7b43a26f8d4de3915709b937088bd873da
[lisovros/iproute2_canprio.git] / man / man8 / ip.8
1 .TH IP 8 "17 January 2002" "iproute2" "Linux"
2 .SH NAME
3 ip \- show / manipulate routing, devices, policy routing and tunnels
4 .SH SYNOPSIS
5
6 .ad l
7 .in +8
8 .ti -8
9 .B ip
10 .RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
11 .BR help " }"
12 .sp
13
14 .ti -8
15 .IR OBJECT " := { "
16 .BR link " | " addr " | " addrlabel " | " route " | " rule " | " neigh " | "\
17  tunnel " | " maddr " | "  mroute " }"
18 .sp
19
20 .ti -8
21 .IR OPTIONS " := { "
22 \fB\-V\fR[\fIersion\fR] |
23 \fB\-s\fR[\fItatistics\fR] |
24 \fB\-r\fR[\fIesolve\fR] |
25 \fB\-f\fR[\fIamily\fR] {
26 .BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | "
27 \fB\-o\fR[\fIneline\fR] }
28
29 .ti -8
30 .BI "ip link add link " DEVICE
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 " ]"
44 .br
45 .BR type " TYPE"
46 .RI "[ " ARGS " ]"
47
48 .ti -8
49 .IR TYPE " := [ "
50 .BR vlan " | " veth " | " vcan " | " dummy " | " ifb " | " macvlan " | " can " | " bridge ]"
51
52 .ti -8
53 .BI "ip link delete " DEVICE
54 .BI type " TYPE"
55 .RI "[ " ARGS " ]"
56
57 .ti -8
58 .BR "ip link set " {
59 .IR DEVICE " | "
60 .BI "group " GROUP
61 .RB "} { " up " | " down " | " arp " { " on " | " off " } |"
62 .br
63 .BR promisc " { " on " | " off " } |"
64 .br
65 .BR allmulticast " { " on " | " off " } |"
66 .br
67 .BR dynamic " { " on " | " off " } |"
68 .br
69 .BR multicast " { " on " | " off " } |"
70 .br
71 .B  txqueuelen
72 .IR PACKETS " |"
73 .br
74 .B  name
75 .IR NEWNAME " |"
76 .br
77 .B  address
78 .IR LLADDR " |"
79 .B  broadcast
80 .IR LLADDR " |"
81 .br
82 .B  mtu
83 .IR MTU " |"
84 .br
85 .B  netns
86 .IR PID " |"
87 .br
88 .B  netns
89 .IR NETNSNAME " |"
90 .br
91 .B alias
92 .IR NAME  " |"
93 .br
94 .B vf
95 .IR NUM " ["
96 .B  mac
97 .IR LLADDR " ] ["
98 .B vlan
99 .IR VLANID " [ "
100 .B qos
101 .IR VLAN-QOS " ] ] ["
102 .B rate
103 .IR TXRATE " ] ["
104 .B spoofchk { on | off }
105 ] |
106 .br
107 .B master
108 .IR DEVICE
109 .br
110 .B nomaster
111 .BR " }"
112
113
114 .ti -8
115 .B ip link show
116 .RI "[ " DEVICE " | "
117 .B group
118 .IR GROUP " ]"
119
120 .ti -8
121 .BR "ip addr" " { " add " | " del " } "
122 .IB IFADDR " dev " STRING
123
124 .ti -8
125 .BR "ip addr" " { " show " | " flush " } [ " dev
126 .IR STRING " ] [ "
127 .B  scope
128 .IR SCOPE-ID " ] [ "
129 .B  to
130 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
131 .B  label
132 .IR PATTERN " ]"
133
134 .ti -8
135 .IR IFADDR " := " PREFIX " | " ADDR
136 .B  peer
137 .IR PREFIX " [ "
138 .B  broadcast
139 .IR ADDR " ] [ "
140 .B  anycast
141 .IR ADDR " ] [ "
142 .B  label
143 .IR STRING " ] [ "
144 .B  scope
145 .IR SCOPE-ID " ]"
146
147 .ti -8
148 .IR SCOPE-ID " := "
149 .RB "[ " host " | " link " | " global " | "
150 .IR NUMBER " ]"
151
152 .ti -8
153 .IR FLAG-LIST " := [ "  FLAG-LIST " ] " FLAG
154
155 .ti -8
156 .IR FLAG " := "
157 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
158 tentative " | " deprecated " | " dadfailed " | " temporary " ]"
159
160 .ti -8
161 .BR "ip addrlabel" " { " add " | " del " } " prefix
162 .BR PREFIX " [ "
163 .B dev
164 .IR DEV " ] [ "
165 .B label
166 .IR NUMBER " ]"
167
168 .ti -8
169 .BR "ip addrlabel" " { " list " | " flush " }"
170
171 .ti -8
172 .BR "ip netns" " { " list " } "
173
174 .ti -8
175 .BR "ip netns" " { " add " | " delete " } "
176 .I NETNSNAME
177
178 .ti -8
179 .BR "ip netns exec "
180 .I NETNSNAME command ...
181
182 .ti -8
183 .BR "ip route" " { "
184 .BR list " | " flush " } "
185 .I  SELECTOR
186
187 .ti -8
188 .BR "ip route save"
189 .I SELECTOR
190
191 .ti -8
192 .BR "ip route restore"
193
194 .ti -8
195 .B  ip route get
196 .IR ADDRESS " [ "
197 .BI from " ADDRESS " iif " STRING"
198 .RB " ] [ " oif
199 .IR STRING " ] [ "
200 .B  tos
201 .IR TOS " ]"
202
203 .ti -8
204 .BR "ip route" " { " add " | " del " | " change " | " append " | "\
205 replace " } "
206 .I  ROUTE
207
208 .ti -8
209 .IR SELECTOR " := "
210 .RB "[ " root
211 .IR PREFIX " ] [ "
212 .B  match
213 .IR PREFIX " ] [ "
214 .B  exact
215 .IR PREFIX " ] [ "
216 .B  table
217 .IR TABLE_ID " ] [ "
218 .B  proto
219 .IR RTPROTO " ] [ "
220 .B  type
221 .IR TYPE " ] [ "
222 .B  scope
223 .IR SCOPE " ]"
224
225 .ti -8
226 .IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]"
227
228 .ti -8
229 .IR NODE_SPEC " := [ " TYPE " ] " PREFIX " ["
230 .B  tos
231 .IR TOS " ] [ "
232 .B  table
233 .IR TABLE_ID " ] [ "
234 .B  proto
235 .IR RTPROTO " ] [ "
236 .B  scope
237 .IR SCOPE " ] [ "
238 .B  metric
239 .IR METRIC " ]"
240
241 .ti -8
242 .IR INFO_SPEC " := " "NH OPTIONS FLAGS" " ["
243 .B  nexthop
244 .IR NH " ] ..."
245
246 .ti -8
247 .IR NH " := [ "
248 .B  via
249 .IR ADDRESS " ] [ "
250 .B  dev
251 .IR STRING " ] [ "
252 .B  weight
253 .IR NUMBER " ] " NHFLAGS
254
255 .ti -8
256 .IR OPTIONS " := " FLAGS " [ "
257 .B  mtu
258 .IR NUMBER " ] [ "
259 .B  advmss
260 .IR NUMBER " ] [ "
261 .B  rtt
262 .IR TIME " ] [ "
263 .B  rttvar
264 .IR TIME " ] [ "
265 .B  window
266 .IR NUMBER " ] [ "
267 .B  cwnd
268 .IR NUMBER " ] [ "
269 .B  ssthresh
270 .IR REALM " ] [ "
271 .B  realms
272 .IR REALM " ] [ "
273 .B  rto_min
274 .IR TIME " ] [ "
275 .B  initcwnd
276 .IR NUMBER " ] [ "
277 .B  initrwnd
278 .IR NUMBER " ]"
279
280 .ti -8
281 .IR TYPE " := [ "
282 .BR unicast " | " local " | " broadcast " | " multicast " | "\
283 throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]"
284
285 .ti -8
286 .IR TABLE_ID " := [ "
287 .BR local "| " main " | " default " | " all " |"
288 .IR NUMBER " ]"
289
290 .ti -8
291 .IR SCOPE " := [ "
292 .BR host " | " link " | " global " |"
293 .IR NUMBER " ]"
294
295 .ti -8
296 .IR NHFLAGS " := [ "
297 .BR onlink " | " pervasive " ]"
298
299 .ti -8
300 .IR RTPROTO " := [ "
301 .BR kernel " | " boot " | " static " |"
302 .IR NUMBER " ]"
303
304 .ti -8
305 .B  ip rule
306 .RB " [ " list " | " add " | " del " | " flush " ]"
307 .I  SELECTOR ACTION
308
309 .ti -8
310 .IR SELECTOR " := [ "
311 .B  from
312 .IR PREFIX " ] [ "
313 .B  to
314 .IR PREFIX " ] [ "
315 .B  tos
316 .IR TOS " ] [ "
317 .B  fwmark
318 .IR FWMARK[/MASK] " ] [ "
319 .B  iif
320 .IR STRING " ] [ "
321 .B  oif
322 .IR STRING " ] [ "
323 .B  pref
324 .IR NUMBER " ]"
325
326 .ti -8
327 .IR ACTION " := [ "
328 .B  table
329 .IR TABLE_ID " ] [ "
330 .B  nat
331 .IR ADDRESS " ] [ "
332 .BR prohibit " | " reject " | " unreachable " ] [ " realms
333 .RI "[" SRCREALM "/]" DSTREALM " ]"
334
335 .ti -8
336 .IR TABLE_ID " := [ "
337 .BR local " | " main " | " default " |"
338 .IR NUMBER " ]"
339
340 .ti -8
341 .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
342 .IR ADDR " [ "
343 .B  lladdr
344 .IR LLADDR " ] [ "
345 .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
346 .IR ADDR " } [ "
347 .B  dev
348 .IR DEV " ]"
349
350 .ti -8
351 .BR "ip neigh" " { " show " | " flush " } [ " to
352 .IR PREFIX " ] [ "
353 .B  dev
354 .IR DEV " ] [ "
355 .B  nud
356 .IR STATE " ]"
357
358 .ti -8
359 .BR "ip ntable change name"
360 .IR NAME " [ "
361 .B dev
362 .IR DEV " ] " PARMS
363
364 .ti -8
365 .IR PARMS " := { "
366 .B thresh1
367 .IR VAL " | "
368 .B thresh2
369 .IR VAL " | "
370 .B thresh3
371 .IR VAL " | "
372 .B gc_int
373 .IR MSEC " | "
374 .B base_reachable
375 .IR MSEC " | "
376 .B retrans
377 .IR MSEC " | " "gc_stale MSEC " " | "
378 .B delay_probe
379 .IR MSEC " | " "queue LEN " " | "
380 .B app_probs
381 .IR VAL " | "
382 .B ucast_probes
383 .IR VAL " | " "mcast_probes VAL " " | "
384 .B anycast_delay
385 .IR MSEC " | "
386 .B proxy_delay
387 .IR MSEC " | " "proxy_queue LEN " " | "
388 .B locktime
389 .IR MSEC " }"
390
391 .ti -8
392 .BR "ip ntable show" " [ "
393 .B dev
394 .IR DEV " ] [ "
395 .B name
396 .IR NAME " ]"
397
398 .ti -8
399 .BR "ip tunnel" " { " add " | " change " | " del " | " show " | " prl " }"
400 .RI "[ " NAME " ]"
401 .br
402 .RB "[ " mode
403 .IR MODE " ] [ "
404 .B remote
405 .IR ADDR " ] [ "
406 .B  local
407 .IR ADDR " ]"
408 .br
409 .RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
410 .IR KEY " ] [ "
411 .RB "[" i "|" o "]" csum " ] ]"
412 .br
413 .RB "[ " encaplimit
414 .IR ELIM " ]"
415 .RB "[ " ttl
416 .IR TTL " ]"
417 .br
418 .RB "[ " tos
419 .IR TOS " ] [ "
420 .B flowlabel
421 .IR FLOWLABEL " ]"
422 .br
423 .RB "[ " prl-default
424 .IR ADDR " ] [ "
425 .B prl-nodefault
426 .IR ADDR " ] [ "
427 .B prl-delete
428 .IR ADDR " ]"
429 .br
430 .RB "[ [" no "]" pmtudisc " ]"
431 .RB "[ " dev
432 .IR PHYS_DEV " ]"
433 .RB "[ " "dscp inherit" " ]"
434
435 .ti -8
436 .IR MODE " := "
437 .RB " { " ipip " | " gre " | " sit " | " isatap " | " ip6ip6 " | " ipip6 " | " any " }"
438
439 .ti -8
440 .IR ADDR " := { " IP_ADDRESS " |"
441 .BR any " }"
442
443 .ti -8
444 .IR TOS " := { " NUMBER " |"
445 .BR inherit " }"
446
447 .ti -8
448 .IR ELIM " := {
449 .BR none " | "
450 .IR 0 ".." 255 " }"
451
452 .ti -8
453 .ti -8
454 .IR TTL " := { " 1 ".." 255 " | "
455 .BR inherit " }"
456
457 .ti -8
458 .IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"
459
460 .ti -8
461 .IR TIME " := " NUMBER "[s|ms]"
462
463 .ti -8
464 .BR "ip maddr" " [ " add " | " del " ]"
465 .IB MULTIADDR " dev " STRING
466
467 .ti -8
468 .BR "ip maddr show" " [ " dev
469 .IR STRING " ]"
470
471 .ti -8
472 .BR "ip mroute show" " ["
473 .IR PREFIX " ] [ "
474 .B  from
475 .IR PREFIX " ] [ "
476 .B  iif
477 .IR DEVICE " ]"
478
479 .ti -8
480 .BR "ip monitor" " [ " all " |"
481 .IR LISTofOBJECTS " ]"
482 .sp
483
484 .ti -8
485 .B "ip xfrm"
486 .IR XFRM-OBJECT " { " COMMAND " | "
487 .BR help " }"
488 .sp
489
490 .ti -8
491 .IR XFRM-OBJECT " :="
492 .BR state " | " policy " | " monitor
493 .sp
494
495 .ti -8
496 .BR "ip xfrm state " { " add " | " update " } "
497 .IR ID " [ " ALGO-LIST " ]"
498 .RB "[ " mode
499 .IR MODE " ]"
500 .RB "[ " mark
501 .I MARK
502 .RB "[ " mask
503 .IR MASK " ] ]"
504 .RB "[ " reqid
505 .IR REQID " ]"
506 .RB "[ " seq
507 .IR SEQ " ]"
508 .RB "[ " replay-window
509 .IR SIZE " ]"
510 .RB "[ " replay-seq
511 .IR SEQ " ]"
512 .RB "[ " replay-oseq
513 .IR SEQ " ]"
514 .RB "[ " flag
515 .IR FLAG-LIST " ]"
516 .RB "[ " sel
517 .IR SELECTOR " ] [ " LIMIT-LIST " ]"
518 .RB "[ " encap
519 .IR ENCAP " ]"
520 .RB "[ " coa
521 .IR ADDR "[/" PLEN "] ]"
522 .RB "[ " ctx
523 .IR CTX " ]"
524
525 .ti -8
526 .B "ip xfrm state allocspi"
527 .I ID
528 .RB "[ " mode
529 .IR MODE " ]"
530 .RB "[ " mark
531 .I MARK
532 .RB "[ " mask
533 .IR MASK " ] ]"
534 .RB "[ " reqid
535 .IR REQID " ]"
536 .RB "[ " seq
537 .IR SEQ " ]"
538 .RB "[ " min
539 .I SPI
540 .B max
541 .IR SPI " ]"
542
543 .ti -8
544 .BR "ip xfrm state" " { " delete " | " get " } "
545 .I ID
546 .RB "[ " mark
547 .I MARK
548 .RB "[ " mask
549 .IR MASK " ] ]"
550
551 .ti -8
552 .BR "ip xfrm state" " { " deleteall " | " list " } ["
553 .IR ID " ]"
554 .RB "[ " mode
555 .IR MODE " ]"
556 .RB "[ " reqid
557 .IR REQID " ]"
558 .RB "[ " flag
559 .IR FLAG-LIST " ]"
560
561 .ti -8
562 .BR "ip xfrm state flush" " [ " proto
563 .IR XFRM-PROTO " ]"
564
565 .ti -8
566 .BR "ip xfrm state count"
567
568 .ti -8
569 .IR ID " :="
570 .RB "[ " src
571 .IR ADDR " ]"
572 .RB "[ " dst
573 .IR ADDR " ]"
574 .RB "[ " proto
575 .IR XFRM-PROTO " ]"
576 .RB "[ " spi
577 .IR SPI " ]"
578
579 .ti -8
580 .IR XFRM-PROTO " :="
581 .BR esp " | " ah " | " comp " | " route2 " | " hao
582
583 .ti -8
584 .IR ALGO-LIST " := [ " ALGO-LIST " ] " ALGO
585
586 .ti -8
587 .IR ALGO " :="
588 .RB "{ " enc " | " auth " | " comp " } " 
589 .IR ALGO-NAME " " ALGO-KEY " |"
590 .br
591 .B  aead
592 .IR ALGO-NAME " " ALGO-KEY " " ALGO-ICV-LEN  " |"
593 .br
594 .B auth-trunc
595 .IR ALGO-NAME " " ALGO-KEY " " ALGO-TRUNC-LEN
596
597 .ti -8
598 .IR MODE " := "
599 .BR transport " | " tunnel " | " ro " | " in_trigger " | " beet
600
601 .ti -8
602 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
603
604 .ti -8
605 .IR FLAG " :="
606 .BR noecn " | " decap-dscp " | " nopmtudisc " | " wildrecv " | " icmp " | " af-unspec " | " align4
607
608 .ti -8
609 .IR SELECTOR " :="
610 .RB "[ " src
611 .IR ADDR "[/" PLEN "] ]"
612 .RB "[ " dst
613 .IR ADDR "[/" PLEN "] ]"
614 .RB "[ " dev
615 .IR DEV " ]"
616 .br
617 .RI "[ " UPSPEC " ]"
618
619 .ti -8
620 .IR UPSPEC " := "
621 .BR proto " {"
622 .IR PROTO " |"
623 .br
624 .RB "{ " tcp " | " udp " | " sctp " | " dccp " } [ " sport
625 .IR PORT " ]"
626 .RB "[ " dport
627 .IR PORT " ] |"
628 .br
629 .RB "{ " icmp " | " ipv6-icmp " | " mobility-header " } [ " type
630 .IR NUMBER " ]"
631 .RB "[ " code
632 .IR NUMBER " ] |"
633 .br
634 .BR gre " [ " key
635 .RI "{ " DOTTED-QUAD " | " NUMBER " } ] }"
636
637 .ti -8
638 .IR LIMIT-LIST " := [ " LIMIT-LIST " ]"
639 .B limit
640 .I LIMIT
641
642 .ti -8
643 .IR LIMIT " :="
644 .RB "{ " time-soft " | " time-hard " | " time-use-soft " | " time-use-hard " }"
645 .IR "SECONDS" " |"
646 .br
647 .RB "{ " byte-soft " | " byte-hard " }"
648 .IR SIZE " |"
649 .br
650 .RB "{ " packet-soft " | " packet-hard " }"
651 .I COUNT
652
653 .ti -8
654 .IR ENCAP " :="
655 .RB "{ " espinudp " | " espinudp-nonike " }"
656 .IR SPORT " " DPORT " " OADDR
657
658 .ti -8
659 .BR "ip xfrm policy" " { " add " | " update " }"
660 .I SELECTOR
661 .B dir
662 .I DIR
663 .RB "[ " ctx
664 .IR CTX " ]"
665 .RB "[ " mark
666 .I MARK
667 .RB "[ " mask
668 .IR MASK " ] ]"
669 .RB "[ " index
670 .IR INDEX " ]"
671 .RB "[ " ptype
672 .IR PTYPE " ]"
673 .RB "[ " action
674 .IR ACTION " ]"
675 .RB "[ " priority
676 .IR PRIORITY " ]"
677 .RB "[ " flag
678 .IR FLAG-LIST " ]"
679 .RI "[ " LIMIT-LIST " ] [ " TMPL-LIST " ]"
680
681 .ti -8
682 .BR "ip xfrm policy" " { " delete " | " get " }"
683 .RI "{ " SELECTOR " | "
684 .B index
685 .IR INDEX " }"
686 .B dir
687 .I DIR
688 .RB "[ " ctx
689 .IR CTX " ]"
690 .RB "[ " mark
691 .I MARK
692 .RB "[ " mask
693 .IR MASK " ] ]"
694 .RB "[ " ptype
695 .IR PTYPE " ]"
696
697 .ti -8
698 .BR "ip xfrm policy" " { " deleteall " | " list " }"
699 .RI "[ " SELECTOR " ]"
700 .RB "[ " dir
701 .IR DIR " ]"
702 .RB "[ " index
703 .IR INDEX " ]"
704 .RB "[ " ptype
705 .IR PTYPE " ]"
706 .RB "[ " action
707 .IR ACTION " ]"
708 .RB "[ " priority
709 .IR PRIORITY " ]"
710
711 .ti -8
712 .B "ip xfrm policy flush"
713 .RB "[ " ptype
714 .IR PTYPE " ]"
715
716 .ti -8
717 .B "ip xfrm policy count"
718
719 .ti -8
720 .IR SELECTOR " :="
721 .RB "[ " src
722 .IR ADDR "[/" PLEN "] ]"
723 .RB "[ " dst
724 .IR ADDR "[/" PLEN "] ]"
725 .RB "[ " dev
726 .IR DEV " ]"
727 .RI "[ " UPSPEC " ]"
728
729 .ti -8
730 .IR UPSPEC " := "
731 .BR proto " {"
732 .IR PROTO " |"
733 .br
734 .RB "{ " tcp " | " udp " | " sctp " | " dccp " } [ " sport
735 .IR PORT " ]"
736 .RB "[ " dport
737 .IR PORT " ] |"
738 .br
739 .RB "{ " icmp " | " ipv6-icmp " | " mobility-header " } [ " type
740 .IR NUMBER " ]"
741 .RB "[ " code
742 .IR NUMBER " ] |"
743 .br
744 .BR gre " [ " key
745 .RI "{ " DOTTED-QUAD " | " NUMBER " } ] }"
746
747 .ti -8
748 .IR DIR " := "
749 .BR in " | " out " | " fwd
750
751 .ti -8
752 .IR PTYPE " := "
753 .BR main " | " sub
754
755 .ti -8
756 .IR ACTION " := "
757 .BR allow " | " block
758
759 .ti -8
760 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
761
762 .ti -8
763 .IR FLAG " :="
764 .BR localok " | " icmp
765
766 .ti -8
767 .IR LIMIT-LIST " := [ " LIMIT-LIST " ]"
768 .B limit
769 .I LIMIT
770
771 .ti -8
772 .IR LIMIT " :="
773 .RB "{ " time-soft " | " time-hard " | " time-use-soft " | " time-use-hard " }"
774 .IR "SECONDS" " |"
775 .br
776 .RB "{ " byte-soft " | " byte-hard " }"
777 .IR SIZE " |"
778 .br
779 .RB "{ " packet-soft " | " packet-hard " }"
780 .I COUNT
781
782 .ti -8
783 .IR TMPL-LIST " := [ " TMPL-LIST " ]"
784 .B tmpl
785 .I TMPL
786
787 .ti -8
788 .IR TMPL " := " ID
789 .RB "[ " mode
790 .IR MODE " ]"
791 .RB "[ " reqid
792 .IR REQID " ]"
793 .RB "[ " level
794 .IR LEVEL " ]"
795
796 .ti -8
797 .IR ID " :="
798 .RB "[ " src
799 .IR ADDR " ]"
800 .RB "[ " dst
801 .IR ADDR " ]"
802 .RB "[ " proto
803 .IR XFRM-PROTO " ]"
804 .RB "[ " spi
805 .IR SPI " ]"
806
807 .ti -8
808 .IR XFRM-PROTO " :="
809 .BR esp " | " ah " | " comp " | " route2 " | " hao
810
811 .ti -8
812 .IR MODE " := "
813 .BR transport " | " tunnel " | " ro " | " in_trigger " | " beet
814
815 .ti -8
816 .IR LEVEL " :="
817 .BR required " | " use
818
819 .ti -8
820 .BR "ip xfrm monitor" " [ " all " |"
821 .IR LISTofXFRM-OBJECTS " ]"
822
823 .in -8
824 .ad b
825
826 .SH OPTIONS
827
828 .TP
829 .BR "\-V" , " -Version"
830 print the version of the
831 .B ip
832 utility and exit.
833
834 .TP
835 .BR "\-s" , " \-stats", " \-statistics"
836 output more information.  If the option
837 appears twice or more, the amount of information increases.
838 As a rule, the information is statistics or some time values.
839
840 .TP
841 .BR "\-l" , " \-loops"
842 Specify maximum number of loops the 'ip addr flush' logic
843 will attempt before giving up.  The default is 10.
844 Zero (0) means loop until all addresses are removed.
845
846 .TP
847 .BR "\-f" , " \-family"
848 followed by protocol family identifier:
849 .BR "inet" , " inet6"
850 or
851 .B link
852 ,enforce the protocol family to use.  If the option is not present,
853 the protocol family is guessed from other arguments.  If the rest
854 of the command line does not give enough information to guess the
855 family,
856 .B ip
857 falls back to the default one, usually
858 .B inet
859 or
860 .BR "any" .
861 .B link
862 is a special family identifier meaning that no networking protocol
863 is involved.
864
865 .TP
866 .B \-4
867 shortcut for
868 .BR "-family inet" .
869
870 .TP
871 .B \-6
872 shortcut for
873 .BR "\-family inet6" .
874
875 .TP
876 .B \-0
877 shortcut for
878 .BR "\-family link" .
879
880 .TP
881 .BR "\-o" , " \-oneline"
882 output each record on a single line, replacing line feeds
883 with the
884 .B '\e\'
885 character. This is convenient when you want to count records
886 with
887 .BR wc (1)
888  or to
889 .BR grep (1)
890 the output.
891
892 .TP
893 .BR "\-r" , " \-resolve"
894 use the system's name resolver to print DNS names instead of
895 host addresses.
896
897 .SH IP - COMMAND SYNTAX
898
899 .SS
900 .I OBJECT
901
902 .TP
903 .B link
904 - network device.
905
906 .TP
907 .B address
908 - protocol (IP or IPv6) address on a device.
909
910 .TP
911 .B addrlabel
912 - label configuration for protocol address selection.
913
914 .TP
915 .B neighbour
916 - ARP or NDISC cache entry.
917
918 .TP
919 .B route
920 - routing table entry.
921
922 .TP
923 .B rule
924 - rule in routing policy database.
925
926 .TP
927 .B maddress
928 - multicast address.
929
930 .TP
931 .B mroute
932 - multicast routing cache entry.
933
934 .TP
935 .B tunnel
936 - tunnel over IP.
937
938 .PP
939 The names of all objects may be written in full or
940 abbreviated form, f.e.
941 .B address
942 is abbreviated as
943 .B addr
944 or just
945 .B a.
946
947 .SS
948 .I COMMAND
949
950 Specifies the action to perform on the object.
951 The set of possible actions depends on the object type.
952 As a rule, it is possible to
953 .BR "add" , " delete"
954 and
955 .B show
956 (or
957 .B list
958 ) objects, but some objects do not allow all of these operations
959 or have some additional commands.  The
960 .B help
961 command is available for all objects.  It prints
962 out a list of available commands and argument syntax conventions.
963 .sp
964 If no command is given, some default command is assumed.
965 Usually it is
966 .B list
967 or, if the objects of this class cannot be listed,
968 .BR "help" .
969
970 .SH ip link - network device configuration
971
972 .B link
973 is a network device and the corresponding commands
974 display and change the state of devices.
975
976 .SS ip link add - add virtual link
977
978 .TP
979 .BI link " DEVICE "
980 specifies the physical device to act operate on.
981
982 .I NAME
983 specifies the name of the new virtual device.
984
985 .I TYPE
986 specifies the type of the new device.
987 .sp
988 Link types:
989
990 .in +8
991 .B vlan
992 - 802.1q tagged virtual LAN interface
993 .sp
994 .B veth
995 - Virtual ethernet interface
996 .sp
997 .B vcan
998 - Virtual Local CAN interface
999 .sp
1000 .B dummy
1001 - Dummy network interface
1002 .sp
1003 .B ifb
1004 - Intermediate Functional Block device
1005 .sp
1006 .B macvlan
1007 - virtual interface base on link layer address (MAC)
1008 .sp
1009 .B can
1010 - Controller Area Network interface
1011 .sp
1012 .B bridge
1013 - Ethernet Bridge device
1014 .in -8
1015
1016 .SS ip link delete - delete virtual link
1017 .I DEVICE
1018 specifies the virtual  device to act operate on.
1019 .I TYPE
1020 specifies the type of the device.
1021
1022
1023 .TP
1024 .BI dev " DEVICE "
1025 specifies the physical device to act operate on.
1026
1027 .SS ip link set - change device attributes
1028
1029 .TP
1030 .BI dev " DEVICE "
1031 .I DEVICE
1032 specifies network device to operate on. When configuring SR-IOV Virtual Fuction
1033 (VF) devices, this keyword should specify the associated Physical Function (PF)
1034 device.
1035
1036 .TP
1037 .BI group " GROUP "
1038 .I GROUP
1039 has a dual role: If both group and dev are present, then move the device to the
1040 specified group.  If only a group is specified, then the command operates on
1041 all devices in that group.
1042
1043 .TP
1044 .BR up " and " down
1045 change the state of the device to
1046 .B UP
1047 or
1048 .BR "DOWN" .
1049
1050 .TP
1051 .BR "arp on " or " arp off"
1052 change the
1053 .B NOARP
1054 flag on the device.
1055
1056 .TP
1057 .BR "multicast on " or " multicast off"
1058 change the
1059 .B MULTICAST
1060 flag on the device.
1061
1062 .TP
1063 .BR "dynamic on " or " dynamic off"
1064 change the
1065 .B DYNAMIC
1066 flag on the device.
1067
1068 .TP
1069 .BI name " NAME"
1070 change the name of the device.  This operation is not
1071 recommended if the device is running or has some addresses
1072 already configured.
1073
1074 .TP
1075 .BI txqueuelen " NUMBER"
1076 .TP
1077 .BI txqlen " NUMBER"
1078 change the transmit queue length of the device.
1079
1080 .TP
1081 .BI mtu " NUMBER"
1082 change the
1083 .I MTU
1084 of the device.
1085
1086 .TP
1087 .BI address " LLADDRESS"
1088 change the station address of the interface.
1089
1090 .TP
1091 .BI broadcast " LLADDRESS"
1092 .TP
1093 .BI brd " LLADDRESS"
1094 .TP
1095 .BI peer " LLADDRESS"
1096 change the link layer broadcast address or the peer address when
1097 the interface is
1098 .IR "POINTOPOINT" .
1099
1100 .TP
1101 .BI netns " PID"
1102 move the device to the network namespace associated with the process
1103 .IR "PID".
1104
1105 .TP
1106 .BI netns " NETNSNAME"
1107 move the device to the network namespace associated with name
1108 .IR "NETNSNAME".
1109
1110 .TP
1111 .BI alias " NAME"
1112 give the device a symbolic name for easy reference.
1113
1114 .TP
1115 .BI group " GROUP"
1116 specify the group the device belongs to.
1117 The available groups are listed in file
1118 .BR "/etc/iproute2/group" .
1119
1120 .TP
1121 .BI vf " NUM"
1122 specify a Virtual Function device to be configured. The associated PF device
1123 must be specified using the
1124 .B dev
1125 parameter.
1126
1127 .in +8
1128 .BI mac " LLADDRESS"
1129 - change the station address for the specified VF. The
1130 .B vf
1131 parameter must be specified.
1132
1133 .sp
1134 .BI vlan " VLANID"
1135 - change the assigned VLAN for the specified VF. When specified, all traffic
1136 sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
1137 will be filtered for the specified VLAN ID, and will have all VLAN tags
1138 stripped before being passed to the VF. Setting this parameter to 0 disables
1139 VLAN tagging and filtering. The
1140 .B vf
1141 parameter must be specified.
1142
1143 .sp
1144 .BI qos " VLAN-QOS"
1145 - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
1146 tags transmitted by the VF will include the specified priority bits in the
1147 VLAN tag. If not specified, the value is assumed to be 0. Both the
1148 .B vf
1149 and
1150 .B vlan
1151 parameters must be specified. Setting both
1152 .B vlan
1153 and
1154 .B qos
1155 as 0 disables VLAN tagging and filtering for the VF.
1156
1157 .sp
1158 .BI rate " TXRATE"
1159 - change the allowed transmit bandwidth, in Mbps, for the specified VF.
1160 Setting this parameter to 0 disables rate limiting. The
1161 .B vf
1162 parameter must be specified.
1163 .in -8
1164
1165 .TP
1166 .BI master " DEVICE"
1167 set master device of the device (enslave device).
1168
1169 .TP
1170 .BI nomaster
1171 unset master device of the device (release device).
1172
1173 .PP
1174 .B Warning:
1175 If multiple parameter changes are requested,
1176 .B ip
1177 aborts immediately after any of the changes have failed.
1178 This is the only case when
1179 .B ip
1180 can move the system to an unpredictable state.  The solution
1181 is to avoid changing several parameters with one
1182 .B ip link set
1183 call.
1184
1185 .SS  ip link show - display device attributes
1186
1187 .TP
1188 .BI dev " NAME " (default)
1189 .I NAME
1190 specifies the network device to show.
1191 If this argument is omitted all devices in the default group are listed.
1192
1193 .TP
1194 .BI group " GROUP "
1195 .I GROUP
1196 specifies what group of devices to show.
1197
1198 .TP
1199 .B up
1200 only display running interfaces.
1201
1202 .SH ip address - protocol address management.
1203
1204 The
1205 .B address
1206 is a protocol (IP or IPv6) address attached
1207 to a network device.  Each device must have at least one address
1208 to use the corresponding protocol.  It is possible to have several
1209 different addresses attached to one device.  These addresses are not
1210 discriminated, so that the term
1211 .B alias
1212 is not quite appropriate for them and we do not use it in this document.
1213 .sp
1214 The
1215 .B ip addr
1216 command displays addresses and their properties, adds new addresses
1217 and deletes old ones.
1218
1219 .SS ip address add - add new protocol address.
1220
1221 .TP
1222 .BI dev " NAME"
1223 the name of the device to add the address to.
1224
1225 .TP
1226 .BI local " ADDRESS " (default)
1227 the address of the interface. The format of the address depends
1228 on the protocol. It is a dotted quad for IP and a sequence of
1229 hexadecimal halfwords separated by colons for IPv6.  The
1230 .I ADDRESS
1231 may be followed by a slash and a decimal number which encodes
1232 the network prefix length.
1233
1234 .TP
1235 .BI peer " ADDRESS"
1236 the address of the remote endpoint for pointopoint interfaces.
1237 Again, the
1238 .I ADDRESS
1239 may be followed by a slash and a decimal number, encoding the network
1240 prefix length.  If a peer address is specified, the local address
1241 cannot have a prefix length.  The network prefix is associated
1242 with the peer rather than with the local address.
1243
1244 .TP
1245 .BI broadcast " ADDRESS"
1246 the broadcast address on the interface.
1247 .sp
1248 It is possible to use the special symbols
1249 .B '+'
1250 and
1251 .B '-'
1252 instead of the broadcast address.  In this case, the broadcast address
1253 is derived by setting/resetting the host bits of the interface prefix.
1254
1255 .TP
1256 .BI label " NAME"
1257 Each address may be tagged with a label string.
1258 In order to preserve compatibility with Linux-2.0 net aliases,
1259 this string must coincide with the name of the device or must be prefixed
1260 with the device name followed by colon.
1261
1262 .TP
1263 .BI scope " SCOPE_VALUE"
1264 the scope of the area where this address is valid.
1265 The available scopes are listed in file
1266 .BR "/etc/iproute2/rt_scopes" .
1267 Predefined scope values are:
1268
1269 .in +8
1270 .B global
1271 - the address is globally valid.
1272 .sp
1273 .B site
1274 - (IPv6 only) the address is site local, i.e. it is
1275 valid inside this site.
1276 .sp
1277 .B link
1278 - the address is link local, i.e. it is valid only on this device.
1279 .sp
1280 .B host
1281 - the address is valid only inside this host.
1282 .in -8
1283
1284 .SS ip address delete - delete protocol address
1285 .B Arguments:
1286 coincide with the arguments of
1287 .B ip addr add.
1288 The device name is a required argument.  The rest are optional.
1289 If no arguments are given, the first address is deleted.
1290
1291 .SS ip address show - look at protocol addresses
1292
1293 .TP
1294 .BI dev " NAME " (default)
1295 name of device.
1296
1297 .TP
1298 .BI scope " SCOPE_VAL"
1299 only list addresses with this scope.
1300
1301 .TP
1302 .BI to " PREFIX"
1303 only list addresses matching this prefix.
1304
1305 .TP
1306 .BI label " PATTERN"
1307 only list addresses with labels matching the
1308 .IR "PATTERN" .
1309 .I PATTERN
1310 is a usual shell style pattern.
1311
1312 .TP
1313 .BR dynamic " and " permanent
1314 (IPv6 only) only list addresses installed due to stateless
1315 address configuration or only list permanent (not dynamic)
1316 addresses.
1317
1318 .TP
1319 .B tentative
1320 (IPv6 only) only list addresses which have not yet passed duplicate
1321 address detection.
1322
1323 .TP
1324 .B deprecated
1325 (IPv6 only) only list deprecated addresses.
1326
1327 .TP
1328 .B dadfailed
1329 (IPv6 only) only list addresses which have failed duplicate
1330 address detection.
1331
1332 .TP
1333 .B temporary
1334 (IPv6 only) only list temporary addresses.
1335
1336 .TP
1337 .BR primary " and " secondary
1338 only list primary (or secondary) addresses.
1339
1340 .SS ip address flush - flush protocol addresses
1341 This command flushes the protocol addresses selected by some criteria.
1342
1343 .PP
1344 This command has the same arguments as
1345 .B show.
1346 The difference is that it does not run when no arguments are given.
1347
1348 .PP
1349 .B Warning:
1350 This command (and other
1351 .B flush
1352 commands described below) is pretty dangerous.  If you make a mistake,
1353 it will not forgive it, but will cruelly purge all the addresses.
1354
1355 .PP
1356 With the
1357 .B -statistics
1358 option, the command becomes verbose. It prints out the number of deleted
1359 addresses and the number of rounds made to flush the address list.  If
1360 this option is given twice,
1361 .B ip addr flush
1362 also dumps all the deleted addresses in the format described in the
1363 previous subsection.
1364
1365 .SH ip addrlabel - protocol address label management.
1366
1367 IPv6 address label is used for address selection
1368 described in RFC 3484.  Precedence is managed by userspace,
1369 and only label is stored in kernel.
1370
1371 .SS ip addrlabel add - add an address label
1372 the command adds an address label entry to the kernel.
1373 .TP
1374 .BI prefix " PREFIX"
1375 .TP
1376 .BI dev " DEV"
1377 the outgoing interface.
1378 .TP
1379 .BI label " NUMBER"
1380 the label for the prefix.
1381 0xffffffff is reserved.
1382 .SS ip addrlabel del - delete an address label
1383 the command deletes an address label entry in the kernel.
1384 .B Arguments:
1385 coincide with the arguments of
1386 .B ip addrlabel add
1387 but label is not required.
1388 .SS ip addrlabel list - list address labels
1389 the command show contents of address labels.
1390 .SS ip addrlabel flush - flush address labels
1391 the command flushes the contents of address labels and it does not restore default settings.
1392 .SH ip neighbour - neighbour/arp tables management.
1393
1394 .B neighbour
1395 objects establish bindings between protocol addresses and
1396 link layer addresses for hosts sharing the same link.
1397 Neighbour entries are organized into tables. The IPv4 neighbour table
1398 is known by another name - the ARP table.
1399
1400 .P
1401 The corresponding commands display neighbour bindings
1402 and their properties, add new neighbour entries and delete old ones.
1403
1404 .SS ip neighbour add - add a new neighbour entry
1405 .SS ip neighbour change - change an existing entry
1406 .SS ip neighbour replace - add a new entry or change an existing one
1407
1408 These commands create new neighbour records or update existing ones.
1409
1410 .TP
1411 .BI to " ADDRESS " (default)
1412 the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
1413
1414 .TP
1415 .BI dev " NAME"
1416 the interface to which this neighbour is attached.
1417
1418 .TP
1419 .BI lladdr " LLADDRESS"
1420 the link layer address of the neighbour.
1421 .I LLADDRESS
1422 can also be
1423 .BR "null" .
1424
1425 .TP
1426 .BI nud " NUD_STATE"
1427 the state of the neighbour entry.
1428 .B nud
1429 is an abbreviation for 'Neighbour Unreachability Detection'.
1430 The state can take one of the following values:
1431
1432 .in +8
1433 .B permanent
1434 - the neighbour entry is valid forever and can be only
1435 be removed administratively.
1436 .sp
1437
1438 .B noarp
1439 - the neighbour entry is valid. No attempts to validate
1440 this entry will be made but it can be removed when its lifetime expires.
1441 .sp
1442
1443 .B reachable
1444 - the neighbour entry is valid until the reachability
1445 timeout expires.
1446 .sp
1447
1448 .B stale
1449 - the neighbour entry is valid but suspicious.
1450 This option to
1451 .B ip neigh
1452 does not change the neighbour state if it was valid and the address
1453 is not changed by this command.
1454 .in -8
1455
1456 .SS ip neighbour delete - delete a neighbour entry
1457 This command invalidates a neighbour entry.
1458
1459 .PP
1460 The arguments are the same as with
1461 .BR "ip neigh add" ,
1462 except that
1463 .B lladdr
1464 and
1465 .B nud
1466 are ignored.
1467
1468 .PP
1469 .B Warning:
1470 Attempts to delete or manually change a
1471 .B noarp
1472 entry created by the kernel may result in unpredictable behaviour.
1473 Particularly, the kernel may try to resolve this address even
1474 on a
1475 .B NOARP
1476 interface or if the address is multicast or broadcast.
1477
1478 .SS ip neighbour show - list neighbour entries
1479
1480 This commands displays neighbour tables.
1481
1482 .TP
1483 .BI to " ADDRESS " (default)
1484 the prefix selecting the neighbours to list.
1485
1486 .TP
1487 .BI dev " NAME"
1488 only list the neighbours attached to this device.
1489
1490 .TP
1491 .B unused
1492 only list neighbours which are not currently in use.
1493
1494 .TP
1495 .BI nud " NUD_STATE"
1496 only list neighbour entries in this state.
1497 .I NUD_STATE
1498 takes values listed below or the special value
1499 .B all
1500 which means all states.  This option may occur more than once.
1501 If this option is absent,
1502 .B ip
1503 lists all entries except for
1504 .B none
1505 and
1506 .BR "noarp" .
1507
1508 .SS ip neighbour flush - flush neighbour entries
1509 This command flushes neighbour tables, selecting
1510 entries to flush by some criteria.
1511
1512 .PP
1513 This command has the same arguments as
1514 .B show.
1515 The differences are that it does not run when no arguments are given,
1516 and that the default neighbour states to be flushed do not include
1517 .B permanent
1518 and
1519 .BR "noarp" .
1520
1521 .PP
1522 With the
1523 .B -statistics
1524 option, the command becomes verbose.  It prints out the number of
1525 deleted neighbours and the number of rounds made to flush the
1526 neighbour table.  If the option is given
1527 twice,
1528 .B ip neigh flush
1529 also dumps all the deleted neighbours.
1530
1531 .SH ip ntable - neighbour table configuration
1532 Display and change the parameters for the neighbour tables.
1533
1534 .SS ip ntable show - list the ip neighbour tables
1535
1536 This commands displays neighbour table parameters and statistics.
1537
1538 .TP
1539 .BI dev " DEV"
1540 only list the table attached to this device.
1541
1542 .TP
1543 .BI name " NAME"
1544 only lists the table with the given name.
1545
1546 .SS ip ntable change - modify table parameter
1547
1548 This command allows modifying table parameters such as timers and queue lengths.
1549 .TP
1550 .BI name " NAME"
1551 the name of the table to modify.
1552
1553 .TP
1554 .BI dev " DEV"
1555 the name of the device to modify the table values.
1556
1557 .SH ip route - routing table management
1558 Manipulate route entries in the kernel routing tables keep
1559 information about paths to other networked nodes.
1560 .sp
1561 .B Route types:
1562
1563 .in +8
1564 .B unicast
1565 - the route entry describes real paths to the destinations covered
1566 by the route prefix.
1567
1568 .sp
1569 .B unreachable
1570 - these destinations are unreachable.  Packets are discarded and the
1571 ICMP message
1572 .I host unreachable
1573 is generated.
1574 The local senders get an
1575 .I EHOSTUNREACH
1576 error.
1577
1578 .sp
1579 .B blackhole
1580 - these destinations are unreachable.  Packets are discarded silently.
1581 The local senders get an
1582 .I EINVAL
1583 error.
1584
1585 .sp
1586 .B prohibit
1587 - these destinations are unreachable.  Packets are discarded and the
1588 ICMP message
1589 .I communication administratively prohibited
1590 is generated.  The local senders get an
1591 .I EACCES
1592 error.
1593
1594 .sp
1595 .B local
1596 - the destinations are assigned to this host.  The packets are looped
1597 back and delivered locally.
1598
1599 .sp
1600 .B broadcast
1601 - the destinations are broadcast addresses.  The packets are sent as
1602 link broadcasts.
1603
1604 .sp
1605 .B throw
1606 - a special control route used together with policy rules. If such a
1607 route is selected, lookup in this table is terminated pretending that
1608 no route was found.  Without policy routing it is equivalent to the
1609 absence of the route in the routing table.  The packets are dropped
1610 and the ICMP message
1611 .I net unreachable
1612 is generated.  The local senders get an
1613 .I ENETUNREACH
1614 error.
1615
1616 .sp
1617 .B nat
1618 - a special NAT route.  Destinations covered by the prefix
1619 are considered to be dummy (or external) addresses which require translation
1620 to real (or internal) ones before forwarding.  The addresses to translate to
1621 are selected with the attribute
1622 .B Warning:
1623 Route NAT is no longer supported in Linux 2.6.
1624
1625
1626 .BR "via" .
1627 .sp
1628 .B anycast
1629 .RI "- " "not implemented"
1630 the destinations are
1631 .I anycast
1632 addresses assigned to this host.  They are mainly equivalent
1633 to
1634 .B local
1635 with one difference: such addresses are invalid when used
1636 as the source address of any packet.
1637
1638 .sp
1639 .B multicast
1640 - a special type used for multicast routing.  It is not present in
1641 normal routing tables.
1642 .in -8
1643
1644 .P
1645 .B Route tables:
1646 Linux-2.x can pack routes into several routing tables identified 
1647 by a number in the range from 1 to 2^31 or by name from the file
1648 .B /etc/iproute2/rt_tables
1649 By default all normal routes are inserted into the
1650 .B main
1651 table (ID 254) and the kernel only uses this table when calculating routes.
1652 Values (0, 253, 254, and 255) are reserved for built-in use.
1653
1654 .sp
1655 Actually, one other table always exists, which is invisible but
1656 even more important.  It is the
1657 .B local
1658 table (ID 255).  This table
1659 consists of routes for local and broadcast addresses.  The kernel maintains
1660 this table automatically and the administrator usually need not modify it
1661 or even look at it.
1662
1663 The multiple routing tables enter the game when
1664 .I policy routing
1665 is used.
1666
1667 .SS ip route add - add new route
1668 .SS ip route change - change route
1669 .SS ip route replace - change or add new one
1670
1671 .TP
1672 .BI to " TYPE PREFIX " (default)
1673 the destination prefix of the route.  If
1674 .I TYPE
1675 is omitted,
1676 .B ip
1677 assumes type
1678 .BR "unicast" .
1679 Other values of
1680 .I TYPE
1681 are listed above.
1682 .I PREFIX
1683 is an IP or IPv6 address optionally followed by a slash and the
1684 prefix length.  If the length of the prefix is missing,
1685 .B ip
1686 assumes a full-length host route.  There is also a special
1687 .I PREFIX
1688 .B default
1689 - which is equivalent to IP
1690 .B 0/0
1691 or to IPv6
1692 .BR "::/0" .
1693
1694 .TP
1695 .BI tos " TOS"
1696 .TP
1697 .BI dsfield " TOS"
1698 the Type Of Service (TOS) key.  This key has no associated mask and
1699 the longest match is understood as: First, compare the TOS
1700 of the route and of the packet.  If they are not equal, then the packet
1701 may still match a route with a zero TOS.
1702 .I TOS
1703 is either an 8 bit hexadecimal number or an identifier
1704 from
1705 .BR "/etc/iproute2/rt_dsfield" .
1706
1707 .TP
1708 .BI metric " NUMBER"
1709 .TP
1710 .BI preference " NUMBER"
1711 the preference value of the route.
1712 .I NUMBER
1713 is an arbitrary 32bit number.
1714
1715 .TP
1716 .BI table " TABLEID"
1717 the table to add this route to.
1718 .I TABLEID
1719 may be a number or a string from the file
1720 .BR "/etc/iproute2/rt_tables" .
1721 If this parameter is omitted,
1722 .B ip
1723 assumes the
1724 .B main
1725 table, with the exception of
1726 .BR local " , " broadcast " and " nat
1727 routes, which are put into the
1728 .B local
1729 table by default.
1730
1731 .TP
1732 .BI dev " NAME"
1733 the output device name.
1734
1735 .TP
1736 .BI via " ADDRESS"
1737 the address of the nexthop router.  Actually, the sense of this field
1738 depends on the route type.  For normal
1739 .B unicast
1740 routes it is either the true next hop router or, if it is a direct
1741 route installed in BSD compatibility mode, it can be a local address
1742 of the interface.  For NAT routes it is the first address of the block
1743 of translated IP destinations.
1744
1745 .TP
1746 .BI src " ADDRESS"
1747 the source address to prefer when sending to the destinations
1748 covered by the route prefix.
1749
1750 .TP
1751 .BI realm " REALMID"
1752 the realm to which this route is assigned.
1753 .I REALMID
1754 may be a number or a string from the file
1755 .BR "/etc/iproute2/rt_realms" .
1756
1757 .TP
1758 .BI mtu " MTU"
1759 .TP
1760 .BI "mtu lock" " MTU"
1761 the MTU along the path to the destination.  If the modifier
1762 .B lock
1763 is not used, the MTU may be updated by the kernel due to
1764 Path MTU Discovery.  If the modifier
1765 .B lock
1766 is used, no path MTU discovery will be tried, all packets
1767 will be sent without the DF bit in IPv4 case or fragmented
1768 to MTU for IPv6.
1769
1770 .TP
1771 .BI window " NUMBER"
1772 the maximal window for TCP to advertise to these destinations,
1773 measured in bytes.  It limits maximal data bursts that our TCP
1774 peers are allowed to send to us.
1775
1776 .TP
1777 .BI rtt " TIME"
1778 the initial RTT ('Round Trip Time') estimate. If no suffix is
1779 specified the units are raw values passed directly to the
1780 routing code to maintain compatibility with previous releases.
1781 Otherwise if a suffix of s, sec or secs is used to specify
1782 seconds and ms, msec or msecs to specify milliseconds.
1783
1784
1785 .TP
1786 .BI rttvar " TIME " "(2.3.15+ only)"
1787 the initial RTT variance estimate. Values are specified as with
1788 .BI rtt
1789 above.
1790
1791 .TP
1792 .BI rto_min " TIME " "(2.6.23+ only)"
1793 the minimum TCP Retransmission TimeOut to use when communicating with this
1794 destination.  Values are specified as with
1795 .BI rtt
1796 above.
1797
1798 .TP
1799 .BI ssthresh " NUMBER " "(2.3.15+ only)"
1800 an estimate for the initial slow start threshold.
1801
1802 .TP
1803 .BI cwnd " NUMBER " "(2.3.15+ only)"
1804 the clamp for congestion window.  It is ignored if the
1805 .B lock
1806 flag is not used.
1807
1808 .TP
1809 .BI initcwnd " NUMBER " "(2.5.70+ only)"
1810 the initial congestion window size for connections to this destination.
1811 Actual window size is this value multiplied by the MSS
1812 (``Maximal Segment Size'') for same connection. The default is
1813 zero, meaning to use the values specified in RFC2414.
1814
1815 .TP
1816 .BI initrwnd " NUMBER " "(2.6.33+ only)"
1817 the initial receive window size for connections to this destination.
1818 Actual window size is this value multiplied by the MSS of the connection.
1819 The default value is zero, meaning to use Slow Start value.
1820
1821 .TP
1822 .BI advmss " NUMBER " "(2.3.15+ only)"
1823 the MSS ('Maximal Segment Size') to advertise to these
1824 destinations when establishing TCP connections.  If it is not given,
1825 Linux uses a default value calculated from the first hop device MTU.
1826 (If the path to these destination is asymmetric, this guess may be wrong.)
1827
1828 .TP
1829 .BI reordering " NUMBER " "(2.3.15+ only)"
1830 Maximal reordering on the path to this destination.
1831 If it is not given, Linux uses the value selected with
1832 .B sysctl
1833 variable
1834 .BR "net/ipv4/tcp_reordering" .
1835
1836 .TP
1837 .BI nexthop " NEXTHOP"
1838 the nexthop of a multipath route.
1839 .I NEXTHOP
1840 is a complex value with its own syntax similar to the top level
1841 argument lists:
1842
1843 .in +8
1844 .BI via " ADDRESS"
1845 - is the nexthop router.
1846 .sp
1847
1848 .BI dev " NAME"
1849 - is the output device.
1850 .sp
1851
1852 .BI weight " NUMBER"
1853 - is a weight for this element of a multipath
1854 route reflecting its relative bandwidth or quality.
1855 .in -8
1856
1857 .TP
1858 .BI scope " SCOPE_VAL"
1859 the scope of the destinations covered by the route prefix.
1860 .I SCOPE_VAL
1861 may be a number or a string from the file
1862 .BR "/etc/iproute2/rt_scopes" .
1863 If this parameter is omitted,
1864 .B ip
1865 assumes scope
1866 .B global
1867 for all gatewayed
1868 .B unicast
1869 routes, scope
1870 .B link
1871 for direct
1872 .BR unicast " and " broadcast
1873 routes and scope
1874 .BR host " for " local
1875 routes.
1876
1877 .TP
1878 .BI protocol " RTPROTO"
1879 the routing protocol identifier of this route.
1880 .I RTPROTO
1881 may be a number or a string from the file
1882 .BR "/etc/iproute2/rt_protos" .
1883 If the routing protocol ID is not given,
1884 .B ip assumes protocol
1885 .B boot
1886 (i.e. it assumes the route was added by someone who doesn't
1887 understand what they are doing).  Several protocol values have
1888 a fixed interpretation.
1889 Namely:
1890
1891 .in +8
1892 .B redirect
1893 - the route was installed due to an ICMP redirect.
1894 .sp
1895
1896 .B kernel
1897 - the route was installed by the kernel during autoconfiguration.
1898 .sp
1899
1900 .B boot
1901 - the route was installed during the bootup sequence.
1902 If a routing daemon starts, it will purge all of them.
1903 .sp
1904
1905 .B static
1906 - the route was installed by the administrator
1907 to override dynamic routing. Routing daemon will respect them
1908 and, probably, even advertise them to its peers.
1909 .sp
1910
1911 .B ra
1912 - the route was installed by Router Discovery protocol.
1913 .in -8
1914
1915 .sp
1916 The rest of the values are not reserved and the administrator is free
1917 to assign (or not to assign) protocol tags.
1918
1919 .TP
1920 .B onlink
1921 pretend that the nexthop is directly attached to this link,
1922 even if it does not match any interface prefix.
1923
1924 .SS ip route delete - delete route
1925
1926 .B ip route del
1927 has the same arguments as
1928 .BR "ip route add" ,
1929 but their semantics are a bit different.
1930
1931 Key values
1932 .RB "(" to ", " tos ", " preference " and " table ")"
1933 select the route to delete.  If optional attributes are present,
1934 .B ip
1935 verifies that they coincide with the attributes of the route to delete.
1936 If no route with the given key and attributes was found,
1937 .B ip route del
1938 fails.
1939
1940 .SS ip route show - list routes
1941 the command displays the contents of the routing tables or the route(s)
1942 selected by some criteria.
1943
1944 .TP
1945 .BI to " SELECTOR " (default)
1946 only select routes from the given range of destinations.
1947 .I SELECTOR
1948 consists of an optional modifier
1949 .RB "(" root ", " match " or " exact ")"
1950 and a prefix.
1951 .BI root " PREFIX"
1952 selects routes with prefixes not shorter than
1953 .IR PREFIX "."
1954 F.e.
1955 .BI root " 0/0"
1956 selects the entire routing table.
1957 .BI match " PREFIX"
1958 selects routes with prefixes not longer than
1959 .IR PREFIX "."
1960 F.e.
1961 .BI match " 10.0/16"
1962 selects
1963 .IR 10.0/16 ","
1964 .IR 10/8 " and " 0/0 ,
1965 but it does not select
1966 .IR 10.1/16 " and " 10.0.0/24 .
1967 And
1968 .BI exact " PREFIX"
1969 (or just
1970 .IR PREFIX ")"
1971 selects routes with this exact prefix. If neither of these options
1972 are present,
1973 .B ip
1974 assumes
1975 .BI root " 0/0"
1976 i.e. it lists the entire table.
1977
1978 .TP
1979 .BI tos " TOS"
1980 .BI dsfield " TOS"
1981 only select routes with the given TOS.
1982
1983 .TP
1984 .BI table " TABLEID"
1985 show the routes from this table(s).  The default setting is to show
1986 .BR table main "."
1987 .I TABLEID
1988 may either be the ID of a real table or one of the special values:
1989 .sp
1990 .in +8
1991 .B all
1992 - list all of the tables.
1993 .sp
1994 .B cache
1995 - dump the routing cache.
1996 .in -8
1997
1998 .TP
1999 .B cloned
2000 .TP
2001 .B cached
2002 list cloned routes i.e. routes which were dynamically forked from
2003 other routes because some route attribute (f.e. MTU) was updated.
2004 Actually, it is equivalent to
2005 .BR "table cache" "."
2006
2007 .TP
2008 .BI from " SELECTOR"
2009 the same syntax as for
2010 .BR to ","
2011 but it binds the source address range rather than destinations.
2012 Note that the
2013 .B from
2014 option only works with cloned routes.
2015
2016 .TP
2017 .BI protocol " RTPROTO"
2018 only list routes of this protocol.
2019
2020 .TP
2021 .BI scope " SCOPE_VAL"
2022 only list routes with this scope.
2023
2024 .TP
2025 .BI type " TYPE"
2026 only list routes of this type.
2027
2028 .TP
2029 .BI dev " NAME"
2030 only list routes going via this device.
2031
2032 .TP
2033 .BI via " PREFIX"
2034 only list routes going via the nexthop routers selected by
2035 .IR PREFIX "."
2036
2037 .TP
2038 .BI src " PREFIX"
2039 only list routes with preferred source addresses selected
2040 by
2041 .IR PREFIX "."
2042
2043 .TP
2044 .BI realm " REALMID"
2045 .TP
2046 .BI realms " FROMREALM/TOREALM"
2047 only list routes with these realms.
2048
2049 .SS ip route flush - flush routing tables
2050 this command flushes routes selected by some criteria.
2051
2052 .sp
2053 The arguments have the same syntax and semantics as the arguments of
2054 .BR "ip route show" ,
2055 but routing tables are not listed but purged.  The only difference is
2056 the default action:
2057 .B show
2058 dumps all the IP main routing table but
2059 .B flush
2060 prints the helper page.
2061
2062 .sp
2063 With the
2064 .B -statistics
2065 option, the command becomes verbose. It prints out the number of
2066 deleted routes and the number of rounds made to flush the routing
2067 table. If the option is given
2068 twice,
2069 .B ip route flush
2070 also dumps all the deleted routes in the format described in the
2071 previous subsection.
2072
2073 .SS ip route get - get a single route
2074 this command gets a single route to a destination and prints its
2075 contents exactly as the kernel sees it.
2076
2077 .TP
2078 .BI to " ADDRESS " (default)
2079 the destination address.
2080
2081 .TP
2082 .BI from " ADDRESS"
2083 the source address.
2084
2085 .TP
2086 .BI tos " TOS"
2087 .TP
2088 .BI dsfield " TOS"
2089 the Type Of Service.
2090
2091 .TP
2092 .BI iif " NAME"
2093 the device from which this packet is expected to arrive.
2094
2095 .TP
2096 .BI oif " NAME"
2097 force the output device on which this packet will be routed.
2098
2099 .TP
2100 .B connected
2101 if no source address
2102 .RB "(option " from ")"
2103 was given, relookup the route with the source set to the preferred
2104 address received from the first lookup.
2105 If policy routing is used, it may be a different route.
2106
2107 .P
2108 Note that this operation is not equivalent to
2109 .BR "ip route show" .
2110 .B show
2111 shows existing routes.
2112 .B get
2113 resolves them and creates new clones if necessary.  Essentially,
2114 .B get
2115 is equivalent to sending a packet along this path.
2116 If the
2117 .B iif
2118 argument is not given, the kernel creates a route
2119 to output packets towards the requested destination.
2120 This is equivalent to pinging the destination
2121 with a subsequent
2122 .BR "ip route ls cache" ,
2123 however, no packets are actually sent.  With the
2124 .B iif
2125 argument, the kernel pretends that a packet arrived from this interface
2126 and searches for a path to forward the packet.
2127
2128 .SS ip route save - save routing table information to stdout
2129 this command behaves like
2130 .BR "ip route show"
2131 except that the output is raw data suitable for passing to
2132 .BR "ip route restore" .
2133
2134 .SS ip route restore - restore routing table information from stdin
2135 this command expects to read a data stream as returned from
2136 .BR "ip route save" .
2137 It will attempt to restore the routing table information exactly as
2138 it was at the time of the save, so any translation of information
2139 in the stream (such as device indexes) must be done first.  Any existing
2140 routes are left unchanged.  Any routes specified in the data stream that
2141 already exist in the table will be ignored.
2142
2143 .SH ip rule - routing policy database management
2144
2145 .BR "Rule" s
2146 in the routing policy database control the route selection algorithm.
2147
2148 .P
2149 Classic routing algorithms used in the Internet make routing decisions
2150 based only on the destination address of packets (and in theory,
2151 but not in practice, on the TOS field).
2152
2153 .P
2154 In some circumstances we want to route packets differently depending not only
2155 on destination addresses, but also on other packet fields: source address,
2156 IP protocol, transport protocol ports or even packet payload.
2157 This task is called 'policy routing'.
2158
2159 .P
2160 To solve this task, the conventional destination based routing table, ordered
2161 according to the longest match rule, is replaced with a 'routing policy
2162 database' (or RPDB), which selects routes by executing some set of rules.
2163
2164 .P
2165 Each policy routing rule consists of a
2166 .B selector
2167 and an
2168 .B action predicate.
2169 The RPDB is scanned in the order of increasing priority. The selector
2170 of each rule is applied to {source address, destination address, incoming
2171 interface, tos, fwmark} and, if the selector matches the packet,
2172 the action is performed.  The action predicate may return with success.
2173 In this case, it will either give a route or failure indication
2174 and the RPDB lookup is terminated. Otherwise, the RPDB program
2175 continues on the next rule.
2176
2177 .P
2178 Semantically, natural action is to select the nexthop and the output device.
2179
2180 .P
2181 At startup time the kernel configures the default RPDB consisting of three
2182 rules:
2183
2184 .TP
2185 1.
2186 Priority: 0, Selector: match anything, Action: lookup routing
2187 table
2188 .B local
2189 (ID 255).
2190 The
2191 .B local
2192 table is a special routing table containing
2193 high priority control routes for local and broadcast addresses.
2194 .sp
2195 Rule 0 is special. It cannot be deleted or overridden.
2196
2197 .TP
2198 2.
2199 Priority: 32766, Selector: match anything, Action: lookup routing
2200 table
2201 .B main
2202 (ID 254).
2203 The
2204 .B main
2205 table is the normal routing table containing all non-policy
2206 routes. This rule may be deleted and/or overridden with other
2207 ones by the administrator.
2208
2209 .TP
2210 3.
2211 Priority: 32767, Selector: match anything, Action: lookup routing
2212 table
2213 .B default
2214 (ID 253).
2215 The
2216 .B default
2217 table is empty.  It is reserved for some post-processing if no previous
2218 default rules selected the packet.
2219 This rule may also be deleted.
2220
2221 .P
2222 Each RPDB entry has additional
2223 attributes.  F.e. each rule has a pointer to some routing
2224 table.  NAT and masquerading rules have an attribute to select new IP
2225 address to translate/masquerade.  Besides that, rules have some
2226 optional attributes, which routes have, namely
2227 .BR "realms" .
2228 These values do not override those contained in the routing tables.  They
2229 are only used if the route did not select any attributes.
2230
2231 .sp
2232 The RPDB may contain rules of the following types:
2233
2234 .in +8
2235 .B unicast
2236 - the rule prescribes to return the route found
2237 in the routing table referenced by the rule.
2238
2239 .B blackhole
2240 - the rule prescribes to silently drop the packet.
2241
2242 .B unreachable
2243 - the rule prescribes to generate a 'Network is unreachable' error.
2244
2245 .B prohibit
2246 - the rule prescribes to generate 'Communication is administratively
2247 prohibited' error.
2248
2249 .B nat
2250 - the rule prescribes to translate the source address
2251 of the IP packet into some other value.
2252 .in -8
2253
2254 .SS ip rule add - insert a new rule
2255 .SS ip rule delete - delete a rule
2256
2257 .TP
2258 .BI type " TYPE " (default)
2259 the type of this rule.  The list of valid types was given in the previous
2260 subsection.
2261
2262 .TP
2263 .BI from " PREFIX"
2264 select the source prefix to match.
2265
2266 .TP
2267 .BI to " PREFIX"
2268 select the destination prefix to match.
2269
2270 .TP
2271 .BI iif " NAME"
2272 select the incoming device to match.  If the interface is loopback,
2273 the rule only matches packets originating from this host.  This means
2274 that you may create separate routing tables for forwarded and local
2275 packets and, hence, completely segregate them.
2276
2277 .TP
2278 .BI oif " NAME"
2279 select the outgoing device to match.  The outgoing interface is only
2280 available for packets originating from local sockets that are bound to
2281 a device.
2282
2283 .TP
2284 .BI tos " TOS"
2285 .TP
2286 .BI dsfield " TOS"
2287 select the TOS value to match.
2288
2289 .TP
2290 .BI fwmark " MARK"
2291 select the
2292 .B fwmark
2293 value to match.
2294
2295 .TP
2296 .BI priority " PREFERENCE"
2297 the priority of this rule.  Each rule should have an explicitly
2298 set
2299 .I unique
2300 priority value.
2301 The options preference and order are synonyms with priority.
2302
2303 .TP
2304 .BI table " TABLEID"
2305 the routing table identifier to lookup if the rule selector matches.
2306 It is also possible to use lookup instead of table.
2307
2308 .TP
2309 .BI realms " FROM/TO"
2310 Realms to select if the rule matched and the routing table lookup
2311 succeeded.  Realm
2312 .I TO
2313 is only used if the route did not select any realm.
2314
2315 .TP
2316 .BI nat " ADDRESS"
2317 The base of the IP address block to translate (for source addresses).
2318 The
2319 .I ADDRESS
2320 may be either the start of the block of NAT addresses (selected by NAT
2321 routes) or a local host address (or even zero).
2322 In the last case the router does not translate the packets, but
2323 masquerades them to this address.
2324 Using map-to instead of nat means the same thing.
2325
2326 .B Warning:
2327 Changes to the RPDB made with these commands do not become active
2328 immediately.  It is assumed that after a script finishes a batch of
2329 updates, it flushes the routing cache with
2330 .BR "ip route flush cache" .
2331
2332 .SS ip rule flush - also dumps all the deleted rules.
2333 This command has no arguments.
2334
2335 .SS ip rule show - list rules
2336 This command has no arguments.
2337 The options list or lst are synonyms with show.
2338
2339 .SH ip maddress - multicast addresses management
2340
2341 .B maddress
2342 objects are multicast addresses.
2343
2344 .SS ip maddress show - list multicast addresses
2345
2346 .TP
2347 .BI dev " NAME " (default)
2348 the device name.
2349
2350 .SS ip maddress add - add a multicast address
2351 .SS ip maddress delete - delete a multicast address
2352 these commands attach/detach a static link layer multicast address
2353 to listen on the interface.
2354 Note that it is impossible to join protocol multicast groups
2355 statically.  This command only manages link layer addresses.
2356
2357 .TP
2358 .BI address " LLADDRESS " (default)
2359 the link layer multicast address.
2360
2361 .TP
2362 .BI dev " NAME"
2363 the device to join/leave this multicast address.
2364
2365 .SH ip mroute - multicast routing cache management
2366 .B mroute
2367 objects are multicast routing cache entries created by a user level
2368 mrouting daemon (f.e.
2369 .B pimd
2370 or
2371 .B mrouted
2372 ).
2373
2374 Due to the limitations of the current interface to the multicast routing
2375 engine, it is impossible to change
2376 .B mroute
2377 objects administratively, so we may only display them.  This limitation
2378 will be removed in the future.
2379
2380 .SS ip mroute show - list mroute cache entries
2381
2382 .TP
2383 .BI to " PREFIX " (default)
2384 the prefix selecting the destination multicast addresses to list.
2385
2386 .TP
2387 .BI iif " NAME"
2388 the interface on which multicast packets are received.
2389
2390 .TP
2391 .BI from " PREFIX"
2392 the prefix selecting the IP source addresses of the multicast route.
2393
2394 .SH ip tunnel - tunnel configuration
2395 .B tunnel
2396 objects are tunnels, encapsulating packets in IP packets and then
2397 sending them over the IP infrastructure.
2398 The encapulating (or outer) address family is specified by the
2399 .B -f
2400 option.  The default is IPv4.
2401
2402 .SS ip tunnel add - add a new tunnel
2403 .SS ip tunnel change - change an existing tunnel
2404 .SS ip tunnel delete - destroy a tunnel
2405
2406 .TP
2407 .BI name " NAME " (default)
2408 select the tunnel device name.
2409
2410 .TP
2411 .BI mode " MODE"
2412 set the tunnel mode. Available modes depend on the encapsulating address family.
2413 .br
2414 Modes for IPv4 encapsulation available:
2415 .BR ipip ", " sit ", " isatap " and " gre "."
2416 .br
2417 Modes for IPv6 encapsulation available:
2418 .BR ip6ip6 ", " ipip6 " and " any "."
2419
2420 .TP
2421 .BI remote " ADDRESS"
2422 set the remote endpoint of the tunnel.
2423
2424 .TP
2425 .BI local " ADDRESS"
2426 set the fixed local address for tunneled packets.
2427 It must be an address on another interface of this host.
2428
2429 .TP
2430 .BI ttl " N"
2431 set a fixed TTL
2432 .I N
2433 on tunneled packets.
2434 .I N
2435 is a number in the range 1--255. 0 is a special value
2436 meaning that packets inherit the TTL value.
2437 The default value for IPv4 tunnels is:
2438 .BR "inherit" .
2439 The default value for IPv6 tunnels is:
2440 .BR "64" .
2441
2442
2443 .TP
2444 .BI tos " T"
2445 .TP
2446 .BI dsfield " T"
2447 .TP
2448 .BI tclass " T"
2449 set a fixed TOS (or traffic class in IPv6)
2450 .I T
2451 on tunneled packets.
2452 The default value is:
2453 .BR "inherit" .
2454
2455 .TP
2456 .BI dev " NAME"
2457 bind the tunnel to the device
2458 .I NAME
2459 so that tunneled packets will only be routed via this device and will
2460 not be able to escape to another device when the route to endpoint
2461 changes.
2462
2463 .TP
2464 .B nopmtudisc
2465 disable Path MTU Discovery on this tunnel.
2466 It is enabled by default.  Note that a fixed ttl is incompatible
2467 with this option: tunnelling with a fixed ttl always makes pmtu
2468 discovery.
2469
2470 .TP
2471 .BI key " K"
2472 .TP
2473 .BI ikey " K"
2474 .TP
2475 .BI okey " K"
2476 .RB ( " only GRE tunnels " )
2477 use keyed GRE with key
2478 .IR K ". " K
2479 is either a number or an IP address-like dotted quad.
2480 The
2481 .B key
2482 parameter sets the key to use in both directions.
2483 The
2484 .BR ikey " and " okey
2485 parameters set different keys for input and output.
2486
2487 .TP
2488 .BR csum ", " icsum ", " ocsum
2489 .RB ( " only GRE tunnels " )
2490 generate/require checksums for tunneled packets.
2491 The
2492 .B ocsum
2493 flag calculates checksums for outgoing packets.
2494 The
2495 .B icsum
2496 flag requires that all input packets have the correct
2497 checksum.  The
2498 .B csum
2499 flag is equivalent to the combination
2500 .BR "icsum ocsum" .
2501
2502 .TP
2503 .BR seq ", " iseq ", " oseq
2504 .RB ( " only GRE tunnels " )
2505 serialize packets.
2506 The
2507 .B oseq
2508 flag enables sequencing of outgoing packets.
2509 The
2510 .B iseq
2511 flag requires that all input packets are serialized.
2512 The
2513 .B  seq
2514 flag is equivalent to the combination
2515 .BR "iseq oseq" .
2516 .B It isn't work. Don't use it.
2517
2518 .TP
2519 .BR "dscp inherit"
2520 .RB ( " only IPv6 tunnels " )
2521 Inherit DS field between inner and outer header.
2522
2523 .TP
2524 .BI encaplim " ELIM"
2525 .RB ( " only IPv6 tunnels " )
2526 set a fixed encapsulation limit.  Default is 4.
2527
2528 .TP
2529 .BI flowlabel " FLOWLABEL"
2530 .RB ( " only IPv6 tunnels " )
2531 set a fixed flowlabel.
2532
2533 .SS ip tunnel prl - potential router list (ISATAP only)
2534
2535 .TP
2536 .BI dev " NAME"
2537 mandatory device name.
2538
2539 .TP
2540 .BI prl-default " ADDR"
2541 .TP
2542 .BI prl-nodefault " ADDR"
2543 .TP
2544 .BI prl-delete " ADDR"
2545 .RB "Add or delete " ADDR
2546 as a potential router or default router.
2547
2548 .SS ip tunnel show - list tunnels
2549 This command has no arguments.
2550
2551 .SH ip monitor and rtmon - state monitoring
2552
2553 The
2554 .B ip
2555 utility can monitor the state of devices, addresses
2556 and routes continuously.  This option has a slightly different format.
2557 Namely, the
2558 .B monitor
2559 command is the first in the command line and then the object list follows:
2560
2561 .BR "ip monitor" " [ " all " |"
2562 .IR LISTofOBJECTS " ]"
2563
2564 .I OBJECT-LIST
2565 is the list of object types that we want to monitor.
2566 It may contain
2567 .BR link ", " address " and " route "."
2568 If no
2569 .B file
2570 argument is given,
2571 .B ip
2572 opens RTNETLINK, listens on it and dumps state changes in the format
2573 described in previous sections.
2574
2575 .P
2576 If a file name is given, it does not listen on RTNETLINK,
2577 but opens the file containing RTNETLINK messages saved in binary format
2578 and dumps them.  Such a history file can be generated with the
2579 .B rtmon
2580 utility.  This utility has a command line syntax similar to
2581 .BR "ip monitor" .
2582 Ideally,
2583 .B rtmon
2584 should be started before the first network configuration command
2585 is issued. F.e. if you insert:
2586 .sp
2587 .in +8
2588 rtmon file /var/log/rtmon.log
2589 .in -8
2590 .sp
2591 in a startup script, you will be able to view the full history
2592 later.
2593
2594 .P
2595 Certainly, it is possible to start
2596 .B rtmon
2597 at any time.
2598 It prepends the history with the state snapshot dumped at the moment
2599 of starting.
2600
2601 .SH ip netns - process network namespace management
2602
2603 A network namespace is logically another copy of the network stack,
2604 with it's own routes, firewall rules, and network devices.
2605
2606 By convention a named network namespace is an object at
2607 .BR "/var/run/netns/" NAME
2608 that can be opened.  The file descriptor resulting from opening
2609 .BR "/var/run/netns/" NAME
2610 refers to the specified network namespace.  Holding that file
2611 descriptor open keeps the network namespace alive.  The file
2612 descriptor can be used with the
2613 .B setns(2)
2614 system call to change the network namespace associated with a task.
2615
2616 The convention for network namespace aware applications is to look
2617 for global network configuration files first in
2618 .BR "/etc/netns/" NAME "/"
2619 then in
2620 .BR "/etc/".
2621 For example, if you want a different version of
2622 .BR /etc/resolv.conf
2623 for a network namespace used to isolate your vpn you would name it
2624 .BR /etc/netns/myvpn/resolv.conf.
2625
2626 .B ip netns exec
2627 automates handling of this configuration, file convention for network
2628 namespace unaware applications, by creating a mount namespace and
2629 bind mounting all of the per network namespace configure files into
2630 their traditional location in /etc.
2631
2632 .SS ip netns list - show all of the named network namespaces
2633 .SS ip netns add NAME - create a new named network namespace
2634 .SS ip netns delete NAME - delete the name of a network namespace
2635 .SS ip netns exec NAME cmd ... - Run cmd in the named network namespace
2636
2637 .SH ip xfrm - transform configuration
2638 xfrm is an IP framework for transforming packets (such as encrypting
2639 their payloads). This framework is used to implement the IPsec protocol
2640 suite (with the
2641 .B state
2642 object operating on the Security Association Database, and the
2643 .B policy
2644 object operating on the Security Policy Database). It is also used for
2645 the IP Payload Compression Protocol and features of Mobile IPv6.
2646
2647 .SS ip xfrm state add - add new state into xfrm
2648
2649 .SS ip xfrm state update - update existing state in xfrm
2650
2651 .SS ip xfrm state allocspi - allocate an SPI value
2652
2653 .SS ip xfrm state delete - delete existing state in xfrm
2654
2655 .SS ip xfrm state get - get existing state in xfrm
2656
2657 .SS ip xfrm state deleteall - delete all existing state in xfrm
2658
2659 .SS ip xfrm state list - print out the list of existing state in xfrm
2660
2661 .SS ip xfrm state flush - flush all state in xfrm
2662
2663 .SS ip xfrm state count - count all existing state in xfrm
2664
2665 .TP
2666 .IR ID
2667 is specified by a source address, destination address,
2668 .RI "transform protocol " XFRM-PROTO ","
2669 and/or Security Parameter Index
2670 .IR SPI "."
2671
2672 .TP
2673 .I XFRM-PROTO
2674 specifies a transform protocol:
2675 .RB "IPsec Encapsulating Security Payload (" esp "),"
2676 .RB "IPsec Authentication Header (" ah "),"
2677 .RB "IP Payload Compression (" comp "),"
2678 .RB "Mobile IPv6 Type 2 Routing Header (" route2 "), or"
2679 .RB "Mobile IPv6 Home Address Option (" hao ")."
2680
2681 .TP
2682 .I ALGO-LIST
2683 specifies one or more algorithms
2684 .IR ALGO
2685 to use. Algorithm types include
2686 .RB "encryption (" enc "),"
2687 .RB "authentication (" auth "),"
2688 .RB "authentication with a specified truncation length (" auth-trunc "),"
2689 .RB "authenticated encryption with associated data (" aead "), and"
2690 .RB "compression (" comp ")."
2691 For each algorithm used, the algorithm type, the algorithm name
2692 .IR ALGO-NAME ","
2693 and the key
2694 .I ALGO-KEY
2695 must be specified. For
2696 .BR aead ","
2697 the Integrity Check Value length
2698 .I ALGO-ICV-LEN
2699 must additionally be specified.
2700 For
2701 .BR auth-trunc ","
2702 the signature truncation length
2703 .I ALGO-TRUNC-LEN
2704 must additionally be specified.
2705
2706 .TP
2707 .I MODE
2708 specifies a mode of operation:
2709 .RB "IPsec transport mode (" transport "), "
2710 .RB "IPsec tunnel mode (" tunnel "), "
2711 .RB "Mobile IPv6 route optimization mode (" ro "), "
2712 .RB "Mobile IPv6 inbound trigger mode (" in_trigger "), or "
2713 .RB "IPsec ESP Bound End-to-End Tunnel Mode (" beet ")."
2714
2715 .TP
2716 .I FLAG-LIST
2717 contains one or more of the following optional flags:
2718 .BR noecn ", " decap-dscp ", " nopmtudisc ", " wildrecv ", " icmp ", "
2719 .BR af-unspec ", or " align4 "."
2720
2721 .TP
2722 .IR SELECTOR
2723 selects the traffic that will be controlled by the policy, based on the source
2724 address, the destination address, the network device, and/or
2725 .IR UPSPEC "."
2726
2727 .TP
2728 .IR UPSPEC
2729 selects traffic by protocol. For the
2730 .BR tcp ", " udp ", " sctp ", or " dccp
2731 protocols, the source and destination port can optionally be specified.
2732 For the
2733 .BR icmp ", " ipv6-icmp ", or " mobility-header
2734 protocols, the type and code numbers can optionally be specified.
2735 For the
2736 .B gre
2737 protocol, the key can optionally be specified as a dotted-quad or number.
2738 Other protocols can be selected by name or number
2739 .IR PROTO "."
2740
2741 .TP
2742 .I LIMIT-LIST
2743 sets limits in seconds, bytes, or numbers of packets.
2744
2745 .TP
2746 .I ENCAP
2747 encapsulates packets with protocol
2748 .BR espinudp " or " espinudp-nonike ","
2749 .RI "using source port " SPORT ", destination port "  DPORT
2750 .RI ", and original address " OADDR "."
2751
2752 .SS ip xfrm policy add - add a new policy
2753
2754 .SS ip xfrm policy update - update an existing policy
2755
2756 .SS ip xfrm policy delete - delete an existing policy
2757
2758 .SS ip xfrm policy get - get an existing policy
2759
2760 .SS ip xfrm policy deleteall - delete all existing xfrm policies
2761
2762 .SS ip xfrm policy list - print out the list of xfrm policies
2763
2764 .SS ip xfrm policy flush - flush policies
2765
2766 .SS ip xfrm policy count - count existing policies
2767
2768 .TP
2769 .IR SELECTOR
2770 selects the traffic that will be controlled by the policy, based on the source
2771 address, the destination address, the network device, and/or
2772 .IR UPSPEC "."
2773
2774 .TP
2775 .IR UPSPEC
2776 selects traffic by protocol. For the
2777 .BR tcp ", " udp ", " sctp ", or " dccp
2778 protocols, the source and destination port can optionally be specified.
2779 For the
2780 .BR icmp ", " ipv6-icmp ", or " mobility-header
2781 protocols, the type and code numbers can optionally be specified.
2782 For the
2783 .B gre
2784 protocol, the key can optionally be specified as a dotted-quad or number.
2785 Other protocols can be selected by name or number
2786 .IR PROTO "."
2787
2788 .TP
2789 .I DIR
2790 selects the policy direction as
2791 .BR in ", " out ", or " fwd "."
2792
2793 .TP
2794 .I CTX
2795 sets the security context.
2796
2797 .TP
2798 .I PTYPE
2799 can be
2800 .BR main " (default) or " sub "."
2801
2802 .TP
2803 .I ACTION
2804 can be
2805 .BR allow " (default) or " block "."
2806
2807 .TP
2808 .I PRIORITY
2809 is a number that defaults to zero.
2810
2811 .TP
2812 .I FLAG-LIST
2813 contains one or both of the following optional flags:
2814 .BR local " or " icmp "."
2815
2816 .TP
2817 .I LIMIT-LIST
2818 sets limits in seconds, bytes, or numbers of packets.
2819
2820 .TP
2821 .I TMPL-LIST
2822 is a template list specified using
2823 .IR ID ", " MODE ", " REQID ", and/or " LEVEL ". "
2824
2825 .TP
2826 .IR ID
2827 is specified by a source address, destination address,
2828 .RI "transform protocol " XFRM-PROTO ","
2829 and/or Security Parameter Index
2830 .IR SPI "."
2831
2832 .TP
2833 .I XFRM-PROTO
2834 specifies a transform protocol:
2835 .RB "IPsec Encapsulating Security Payload (" esp "),"
2836 .RB "IPsec Authentication Header (" ah "),"
2837 .RB "IP Payload Compression (" comp "),"
2838 .RB "Mobile IPv6 Type 2 Routing Header (" route2 "), or"
2839 .RB "Mobile IPv6 Home Address Option (" hao ")."
2840
2841 .TP
2842 .I MODE
2843 specifies a mode of operation:
2844 .RB "IPsec transport mode (" transport "), "
2845 .RB "IPsec tunnel mode (" tunnel "), "
2846 .RB "Mobile IPv6 route optimization mode (" ro "), "
2847 .RB "Mobile IPv6 inbound trigger mode (" in_trigger "), or "
2848 .RB "IPsec ESP Bound End-to-End Tunnel Mode (" beet ")."
2849
2850 .TP
2851 .I LEVEL
2852 can be
2853 .BR required " (default) or " use "."
2854
2855 .SS ip xfrm monitor - state monitoring for xfrm objects
2856 The xfrm objects to monitor can be optionally specified.
2857
2858 .SH HISTORY
2859 .B ip
2860 was written by Alexey N. Kuznetsov and added in Linux 2.2.
2861 .SH SEE ALSO
2862 .BR tc (8)
2863 .br
2864 .RB "IP Command reference " ip-cref.ps
2865 .br
2866 .RB "IP tunnels " ip-cref.ps
2867 .br
2868 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
2869
2870 .SH AUTHOR
2871 Original Manpage  by Michail Litvak <mci@owl.openwall.com>