]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blob - man/man8/ip.8
ip: print "temporary" for IPv6 temp addresses
[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 " | " temporary " ]"
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 NHFLAGS " := [ "
217 .BR onlink " | " pervasive " ]"
218
219 .ti -8
220 .IR RTPROTO " := [ "
221 .BR kernel " | " boot " | " static " |"
222 .IR NUMBER " ]"
223
224 .ti -8
225 .B  ip rule
226 .RB " [ " list " | " add " | " del " | " flush " ]"
227 .I  SELECTOR ACTION
228
229 .ti -8
230 .IR SELECTOR " := [ "
231 .B  from
232 .IR PREFIX " ] [ "
233 .B  to
234 .IR PREFIX " ] [ "
235 .B  tos
236 .IR TOS " ] [ "
237 .B  fwmark
238 .IR FWMARK[/MASK] " ] [ "
239 .B  iif
240 .IR STRING " ] [ "
241 .B  oif
242 .IR STRING " ] [ "
243 .B  pref
244 .IR NUMBER " ]"
245
246 .ti -8
247 .IR ACTION " := [ "
248 .B  table
249 .IR TABLE_ID " ] [ "
250 .B  nat
251 .IR ADDRESS " ] [ "
252 .BR prohibit " | " reject " | " unreachable " ] [ " realms
253 .RI "[" SRCREALM "/]" DSTREALM " ]"
254
255 .ti -8
256 .IR TABLE_ID " := [ "
257 .BR local " | " main " | " default " |"
258 .IR NUMBER " ]"
259
260 .ti -8
261 .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
262 .IR ADDR " [ "
263 .B  lladdr
264 .IR LLADDR " ] [ "
265 .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
266 .IR ADDR " } [ "
267 .B  dev
268 .IR DEV " ]"
269
270 .ti -8
271 .BR "ip neigh" " { " show " | " flush " } [ " to
272 .IR PREFIX " ] [ "
273 .B  dev
274 .IR DEV " ] [ "
275 .B  nud
276 .IR STATE " ]"
277
278 .ti -8
279 .BR "ip tunnel" " { " add " | " change " | " del " | " show " | " prl " }"
280 .RI "[ " NAME " ]"
281 .br
282 .RB "[ " mode
283 .IR MODE " ] [ "
284 .B remote
285 .IR ADDR " ] [ "
286 .B  local
287 .IR ADDR " ]"
288 .br
289 .RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
290 .IR KEY " ] [ "
291 .RB "[" i "|" o "]" csum " ] ]"
292 .br
293 .RB "[ " encaplimit
294 .IR ELIM " ]"
295 .RB "[ " ttl
296 .IR TTL " ]"
297 .br
298 .RB "[ " tos
299 .IR TOS " ] [ "
300 .B flowlabel
301 .IR FLOWLABEL " ]"
302 .br
303 .RB "[ " prl-default
304 .IR ADDR " ] [ "
305 .B prl-nodefault
306 .IR ADDR " ] [ "
307 .B prl-delete
308 .IR ADDR " ]"
309 .br
310 .RB "[ [" no "]" pmtudisc " ]"
311 .RB "[ " dev
312 .IR PHYS_DEV " ]"
313 .RB "[ " "dscp inherit" " ]"
314
315 .ti -8
316 .IR MODE " := "
317 .RB " { " ipip " | " gre " | " sit " | " isatap " | " ip6ip6 " | " ipip6 " | " any " }"
318
319 .ti -8
320 .IR ADDR " := { " IP_ADDRESS " |"
321 .BR any " }"
322
323 .ti -8
324 .IR TOS " := { " NUMBER " |"
325 .BR inherit " }"
326
327 .ti -8
328 .IR ELIM " := {
329 .BR none " | "
330 .IR 0 ".." 255 " }"
331
332 .ti -8
333 .ti -8
334 .IR TTL " := { " 1 ".." 255 " | "
335 .BR inherit " }"
336
337 .ti -8
338 .IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"
339
340 .ti -8
341 .IR TIME " := " NUMBER "[s|ms|us|ns|j]"
342
343 .ti -8
344 .BR "ip maddr" " [ " add " | " del " ]"
345 .IB MULTIADDR " dev " STRING
346
347 .ti -8
348 .BR "ip maddr show" " [ " dev
349 .IR STRING " ]"
350
351 .ti -8
352 .BR "ip mroute show" " ["
353 .IR PREFIX " ] [ "
354 .B  from
355 .IR PREFIX " ] [ "
356 .B  iif
357 .IR DEVICE " ]"
358
359 .ti -8
360 .BR "ip monitor" " [ " all " |"
361 .IR LISTofOBJECTS " ]"
362
363 .ti -8
364 .BR "ip xfrm"
365 .IR XFRM_OBJECT " { " COMMAND " }"
366
367 .ti -8
368 .IR XFRM_OBJECT " := { " state " | " policy " | " monitor " } "
369
370 .ti -8
371 .BR "ip xfrm state " { " add " | " update " } "
372 .IR ID " [ "
373 .IR XFRM_OPT " ] "
374 .RB " [ " mode
375 .IR MODE " ] "
376 .br
377 .RB " [ " reqid
378 .IR REQID " ] "
379 .RB " [ " seq
380 .IR SEQ " ] "
381 .RB " [ " replay-window
382 .IR SIZE " ] "
383 .br
384 .RB " [ " flag
385 .IR FLAG-LIST " ] "
386 .RB " [ " encap
387 .IR ENCAP " ] "
388 .RB " [ " sel
389 .IR SELECTOR " ] "
390 .br
391 .RB " [ "
392 .IR LIMIT-LIST " ] "
393
394 .ti -8
395 .BR "ip xfrm state allocspi "
396 .IR ID
397 .RB " [ " mode
398 .IR MODE " ] "
399 .RB " [ " reqid
400 .IR REQID " ] "
401 .RB " [ " seq
402 .IR SEQ " ] "
403 .RB " [ " min
404 .IR SPI
405 .B max
406 .IR SPI " ] "
407
408 .ti -8
409 .BR "ip xfrm state" " { " delete " | " get " } "
410 .IR ID
411
412 .ti -8
413 .BR "ip xfrm state" " { " deleteall " | " list " } [ "
414 .IR ID " ] "
415 .RB " [ " mode
416 .IR MODE " ] "
417 .br
418 .RB " [ " reqid
419 .IR REQID " ] "
420 .RB " [ " flag
421 .IR FLAG_LIST " ] "
422
423 .ti -8
424 .BR "ip xfrm state flush" " [ " proto
425 .IR XFRM_PROTO " ] "
426
427 .ti -8
428 .BR "ip xfrm state count"
429
430 .ti -8
431 .IR ID " := "
432 .RB " [ " src
433 .IR ADDR " ] "
434 .RB " [ " dst
435 .IR ADDR " ] "
436 .RB " [ " proto
437 .IR XFRM_PROTO " ] "
438 .RB " [ " spi
439 .IR SPI " ] "
440
441 .ti -8
442 .IR XFRM_PROTO " := "
443 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
444
445 .ti -8
446 .IR MODE " := "
447 .RB " [ " transport " | " tunnel " | " ro " | " beet " ] "
448 .B (default=transport)
449
450 .ti -8
451 .IR FLAG-LIST " := "
452 .RI " [ " FLAG-LIST " ] " FLAG
453
454 .ti -8
455 .IR FLAG " := "
456 .RB " [ " noecn " | " decap-dscp " | " wildrecv " ] "
457
458 .ti -8
459 .IR ENCAP " := " ENCAP-TYPE " " SPORT " " DPORT " " OADDR
460
461 .ti -8
462 .IR ENCAP-TYPE " := "
463 .B espinudp
464 .RB " | "
465 .B espinudp-nonike
466
467 .ti -8
468 .IR ALGO-LIST " := [ "
469 .IR ALGO-LIST " ] | [ "
470 .IR ALGO " ] "
471
472 .ti -8
473 .IR ALGO " := "
474 .IR ALGO_TYPE
475 .IR ALGO_NAME
476 .IR ALGO_KEY
477
478 .ti -8
479 .IR ALGO_TYPE " := "
480 .RB " [ " enc " | " auth " | " comp " ] "
481
482 .ti -8
483 .IR SELECTOR " := "
484 .B src
485 .IR ADDR "[/" PLEN "]"
486 .B dst
487 .IR ADDR "[/" PLEN "]"
488 .RI " [ " UPSPEC " ] "
489 .RB " [ " dev
490 .IR DEV " ] "
491
492 .ti -8
493 .IR UPSPEC " := "
494 .B proto
495 .IR PROTO " [[ "
496 .B sport
497 .IR PORT " ] "
498 .RB " [ " dport
499 .IR PORT " ] | "
500 .br
501 .RB " [ " type
502 .IR NUMBER " ] "
503 .RB " [ " code
504 .IR NUMBER " ]] "
505
506 .ti -8
507 .IR LIMIT-LIST " := [ " LIMIT-LIST " ] |"
508 .RB " [ "limit
509 .IR LIMIT " ] "
510
511 .ti -8
512 .IR LIMIT " := "
513 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
514 .IR SECONDS " ] | "
515 .RB "[ ["byte-soft "|" byte-hard "]"
516 .IR SIZE " ] | "
517 .br
518 .RB " [ ["packet-soft "|" packet-hard "]"
519 .IR COUNT " ] "
520
521 .ti -8
522 .BR "ip xfrm policy" " { " add " | " update " } " " dir "
523 .IR DIR
524 .IR SELECTOR " [ "
525 .BR index
526 .IR INDEX " ] "
527 .br
528 .RB " [ " ptype
529 .IR PTYPE " ] "
530 .RB " [ " action
531 .IR ACTION " ] "
532 .RB " [ " priority
533 .IR PRIORITY " ] "
534 .br
535 .RI " [ " LIMIT-LIST " ] [ "
536 .IR TMPL-LIST " ] "
537
538 .ti -8
539 .BR "ip xfrm policy" " { " delete " | " get " } " " dir "
540 .IR DIR " [ " SELECTOR " | "
541 .BR index
542 .IR INDEX
543 .RB " ] "
544 .br
545 .RB " [ " ptype
546 .IR PTYPE " ] "
547
548 .ti -8
549 .BR "ip xfrm policy" " { " deleteall " | " list " } "
550 .RB " [ " dir
551 .IR DIR " ] [ "
552 .IR SELECTOR " ] "
553 .br
554 .RB " [ " index
555 .IR INDEX " ] "
556 .RB " [ " action
557 .IR ACTION " ] "
558 .RB " [ " priority
559 .IR PRIORITY " ] "
560
561 .ti -8
562 .B "ip xfrm policy flush"
563 .RB " [ " ptype
564 .IR PTYPE " ] "
565
566 .ti -8
567 .B "ip xfrm count"
568
569 .ti -8
570 .IR PTYPE " := "
571 .RB " [ " main " | " sub " ] "
572 .B (default=main)
573
574 .ti -8
575 .IR DIR " := "
576 .RB " [ " in " | " out " | " fwd " ] "
577
578 .ti -8
579 .IR SELECTOR " := "
580 .B src
581 .IR ADDR "[/" PLEN "]"
582 .B dst
583 .IR ADDR "[/" PLEN] " [ " UPSPEC
584 .RB " ] [ " dev
585 .IR DEV " ] "
586
587 .ti -8
588 .IR UPSPEC " := "
589 .B proto
590 .IR PROTO " [ "
591 .RB " [ " sport
592 .IR PORT " ] "
593 .RB " [ " dport
594 .IR PORT " ] | "
595 .br
596 .RB " [ " type
597 .IR NUMBER " ] "
598 .RB " [ " code
599 .IR NUMBER " ] ] "
600
601 .ti -8
602 .IR ACTION " := "
603 .RB " [ " allow " | " block " ]"
604 .B (default=allow)
605
606 .ti -8
607 .IR LIMIT-LIST " := "
608 .RB " [ "
609 .IR LIMIT-LIST " ] | "
610 .RB " [ " limit
611 .IR LIMIT " ] "
612
613 .ti -8
614 .IR LIMIT " := "
615 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
616 .IR SECONDS " ] | "
617 .RB " [ [" byte-soft "|" byte-hard "]"
618 .IR SIZE " ] | "
619 .br [ "
620 .RB "[" packet-soft "|" packet-hard "]"
621 .IR NUMBER " ] "
622
623 .ti -8
624 .IR TMPL-LIST " := "
625 .B " [ "
626 .IR TMPL-LIST " ] | "
627 .RB " [ " tmpl
628 .IR TMPL " ] "
629
630 .ti -8
631 .IR TMPL " := "
632 .IR ID " [ "
633 .B mode
634 .IR MODE " ] "
635 .RB " [ " reqid
636 .IR REQID " ] "
637 .RB " [ " level
638 .IR LEVEL " ] "
639
640 .ti -8
641 .IR ID " := "
642 .RB " [ " src
643 .IR ADDR " ] "
644 .RB " [ " dst
645 .IR ADDR " ] "
646 .RB " [ " proto
647 .IR XFRM_PROTO " ] "
648 .RB " [ " spi
649 .IR SPI " ] "
650
651 .ti -8
652 .IR XFRM_PROTO " := "
653 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
654
655 .ti -8
656 .IR MODE " := "
657 .RB " [ " transport " | " tunnel " | " beet " ] "
658 .B (default=transport)
659
660 .ti -8
661 .IR LEVEL " := "
662 .RB " [ " required " | " use " ] "
663 .B (default=required)
664
665 .ti -8
666 .BR "ip xfrm monitor" " [ " all " | "
667 .IR LISTofOBJECTS " ] "
668
669 .in -8
670 .ad b
671
672 .SH OPTIONS
673
674 .TP
675 .BR "\-V" , " -Version"
676 print the version of the
677 .B ip
678 utility and exit.
679
680 .TP
681 .BR "\-s" , " \-stats", " \-statistics"
682 output more information.  If the option
683 appears twice or more, the amount of information increases.
684 As a rule, the information is statistics or some time values.
685
686 .TP
687 .BR "\-f" , " \-family"
688 followed by protocol family identifier:
689 .BR "inet" , " inet6"
690 or
691 .B link
692 ,enforce the protocol family to use.  If the option is not present,
693 the protocol family is guessed from other arguments.  If the rest
694 of the command line does not give enough information to guess the
695 family,
696 .B ip
697 falls back to the default one, usually
698 .B inet
699 or
700 .BR "any" .
701 .B link
702 is a special family identifier meaning that no networking protocol
703 is involved.
704
705 .TP
706 .B \-4
707 shortcut for
708 .BR "-family inet" .
709
710 .TP
711 .B \-6
712 shortcut for
713 .BR "\-family inet6" .
714
715 .TP
716 .B \-0
717 shortcut for
718 .BR "\-family link" .
719
720 .TP
721 .BR "\-o" , " \-oneline"
722 output each record on a single line, replacing line feeds
723 with the
724 .B '\e\'
725 character. This is convenient when you want to count records
726 with
727 .BR wc (1)
728  or to
729 .BR grep (1)
730 the output.
731
732 .TP
733 .BR "\-r" , " \-resolve"
734 use the system's name resolver to print DNS names instead of
735 host addresses.
736
737 .SH IP - COMMAND SYNTAX
738
739 .SS
740 .I OBJECT
741
742 .TP
743 .B link
744 - network device.
745
746 .TP
747 .B address
748 - protocol (IP or IPv6) address on a device.
749
750 .TP
751 .B addrlabel
752 - label configuration for protocol address selection.
753
754 .TP
755 .B neighbour
756 - ARP or NDISC cache entry.
757
758 .TP
759 .B route
760 - routing table entry.
761
762 .TP
763 .B rule
764 - rule in routing policy database.
765
766 .TP
767 .B maddress
768 - multicast address.
769
770 .TP
771 .B mroute
772 - multicast routing cache entry.
773
774 .TP
775 .B tunnel
776 - tunnel over IP.
777
778 .TP
779 .B xfrm
780 - framework for IPsec protocol.
781
782 .PP
783 The names of all objects may be written in full or
784 abbreviated form, f.e.
785 .B address
786 is abbreviated as
787 .B addr
788 or just
789 .B a.
790
791 .SS
792 .I COMMAND
793
794 Specifies the action to perform on the object.
795 The set of possible actions depends on the object type.
796 As a rule, it is possible to
797 .BR "add" , " delete"
798 and
799 .B show
800 (or
801 .B list
802 ) objects, but some objects do not allow all of these operations
803 or have some additional commands.  The
804 .B help
805 command is available for all objects.  It prints
806 out a list of available commands and argument syntax conventions.
807 .sp
808 If no command is given, some default command is assumed.
809 Usually it is
810 .B list
811 or, if the objects of this class cannot be listed,
812 .BR "help" .
813
814 .SH ip link - network device configuration
815
816 .B link
817 is a network device and the corresponding commands
818 display and change the state of devices.
819
820 .SS ip link set - change device attributes
821
822 .TP
823 .BI dev " NAME " (default)
824 .I NAME
825 specifies network device to operate on.
826
827 .TP
828 .BR up " and " down
829 change the state of the device to
830 .B UP
831 or
832 .BR "DOWN" .
833
834 .TP
835 .BR "arp on " or " arp off"
836 change the
837 .B NOARP
838 flag on the device.
839
840 .TP
841 .BR "multicast on " or " multicast off"
842 change the
843 .B MULTICAST
844 flag on the device.
845
846 .TP
847 .BR "dynamic on " or " dynamic off"
848 change the
849 .B DYNAMIC
850 flag on the device.
851
852 .TP
853 .BI name " NAME"
854 change the name of the device.  This operation is not
855 recommended if the device is running or has some addresses
856 already configured.
857
858 .TP
859 .BI txqueuelen " NUMBER"
860 .TP
861 .BI txqlen " NUMBER"
862 change the transmit queue length of the device.
863
864 .TP
865 .BI mtu " NUMBER"
866 change the
867 .I MTU
868 of the device.
869
870 .TP
871 .BI address " LLADDRESS"
872 change the station address of the interface.
873
874 .TP
875 .BI broadcast " LLADDRESS"
876 .TP
877 .BI brd " LLADDRESS"
878 .TP
879 .BI peer " LLADDRESS"
880 change the link layer broadcast address or the peer address when
881 the interface is
882 .IR "POINTOPOINT" .
883
884 .TP
885 .BI netns " PID"
886 move the device to the network namespace associated with the process
887 .IR "PID" .
888
889 .PP
890 .B Warning:
891 If multiple parameter changes are requested,
892 .B ip
893 aborts immediately after any of the changes have failed.
894 This is the only case when
895 .B ip
896 can move the system to an unpredictable state.  The solution
897 is to avoid changing several parameters with one
898 .B ip link set
899 call.
900
901 .SS  ip link show - display device attributes
902
903 .TP
904 .BI dev " NAME " (default)
905 .I NAME
906 specifies the network device to show.
907 If this argument is omitted all devices are listed.
908
909 .TP
910 .B up
911 only display running interfaces.
912
913 .SH ip address - protocol address management.
914
915 The
916 .B address
917 is a protocol (IP or IPv6) address attached
918 to a network device.  Each device must have at least one address
919 to use the corresponding protocol.  It is possible to have several
920 different addresses attached to one device.  These addresses are not
921 discriminated, so that the term
922 .B alias
923 is not quite appropriate for them and we do not use it in this document.
924 .sp
925 The
926 .B ip addr
927 command displays addresses and their properties, adds new addresses
928 and deletes old ones.
929
930 .SS ip address add - add new protocol address.
931
932 .TP
933 .BI dev " NAME"
934 the name of the device to add the address to.
935
936 .TP
937 .BI local " ADDRESS " (default)
938 the address of the interface. The format of the address depends
939 on the protocol. It is a dotted quad for IP and a sequence of
940 hexadecimal halfwords separated by colons for IPv6.  The
941 .I ADDRESS
942 may be followed by a slash and a decimal number which encodes
943 the network prefix length.
944
945 .TP
946 .BI peer " ADDRESS"
947 the address of the remote endpoint for pointopoint interfaces.
948 Again, the
949 .I ADDRESS
950 may be followed by a slash and a decimal number, encoding the network
951 prefix length.  If a peer address is specified, the local address
952 cannot have a prefix length.  The network prefix is associated
953 with the peer rather than with the local address.
954
955 .TP
956 .BI broadcast " ADDRESS"
957 the broadcast address on the interface.
958 .sp
959 It is possible to use the special symbols
960 .B '+'
961 and
962 .B '-'
963 instead of the broadcast address.  In this case, the broadcast address
964 is derived by setting/resetting the host bits of the interface prefix.
965
966 .TP
967 .BI label " NAME"
968 Each address may be tagged with a label string.
969 In order to preserve compatibility with Linux-2.0 net aliases,
970 this string must coincide with the name of the device or must be prefixed
971 with the device name followed by colon.
972
973 .TP
974 .BI scope " SCOPE_VALUE"
975 the scope of the area where this address is valid.
976 The available scopes are listed in file
977 .BR "/etc/iproute2/rt_scopes" .
978 Predefined scope values are:
979
980 .in +8
981 .B global
982 - the address is globally valid.
983 .sp
984 .B site
985 - (IPv6 only) the address is site local, i.e. it is
986 valid inside this site.
987 .sp
988 .B link
989 - the address is link local, i.e. it is valid only on this device.
990 .sp
991 .B host
992 - the address is valid only inside this host.
993 .in -8
994
995 .SS ip address delete - delete protocol address
996 .B Arguments:
997 coincide with the arguments of
998 .B ip addr add.
999 The device name is a required argument.  The rest are optional.
1000 If no arguments are given, the first address is deleted.
1001
1002 .SS ip address show - look at protocol addresses
1003
1004 .TP
1005 .BI dev " NAME " (default)
1006 name of device.
1007
1008 .TP
1009 .BI scope " SCOPE_VAL"
1010 only list addresses with this scope.
1011
1012 .TP
1013 .BI to " PREFIX"
1014 only list addresses matching this prefix.
1015
1016 .TP
1017 .BI label " PATTERN"
1018 only list addresses with labels matching the
1019 .IR "PATTERN" .
1020 .I PATTERN
1021 is a usual shell style pattern.
1022
1023 .TP
1024 .BR dynamic " and " permanent
1025 (IPv6 only) only list addresses installed due to stateless
1026 address configuration or only list permanent (not dynamic)
1027 addresses.
1028
1029 .TP
1030 .B tentative
1031 (IPv6 only) only list addresses which have not yet passed duplicate
1032 address detection.
1033
1034 .TP
1035 .B deprecated
1036 (IPv6 only) only list deprecated addresses.
1037
1038 .TP
1039 .B dadfailed
1040 (IPv6 only) only list addresses which have failed duplicate
1041 address detection.
1042
1043 .TP
1044 .B temporary
1045 (IPv6 only) only list temporary addresses.
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 .SS ip route delete - delete route
1600
1601 .B ip route del
1602 has the same arguments as
1603 .BR "ip route add" ,
1604 but their semantics are a bit different.
1605
1606 Key values
1607 .RB "(" to ", " tos ", " preference " and " table ")"
1608 select the route to delete.  If optional attributes are present,
1609 .B ip
1610 verifies that they coincide with the attributes of the route to delete.
1611 If no route with the given key and attributes was found,
1612 .B ip route del
1613 fails.
1614
1615 .SS ip route show - list routes
1616 the command displays the contents of the routing tables or the route(s)
1617 selected by some criteria.
1618
1619 .TP
1620 .BI to " SELECTOR " (default)
1621 only select routes from the given range of destinations.
1622 .I SELECTOR
1623 consists of an optional modifier
1624 .RB "(" root ", " match " or " exact ")"
1625 and a prefix.
1626 .BI root " PREFIX"
1627 selects routes with prefixes not shorter than
1628 .IR PREFIX "."
1629 F.e.
1630 .BI root " 0/0"
1631 selects the entire routing table.
1632 .BI match " PREFIX"
1633 selects routes with prefixes not longer than
1634 .IR PREFIX "."
1635 F.e.
1636 .BI match " 10.0/16"
1637 selects
1638 .IR 10.0/16 ","
1639 .IR 10/8 " and " 0/0 ,
1640 but it does not select
1641 .IR 10.1/16 " and " 10.0.0/24 .
1642 And
1643 .BI exact " PREFIX"
1644 (or just
1645 .IR PREFIX ")"
1646 selects routes with this exact prefix. If neither of these options
1647 are present,
1648 .B ip
1649 assumes
1650 .BI root " 0/0"
1651 i.e. it lists the entire table.
1652
1653 .TP
1654 .BI tos " TOS"
1655 .BI dsfield " TOS"
1656 only select routes with the given TOS.
1657
1658 .TP
1659 .BI table " TABLEID"
1660 show the routes from this table(s).  The default setting is to show
1661 .BR table main "."
1662 .I TABLEID
1663 may either be the ID of a real table or one of the special values:
1664 .sp
1665 .in +8
1666 .B all
1667 - list all of the tables.
1668 .sp
1669 .B cache
1670 - dump the routing cache.
1671 .in -8
1672
1673 .TP
1674 .B cloned
1675 .TP
1676 .B cached
1677 list cloned routes i.e. routes which were dynamically forked from
1678 other routes because some route attribute (f.e. MTU) was updated.
1679 Actually, it is equivalent to
1680 .BR "table cache" "."
1681
1682 .TP
1683 .BI from " SELECTOR"
1684 the same syntax as for
1685 .BR to ","
1686 but it binds the source address range rather than destinations.
1687 Note that the
1688 .B from
1689 option only works with cloned routes.
1690
1691 .TP
1692 .BI protocol " RTPROTO"
1693 only list routes of this protocol.
1694
1695 .TP
1696 .BI scope " SCOPE_VAL"
1697 only list routes with this scope.
1698
1699 .TP
1700 .BI type " TYPE"
1701 only list routes of this type.
1702
1703 .TP
1704 .BI dev " NAME"
1705 only list routes going via this device.
1706
1707 .TP
1708 .BI via " PREFIX"
1709 only list routes going via the nexthop routers selected by
1710 .IR PREFIX "."
1711
1712 .TP
1713 .BI src " PREFIX"
1714 only list routes with preferred source addresses selected
1715 by
1716 .IR PREFIX "."
1717
1718 .TP
1719 .BI realm " REALMID"
1720 .TP
1721 .BI realms " FROMREALM/TOREALM"
1722 only list routes with these realms.
1723
1724 .SS ip route flush - flush routing tables
1725 this command flushes routes selected by some criteria.
1726
1727 .sp
1728 The arguments have the same syntax and semantics as the arguments of
1729 .BR "ip route show" ,
1730 but routing tables are not listed but purged.  The only difference is
1731 the default action:
1732 .B show
1733 dumps all the IP main routing table but
1734 .B flush
1735 prints the helper page.
1736
1737 .sp
1738 With the
1739 .B -statistics
1740 option, the command becomes verbose. It prints out the number of
1741 deleted routes and the number of rounds made to flush the routing
1742 table. If the option is given
1743 twice,
1744 .B ip route flush
1745 also dumps all the deleted routes in the format described in the
1746 previous subsection.
1747
1748 .SS ip route get - get a single route
1749 this command gets a single route to a destination and prints its
1750 contents exactly as the kernel sees it.
1751
1752 .TP
1753 .BI to " ADDRESS " (default)
1754 the destination address.
1755
1756 .TP
1757 .BI from " ADDRESS"
1758 the source address.
1759
1760 .TP
1761 .BI tos " TOS"
1762 .TP
1763 .BI dsfield " TOS"
1764 the Type Of Service.
1765
1766 .TP
1767 .BI iif " NAME"
1768 the device from which this packet is expected to arrive.
1769
1770 .TP
1771 .BI oif " NAME"
1772 force the output device on which this packet will be routed.
1773
1774 .TP
1775 .B connected
1776 if no source address
1777 .RB "(option " from ")"
1778 was given, relookup the route with the source set to the preferred
1779 address received from the first lookup.
1780 If policy routing is used, it may be a different route.
1781
1782 .P
1783 Note that this operation is not equivalent to
1784 .BR "ip route show" .
1785 .B show
1786 shows existing routes.
1787 .B get
1788 resolves them and creates new clones if necessary.  Essentially,
1789 .B get
1790 is equivalent to sending a packet along this path.
1791 If the
1792 .B iif
1793 argument is not given, the kernel creates a route
1794 to output packets towards the requested destination.
1795 This is equivalent to pinging the destination
1796 with a subsequent
1797 .BR "ip route ls cache" ,
1798 however, no packets are actually sent.  With the
1799 .B iif
1800 argument, the kernel pretends that a packet arrived from this interface
1801 and searches for a path to forward the packet.
1802
1803 .SH ip rule - routing policy database management
1804
1805 .BR "Rule" s
1806 in the routing policy database control the route selection algorithm.
1807
1808 .P
1809 Classic routing algorithms used in the Internet make routing decisions
1810 based only on the destination address of packets (and in theory,
1811 but not in practice, on the TOS field).
1812
1813 .P
1814 In some circumstances we want to route packets differently depending not only
1815 on destination addresses, but also on other packet fields: source address,
1816 IP protocol, transport protocol ports or even packet payload.
1817 This task is called 'policy routing'.
1818
1819 .P
1820 To solve this task, the conventional destination based routing table, ordered
1821 according to the longest match rule, is replaced with a 'routing policy
1822 database' (or RPDB), which selects routes by executing some set of rules.
1823
1824 .P
1825 Each policy routing rule consists of a
1826 .B selector
1827 and an
1828 .B action predicate.
1829 The RPDB is scanned in the order of increasing priority. The selector
1830 of each rule is applied to {source address, destination address, incoming
1831 interface, tos, fwmark} and, if the selector matches the packet,
1832 the action is performed.  The action predicate may return with success.
1833 In this case, it will either give a route or failure indication
1834 and the RPDB lookup is terminated. Otherwise, the RPDB program
1835 continues on the next rule.
1836
1837 .P
1838 Semantically, natural action is to select the nexthop and the output device.
1839
1840 .P
1841 At startup time the kernel configures the default RPDB consisting of three
1842 rules:
1843
1844 .TP
1845 1.
1846 Priority: 0, Selector: match anything, Action: lookup routing
1847 table
1848 .B local
1849 (ID 255).
1850 The
1851 .B local
1852 table is a special routing table containing
1853 high priority control routes for local and broadcast addresses.
1854 .sp
1855 Rule 0 is special. It cannot be deleted or overridden.
1856
1857 .TP
1858 2.
1859 Priority: 32766, Selector: match anything, Action: lookup routing
1860 table
1861 .B main
1862 (ID 254).
1863 The
1864 .B main
1865 table is the normal routing table containing all non-policy
1866 routes. This rule may be deleted and/or overridden with other
1867 ones by the administrator.
1868
1869 .TP
1870 3.
1871 Priority: 32767, Selector: match anything, Action: lookup routing
1872 table
1873 .B default
1874 (ID 253).
1875 The
1876 .B default
1877 table is empty.  It is reserved for some post-processing if no previous
1878 default rules selected the packet.
1879 This rule may also be deleted.
1880
1881 .P
1882 Each RPDB entry has additional
1883 attributes.  F.e. each rule has a pointer to some routing
1884 table.  NAT and masquerading rules have an attribute to select new IP
1885 address to translate/masquerade.  Besides that, rules have some
1886 optional attributes, which routes have, namely
1887 .BR "realms" .
1888 These values do not override those contained in the routing tables.  They
1889 are only used if the route did not select any attributes.
1890
1891 .sp
1892 The RPDB may contain rules of the following types:
1893
1894 .in +8
1895 .B unicast
1896 - the rule prescribes to return the route found
1897 in the routing table referenced by the rule.
1898
1899 .B blackhole
1900 - the rule prescribes to silently drop the packet.
1901
1902 .B unreachable
1903 - the rule prescribes to generate a 'Network is unreachable' error.
1904
1905 .B prohibit
1906 - the rule prescribes to generate 'Communication is administratively
1907 prohibited' error.
1908
1909 .B nat
1910 - the rule prescribes to translate the source address
1911 of the IP packet into some other value.
1912 .in -8
1913
1914 .SS ip rule add - insert a new rule
1915 .SS ip rule delete - delete a rule
1916
1917 .TP
1918 .BI type " TYPE " (default)
1919 the type of this rule.  The list of valid types was given in the previous
1920 subsection.
1921
1922 .TP
1923 .BI from " PREFIX"
1924 select the source prefix to match.
1925
1926 .TP
1927 .BI to " PREFIX"
1928 select the destination prefix to match.
1929
1930 .TP
1931 .BI iif " NAME"
1932 select the incoming device to match.  If the interface is loopback,
1933 the rule only matches packets originating from this host.  This means
1934 that you may create separate routing tables for forwarded and local
1935 packets and, hence, completely segregate them.
1936
1937 .TP
1938 .BI oif " NAME"
1939 select the outgoing device to match.  The outgoing interface is only
1940 available for packets originating from local sockets that are bound to
1941 a device.
1942
1943 .TP
1944 .BI tos " TOS"
1945 .TP
1946 .BI dsfield " TOS"
1947 select the TOS value to match.
1948
1949 .TP
1950 .BI fwmark " MARK"
1951 select the
1952 .B fwmark
1953 value to match.
1954
1955 .TP
1956 .BI priority " PREFERENCE"
1957 the priority of this rule.  Each rule should have an explicitly
1958 set
1959 .I unique
1960 priority value.
1961 The options preference and order are synonyms with priority.
1962
1963 .TP
1964 .BI table " TABLEID"
1965 the routing table identifier to lookup if the rule selector matches.
1966 It is also possible to use lookup instead of table.
1967
1968 .TP
1969 .BI realms " FROM/TO"
1970 Realms to select if the rule matched and the routing table lookup
1971 succeeded.  Realm
1972 .I TO
1973 is only used if the route did not select any realm.
1974
1975 .TP
1976 .BI nat " ADDRESS"
1977 The base of the IP address block to translate (for source addresses).
1978 The
1979 .I ADDRESS
1980 may be either the start of the block of NAT addresses (selected by NAT
1981 routes) or a local host address (or even zero).
1982 In the last case the router does not translate the packets, but
1983 masquerades them to this address.
1984 Using map-to instead of nat means the same thing.
1985
1986 .B Warning:
1987 Changes to the RPDB made with these commands do not become active
1988 immediately.  It is assumed that after a script finishes a batch of
1989 updates, it flushes the routing cache with
1990 .BR "ip route flush cache" .
1991
1992 .SS ip rule flush - also dumps all the deleted rules.
1993 This command has no arguments.
1994
1995 .SS ip rule show - list rules
1996 This command has no arguments.
1997 The options list or lst are synonyms with show.
1998
1999 .SH ip maddress - multicast addresses management
2000
2001 .B maddress
2002 objects are multicast addresses.
2003
2004 .SS ip maddress show - list multicast addresses
2005
2006 .TP
2007 .BI dev " NAME " (default)
2008 the device name.
2009
2010 .SS ip maddress add - add a multicast address
2011 .SS ip maddress delete - delete a multicast address
2012 these commands attach/detach a static link layer multicast address
2013 to listen on the interface.
2014 Note that it is impossible to join protocol multicast groups
2015 statically.  This command only manages link layer addresses.
2016
2017 .TP
2018 .BI address " LLADDRESS " (default)
2019 the link layer multicast address.
2020
2021 .TP
2022 .BI dev " NAME"
2023 the device to join/leave this multicast address.
2024
2025 .SH ip mroute - multicast routing cache management
2026 .B mroute
2027 objects are multicast routing cache entries created by a user level
2028 mrouting daemon (f.e.
2029 .B pimd
2030 or
2031 .B mrouted
2032 ).
2033
2034 Due to the limitations of the current interface to the multicast routing
2035 engine, it is impossible to change
2036 .B mroute
2037 objects administratively, so we may only display them.  This limitation
2038 will be removed in the future.
2039
2040 .SS ip mroute show - list mroute cache entries
2041
2042 .TP
2043 .BI to " PREFIX " (default)
2044 the prefix selecting the destination multicast addresses to list.
2045
2046 .TP
2047 .BI iif " NAME"
2048 the interface on which multicast packets are received.
2049
2050 .TP
2051 .BI from " PREFIX"
2052 the prefix selecting the IP source addresses of the multicast route.
2053
2054 .SH ip tunnel - tunnel configuration
2055 .B tunnel
2056 objects are tunnels, encapsulating packets in IP packets and then
2057 sending them over the IP infrastructure.
2058 The encapulating (or outer) address family is specified by the
2059 .B -f
2060 option.  The default is IPv4.
2061
2062 .SS ip tunnel add - add a new tunnel
2063 .SS ip tunnel change - change an existing tunnel
2064 .SS ip tunnel delete - destroy a tunnel
2065
2066 .TP
2067 .BI name " NAME " (default)
2068 select the tunnel device name.
2069
2070 .TP
2071 .BI mode " MODE"
2072 set the tunnel mode. Available modes depend on the encapsulating address family.
2073 .br
2074 Modes for IPv4 encapsulation available:
2075 .BR ipip ", " sit ", " isatap " and " gre "."
2076 .br
2077 Modes for IPv6 encapsulation available:
2078 .BR ip6ip6 ", " ipip6 " and " any "."
2079
2080 .TP
2081 .BI remote " ADDRESS"
2082 set the remote endpoint of the tunnel.
2083
2084 .TP
2085 .BI local " ADDRESS"
2086 set the fixed local address for tunneled packets.
2087 It must be an address on another interface of this host.
2088
2089 .TP
2090 .BI ttl " N"
2091 set a fixed TTL
2092 .I N
2093 on tunneled packets.
2094 .I N
2095 is a number in the range 1--255. 0 is a special value
2096 meaning that packets inherit the TTL value.
2097 The default value for IPv4 tunnels is:
2098 .BR "inherit" .
2099 The default value for IPv6 tunnels is:
2100 .BR "64" .
2101
2102
2103 .TP
2104 .BI tos " T"
2105 .TP
2106 .BI dsfield " T"
2107 .TP
2108 .BI tclass " T"
2109 set a fixed TOS (or traffic class in IPv6)
2110 .I T
2111 on tunneled packets.
2112 The default value is:
2113 .BR "inherit" .
2114
2115 .TP
2116 .BI dev " NAME"
2117 bind the tunnel to the device
2118 .I NAME
2119 so that tunneled packets will only be routed via this device and will
2120 not be able to escape to another device when the route to endpoint
2121 changes.
2122
2123 .TP
2124 .B nopmtudisc
2125 disable Path MTU Discovery on this tunnel.
2126 It is enabled by default.  Note that a fixed ttl is incompatible
2127 with this option: tunnelling with a fixed ttl always makes pmtu
2128 discovery.
2129
2130 .TP
2131 .BI key " K"
2132 .TP
2133 .BI ikey " K"
2134 .TP
2135 .BI okey " K"
2136 .RB ( " only GRE tunnels " )
2137 use keyed GRE with key
2138 .IR K ". " K
2139 is either a number or an IP address-like dotted quad.
2140 The
2141 .B key
2142 parameter sets the key to use in both directions.
2143 The
2144 .BR ikey " and " okey
2145 parameters set different keys for input and output.
2146
2147 .TP
2148 .BR csum ", " icsum ", " ocsum
2149 .RB ( " only GRE tunnels " )
2150 generate/require checksums for tunneled packets.
2151 The
2152 .B ocsum
2153 flag calculates checksums for outgoing packets.
2154 The
2155 .B icsum
2156 flag requires that all input packets have the correct
2157 checksum.  The
2158 .B csum
2159 flag is equivalent to the combination
2160 .BR "icsum ocsum" .
2161
2162 .TP
2163 .BR seq ", " iseq ", " oseq
2164 .RB ( " only GRE tunnels " )
2165 serialize packets.
2166 The
2167 .B oseq
2168 flag enables sequencing of outgoing packets.
2169 The
2170 .B iseq
2171 flag requires that all input packets are serialized.
2172 The
2173 .B  seq
2174 flag is equivalent to the combination
2175 .BR "iseq oseq" .
2176 .B It isn't work. Don't use it.
2177
2178 .TP
2179 .BR "dscp inherit"
2180 .RB ( " only IPv6 tunnels " )
2181 Inherit DS field between inner and outer header.
2182
2183 .TP
2184 .BI encaplim " ELIM"
2185 .RB ( " only IPv6 tunnels " )
2186 set a fixed encapsulation limit.  Default is 4.
2187
2188 .TP
2189 .BI flowlabel " FLOWLABEL"
2190 .RB ( " only IPv6 tunnels " )
2191 set a fixed flowlabel.
2192
2193 .SS ip tunnel prl - potential router list (ISATAP only)
2194
2195 .TP
2196 .BI dev " NAME"
2197 mandatory device name.
2198
2199 .TP
2200 .BI prl-default " ADDR"
2201 .TP
2202 .BI prl-nodefault " ADDR"
2203 .TP
2204 .BI prl-delete " ADDR"
2205 .RB "Add or delete " ADDR
2206 as a potential router or default router.
2207
2208 .SS ip tunnel show - list tunnels
2209 This command has no arguments.
2210
2211 .SH ip monitor and rtmon - state monitoring
2212
2213 The
2214 .B ip
2215 utility can monitor the state of devices, addresses
2216 and routes continuously.  This option has a slightly different format.
2217 Namely, the
2218 .B monitor
2219 command is the first in the command line and then the object list follows:
2220
2221 .BR "ip monitor" " [ " all " |"
2222 .IR LISTofOBJECTS " ]"
2223
2224 .I OBJECT-LIST
2225 is the list of object types that we want to monitor.
2226 It may contain
2227 .BR link ", " address " and " route "."
2228 If no
2229 .B file
2230 argument is given,
2231 .B ip
2232 opens RTNETLINK, listens on it and dumps state changes in the format
2233 described in previous sections.
2234
2235 .P
2236 If a file name is given, it does not listen on RTNETLINK,
2237 but opens the file containing RTNETLINK messages saved in binary format
2238 and dumps them.  Such a history file can be generated with the
2239 .B rtmon
2240 utility.  This utility has a command line syntax similar to
2241 .BR "ip monitor" .
2242 Ideally,
2243 .B rtmon
2244 should be started before the first network configuration command
2245 is issued. F.e. if you insert:
2246 .sp
2247 .in +8
2248 rtmon file /var/log/rtmon.log
2249 .in -8
2250 .sp
2251 in a startup script, you will be able to view the full history
2252 later.
2253
2254 .P
2255 Certainly, it is possible to start
2256 .B rtmon
2257 at any time.
2258 It prepends the history with the state snapshot dumped at the moment
2259 of starting.
2260
2261 .SH ip xfrm - setting xfrm
2262 xfrm is an IP framework, which can transform format of the datagrams,
2263 .br
2264 i.e. encrypt the packets with some algorithm. xfrm policy and xfrm state
2265 are associated through templates
2266 .IR TMPL_LIST "."
2267 This framework is used as a part of IPsec protocol.
2268
2269 .SS ip xfrm state add - add new state into xfrm
2270
2271 .SS ip xfrm state update - update existing xfrm state
2272
2273 .SS ip xfrm state allocspi - allocate SPI value
2274
2275 .TP
2276 .I MODE
2277 is set as default to
2278 .BR transport ","
2279 but it could be set to
2280 .BR tunnel "," ro " or " beet "."
2281
2282 .TP
2283 .I FLAG-LIST
2284 contains one or more flags.
2285
2286 .TP
2287 .I FLAG
2288 could be set to
2289 .BR noecn ", " decap-dscp " or " wildrecv "."
2290
2291 .TP
2292 .I ENCAP
2293 encapsulation is set to encapsulation type
2294 .IR ENCAP-TYPE ", source port " SPORT ", destination port "  DPORT " and " OADDR "."
2295
2296 .TP
2297 .I ENCAP-TYPE
2298 could be set to
2299 .BR espinudp " or " espinudp-nonike "."
2300
2301 .TP
2302 .I ALGO-LIST
2303 contains one or more algorithms
2304 .I ALGO
2305 which depend on the type of algorithm set by
2306 .IR ALGO_TYPE "."
2307 It can be used these algoritms
2308 .BR enc ", " auth " or " comp "."
2309
2310 .SS ip xfrm policy add - add a new policy
2311
2312 .SS ip xfrm policy update - update an existing policy
2313
2314 .SS ip xfrm policy delete - delete existing policy
2315
2316 .SS ip xfrm policy get - get existing policy
2317
2318 .SS ip xfrm policy deleteall - delete all existing xfrm policy
2319
2320 .SS ip xfrm policy list - print out the list of xfrm policy
2321
2322 .SS ip xfrm policy flush - flush policies
2323 It can be flush
2324 .BR all
2325 policies or only those specified with
2326 .BR ptype "."
2327
2328 .TP
2329 .BI dir " DIR "
2330 directory could be one of these:
2331 .BR "inp", " out " or " fwd".
2332
2333 .TP
2334 .IR SELECTOR
2335 selects for which addresses will be set up the policy. The selector
2336 is defined by source and destination address.
2337
2338 .TP
2339 .IR UPSPEC
2340 is defined by source port
2341 .BR sport ", "
2342 destination port
2343 .BR dport ", " type
2344 as number and
2345 .B code
2346 also number.
2347
2348 .TP
2349 .BI dev " DEV "
2350 specify network device.
2351
2352 .TP
2353 .BI index " INDEX "
2354 the number of indexed policy.
2355
2356 .TP
2357 .BI ptype " PTYPE "
2358 type is set as default on
2359 .BR "main" ,
2360 could be switch on
2361 .BR "sub" .
2362
2363 .TP
2364 .BI action " ACTION "
2365 is set as default on
2366 .BR "allow".
2367 It could be switch on
2368 .BR "block".
2369
2370 .TP
2371 .BI priority " PRIORITY "
2372 priority is a number. Default priority is set on zero.
2373
2374 .TP
2375 .IR LIMIT-LIST
2376 limits are set in seconds, bytes or numbers of packets.
2377
2378 .TP
2379 .IR TMPL-LIST
2380 template list is based on
2381 .IR ID ","
2382 .BR mode ", " reqid " and " level ". "
2383
2384 .TP
2385 .IR ID
2386 is specified by source address, destination address,
2387 .I proto
2388 and value of
2389 .IR spi "."
2390
2391 .TP
2392 .IR XFRM_PROTO
2393 values:
2394 .BR esp ", " ah ", " comp ", " route2 " or " hao "."
2395
2396 .TP
2397 .IR MODE
2398 is set as default on
2399 .BR transport ","
2400 but it could be set on
2401 .BR tunnel " or " beet "."
2402
2403 .TP
2404 .IR LEVEL
2405 is set as default on
2406 .BR required
2407 and the other choice is
2408 .BR use "."
2409
2410 .TP
2411 .IR UPSPEC
2412 is specified by
2413 .BR sport ", "
2414 .BR dport ", " type
2415 and
2416 .B code
2417 (NUMBER).
2418
2419 .SS ip xfrm monitor - is used for listing all objects or defined group of them.
2420 The
2421 .B xfrm monitor
2422 can monitor the policies for all objects or defined group of them.
2423
2424 .SH HISTORY
2425 .B ip
2426 was written by Alexey N. Kuznetsov and added in Linux 2.2.
2427 .SH SEE ALSO
2428 .BR tc (8)
2429 .br
2430 .RB "IP Command reference " ip-cref.ps
2431 .br
2432 .RB "IP tunnels " ip-cref.ps
2433 .br
2434 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
2435
2436 .SH AUTHOR
2437 Original Manpage  by Michail Litvak <mci@owl.openwall.com>