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