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