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