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