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