]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/blob - man/man8/ip.8
iproute2: drop equalize support
[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 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 .BR primary " and " secondary
1045 only list primary (or secondary) addresses.
1046
1047 .SS ip address flush - flush protocol addresses
1048 This command flushes the protocol addresses selected by some criteria.
1049
1050 .PP
1051 This command has the same arguments as
1052 .B show.
1053 The difference is that it does not run when no arguments are given.
1054
1055 .PP
1056 .B Warning:
1057 This command (and other
1058 .B flush
1059 commands described below) is pretty dangerous.  If you make a mistake,
1060 it will not forgive it, but will cruelly purge all the addresses.
1061
1062 .PP
1063 With the
1064 .B -statistics
1065 option, the command becomes verbose. It prints out the number of deleted
1066 addresses and the number of rounds made to flush the address list.  If
1067 this option is given twice,
1068 .B ip addr flush
1069 also dumps all the deleted addresses in the format described in the
1070 previous subsection.
1071
1072 .SH ip addrlabel - protocol address label management.
1073
1074 IPv6 address label is used for address selection
1075 described in RFC 3484.  Precedence is managed by userspace,
1076 and only label is stored in kernel.
1077
1078 .SS ip addrlabel add - add an address label
1079 the command adds an address label entry to the kernel.
1080 .TP
1081 .BI prefix " PREFIX"
1082 .TP
1083 .BI dev " DEV"
1084 the outgoing interface.
1085 .TP
1086 .BI label " NUMBER"
1087 the label for the prefix.
1088 0xffffffff is reserved.
1089 .SS ip addrlabel del - delete an address label
1090 the command deletes an address label entry in the kernel.
1091 .B Arguments:
1092 coincide with the arguments of
1093 .B ip addrlabel add
1094 but label is not required.
1095 .SS ip addrlabel list - list address labels
1096 the command show contents of address labels.
1097 .SS ip addrlabel flush - flush address labels
1098 the command flushes the contents of address labels and it does not restore default settings.
1099 .SH ip neighbour - neighbour/arp tables management.
1100
1101 .B neighbour
1102 objects establish bindings between protocol addresses and
1103 link layer addresses for hosts sharing the same link.
1104 Neighbour entries are organized into tables. The IPv4 neighbour table
1105 is known by another name - the ARP table.
1106
1107 .P
1108 The corresponding commands display neighbour bindings
1109 and their properties, add new neighbour entries and delete old ones.
1110
1111 .SS ip neighbour add - add a new neighbour entry
1112 .SS ip neighbour change - change an existing entry
1113 .SS ip neighbour replace - add a new entry or change an existing one
1114
1115 These commands create new neighbour records or update existing ones.
1116
1117 .TP
1118 .BI to " ADDRESS " (default)
1119 the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
1120
1121 .TP
1122 .BI dev " NAME"
1123 the interface to which this neighbour is attached.
1124
1125 .TP
1126 .BI lladdr " LLADDRESS"
1127 the link layer address of the neighbour.
1128 .I LLADDRESS
1129 can also be
1130 .BR "null" .
1131
1132 .TP
1133 .BI nud " NUD_STATE"
1134 the state of the neighbour entry.
1135 .B nud
1136 is an abbreviation for 'Neigh bour Unreachability Detection'.
1137 The state can take one of the following values:
1138
1139 .in +8
1140 .B permanent
1141 - the neighbour entry is valid forever and can be only
1142 be removed administratively.
1143 .sp
1144
1145 .B noarp
1146 - the neighbour entry is valid. No attempts to validate
1147 this entry will be made but it can be removed when its lifetime expires.
1148 .sp
1149
1150 .B reachable
1151 - the neighbour entry is valid until the reachability
1152 timeout expires.
1153 .sp
1154
1155 .B stale
1156 - the neighbour entry is valid but suspicious.
1157 This option to
1158 .B ip neigh
1159 does not change the neighbour state if it was valid and the address
1160 is not changed by this command.
1161 .in -8
1162
1163 .SS ip neighbour delete - delete a neighbour entry
1164 This command invalidates a neighbour entry.
1165
1166 .PP
1167 The arguments are the same as with
1168 .BR "ip neigh add" ,
1169 except that
1170 .B lladdr
1171 and
1172 .B nud
1173 are ignored.
1174
1175 .PP
1176 .B Warning:
1177 Attempts to delete or manually change a
1178 .B noarp
1179 entry created by the kernel may result in unpredictable behaviour.
1180 Particularly, the kernel may try to resolve this address even
1181 on a
1182 .B NOARP
1183 interface or if the address is multicast or broadcast.
1184
1185 .SS ip neighbour show - list neighbour entries
1186
1187 This commands displays neighbour tables.
1188
1189 .TP
1190 .BI to " ADDRESS " (default)
1191 the prefix selecting the neighbours to list.
1192
1193 .TP
1194 .BI dev " NAME"
1195 only list the neighbours attached to this device.
1196
1197 .TP
1198 .B unused
1199 only list neighbours which are not currently in use.
1200
1201 .TP
1202 .BI nud " NUD_STATE"
1203 only list neighbour entries in this state.
1204 .I NUD_STATE
1205 takes values listed below or the special value
1206 .B all
1207 which means all states.  This option may occur more than once.
1208 If this option is absent,
1209 .B ip
1210 lists all entries except for
1211 .B none
1212 and
1213 .BR "noarp" .
1214
1215 .SS ip neighbour flush - flush neighbour entries
1216 This command flushes neighbour tables, selecting
1217 entries to flush by some criteria.
1218
1219 .PP
1220 This command has the same arguments as
1221 .B show.
1222 The differences are that it does not run when no arguments are given,
1223 and that the default neighbour states to be flushed do not include
1224 .B permanent
1225 and
1226 .BR "noarp" .
1227
1228 .PP
1229 With the
1230 .B -statistics
1231 option, the command becomes verbose.  It prints out the number of
1232 deleted neighbours and the number of rounds made to flush the
1233 neighbour table.  If the option is given
1234 twice,
1235 .B ip neigh flush
1236 also dumps all the deleted neighbours.
1237
1238 .SH ip route - routing table management
1239 Manipulate route entries in the kernel routing tables keep
1240 information about paths to other networked nodes.
1241 .sp
1242 .B Route types:
1243
1244 .in +8
1245 .B unicast
1246 - the route entry describes real paths to the destinations covered
1247 by the route prefix.
1248
1249 .sp
1250 .B unreachable
1251 - these destinations are unreachable.  Packets are discarded and the
1252 ICMP message
1253 .I host unreachable
1254 is generated.
1255 The local senders get an
1256 .I EHOSTUNREACH
1257 error.
1258
1259 .sp
1260 .B blackhole
1261 - these destinations are unreachable.  Packets are discarded silently.
1262 The local senders get an
1263 .I EINVAL
1264 error.
1265
1266 .sp
1267 .B prohibit
1268 - these destinations are unreachable.  Packets are discarded and the
1269 ICMP message
1270 .I communication administratively prohibited
1271 is generated.  The local senders get an
1272 .I EACCES
1273 error.
1274
1275 .sp
1276 .B local
1277 - the destinations are assigned to this host.  The packets are looped
1278 back and delivered locally.
1279
1280 .sp
1281 .B broadcast
1282 - the destinations are broadcast addresses.  The packets are sent as
1283 link broadcasts.
1284
1285 .sp
1286 .B throw
1287 - a special control route used together with policy rules. If such a
1288 route is selected, lookup in this table is terminated pretending that
1289 no route was found.  Without policy routing it is equivalent to the
1290 absence of the route in the routing table.  The packets are dropped
1291 and the ICMP message
1292 .I net unreachable
1293 is generated.  The local senders get an
1294 .I ENETUNREACH
1295 error.
1296
1297 .sp
1298 .B nat
1299 - a special NAT route.  Destinations covered by the prefix
1300 are considered to be dummy (or external) addresses which require translation
1301 to real (or internal) ones before forwarding.  The addresses to translate to
1302 are selected with the attribute
1303 .B Warning:
1304 Route NAT is no longer supported in Linux 2.6.
1305
1306
1307 .BR "via" .
1308 .sp
1309 .B anycast
1310 .RI "- " "not implemented"
1311 the destinations are
1312 .I anycast
1313 addresses assigned to this host.  They are mainly equivalent
1314 to
1315 .B local
1316 with one difference: such addresses are invalid when used
1317 as the source address of any packet.
1318
1319 .sp
1320 .B multicast
1321 - a special type used for multicast routing.  It is not present in
1322 normal routing tables.
1323 .in -8
1324
1325 .P
1326 .B Route tables:
1327 Linux-2.x can pack routes into several routing
1328 tables identified by a number in the range from 1 to 255 or by
1329 name from the file
1330 .B /etc/iproute2/rt_tables
1331 By default all normal routes are inserted into the
1332 .B main
1333 table (ID 254) and the kernel only uses this table when calculating routes.
1334
1335 .sp
1336 Actually, one other table always exists, which is invisible but
1337 even more important.  It is the
1338 .B local
1339 table (ID 255).  This table
1340 consists of routes for local and broadcast addresses.  The kernel maintains
1341 this table automatically and the administrator usually need not modify it
1342 or even look at it.
1343
1344 The multiple routing tables enter the game when
1345 .I policy routing
1346 is used.
1347
1348 .SS ip route add - add new route
1349 .SS ip route change - change route
1350 .SS ip route replace - change or add new one
1351
1352 .TP
1353 .BI to " TYPE PREFIX " (default)
1354 the destination prefix of the route.  If
1355 .I TYPE
1356 is omitted,
1357 .B ip
1358 assumes type
1359 .BR "unicast" .
1360 Other values of
1361 .I TYPE
1362 are listed above.
1363 .I PREFIX
1364 is an IP or IPv6 address optionally followed by a slash and the
1365 prefix length.  If the length of the prefix is missing,
1366 .B ip
1367 assumes a full-length host route.  There is also a special
1368 .I PREFIX
1369 .B default
1370 - which is equivalent to IP
1371 .B 0/0
1372 or to IPv6
1373 .BR "::/0" .
1374
1375 .TP
1376 .BI tos " TOS"
1377 .TP
1378 .BI dsfield " TOS"
1379 the Type Of Service (TOS) key.  This key has no associated mask and
1380 the longest match is understood as: First, compare the TOS
1381 of the route and of the packet.  If they are not equal, then the packet
1382 may still match a route with a zero TOS.
1383 .I TOS
1384 is either an 8 bit hexadecimal number or an identifier
1385 from
1386 .BR "/etc/iproute2/rt_dsfield" .
1387
1388 .TP
1389 .BI metric " NUMBER"
1390 .TP
1391 .BI preference " NUMBER"
1392 the preference value of the route.
1393 .I NUMBER
1394 is an arbitrary 32bit number.
1395
1396 .TP
1397 .BI table " TABLEID"
1398 the table to add this route to.
1399 .I TABLEID
1400 may be a number or a string from the file
1401 .BR "/etc/iproute2/rt_tables" .
1402 If this parameter is omitted,
1403 .B ip
1404 assumes the
1405 .B main
1406 table, with the exception of
1407 .BR local " , " broadcast " and " nat
1408 routes, which are put into the
1409 .B local
1410 table by default.
1411
1412 .TP
1413 .BI dev " NAME"
1414 the output device name.
1415
1416 .TP
1417 .BI via " ADDRESS"
1418 the address of the nexthop router.  Actually, the sense of this field
1419 depends on the route type.  For normal
1420 .B unicast
1421 routes it is either the true next hop router or, if it is a direct
1422 route installed in BSD compatibility mode, it can be a local address
1423 of the interface.  For NAT routes it is the first address of the block
1424 of translated IP destinations.
1425
1426 .TP
1427 .BI src " ADDRESS"
1428 the source address to prefer when sending to the destinations
1429 covered by the route prefix.
1430
1431 .TP
1432 .BI realm " REALMID"
1433 the realm to which this route is assigned.
1434 .I REALMID
1435 may be a number or a string from the file
1436 .BR "/etc/iproute2/rt_realms" .
1437
1438 .TP
1439 .BI mtu " MTU"
1440 .TP
1441 .BI "mtu lock" " MTU"
1442 the MTU along the path to the destination.  If the modifier
1443 .B lock
1444 is not used, the MTU may be updated by the kernel due to
1445 Path MTU Discovery.  If the modifier
1446 .B lock
1447 is used, no path MTU discovery will be tried, all packets
1448 will be sent without the DF bit in IPv4 case or fragmented
1449 to MTU for IPv6.
1450
1451 .TP
1452 .BI window " NUMBER"
1453 the maximal window for TCP to advertise to these destinations,
1454 measured in bytes.  It limits maximal data bursts that our TCP
1455 peers are allowed to send to us.
1456
1457 .TP
1458 .BI rtt " TIME"
1459 the initial RTT ('Round Trip Time') estimate. If no suffix is
1460 specified the units are raw values passed directly to the
1461 routing code to maintain compatability with previous releases.
1462 Otherwise if a suffix of s, sec or secs is used to specify
1463 seconds; ms, msec or msecs to specify milliseconds; us, usec
1464 or usecs to specify microseconds; ns, nsec or nsecs to specify
1465 nanoseconds; j, hz or jiffies to specify jiffies, the value is
1466 converted to what the routing code expects.
1467
1468
1469 .TP
1470 .BI rttvar " TIME " "(2.3.15+ only)"
1471 the initial RTT variance estimate. Values are specified as with
1472 .BI rtt
1473 above.
1474
1475 .TP
1476 .BI rto_min " TIME " "(2.6.23+ only)"
1477 the minimum TCP Retransmission TimeOut to use when communicating with this
1478 destination.  Values are specified as with
1479 .BI rtt
1480 above.
1481
1482 .TP
1483 .BI ssthresh " NUMBER " "(2.3.15+ only)"
1484 an estimate for the initial slow start threshold.
1485
1486 .TP
1487 .BI cwnd " NUMBER " "(2.3.15+ only)"
1488 the clamp for congestion window.  It is ignored if the
1489 .B lock
1490 flag is not used.
1491
1492 .TP
1493 .BI advmss " NUMBER " "(2.3.15+ only)"
1494 the MSS ('Maximal Segment Size') to advertise to these
1495 destinations when establishing TCP connections.  If it is not given,
1496 Linux uses a default value calculated from the first hop device MTU.
1497 (If the path to these destination is asymmetric, this guess may be wrong.)
1498
1499 .TP
1500 .BI reordering " NUMBER " "(2.3.15+ only)"
1501 Maximal reordering on the path to this destination.
1502 If it is not given, Linux uses the value selected with
1503 .B sysctl
1504 variable
1505 .BR "net/ipv4/tcp_reordering" .
1506
1507 .TP
1508 .BI nexthop " NEXTHOP"
1509 the nexthop of a multipath route.
1510 .I NEXTHOP
1511 is a complex value with its own syntax similar to the top level
1512 argument lists:
1513
1514 .in +8
1515 .BI via " ADDRESS"
1516 - is the nexthop router.
1517 .sp
1518
1519 .BI dev " NAME"
1520 - is the output device.
1521 .sp
1522
1523 .BI weight " NUMBER"
1524 - is a weight for this element of a multipath
1525 route reflecting its relative bandwidth or quality.
1526 .in -8
1527
1528 .TP
1529 .BI scope " SCOPE_VAL"
1530 the scope of the destinations covered by the route prefix.
1531 .I SCOPE_VAL
1532 may be a number or a string from the file
1533 .BR "/etc/iproute2/rt_scopes" .
1534 If this parameter is omitted,
1535 .B ip
1536 assumes scope
1537 .B global
1538 for all gatewayed
1539 .B unicast
1540 routes, scope
1541 .B link
1542 for direct
1543 .BR unicast " and " broadcast
1544 routes and scope
1545 .BR host " for " local
1546 routes.
1547
1548 .TP
1549 .BI protocol " RTPROTO"
1550 the routing protocol identifier of this route.
1551 .I RTPROTO
1552 may be a number or a string from the file
1553 .BR "/etc/iproute2/rt_protos" .
1554 If the routing protocol ID is not given,
1555 .B ip assumes protocol
1556 .B boot
1557 (i.e. it assumes the route was added by someone who doesn't
1558 understand what they are doing).  Several protocol values have
1559 a fixed interpretation.
1560 Namely:
1561
1562 .in +8
1563 .B redirect
1564 - the route was installed due to an ICMP redirect.
1565 .sp
1566
1567 .B kernel
1568 - the route was installed by the kernel during autoconfiguration.
1569 .sp
1570
1571 .B boot
1572 - the route was installed during the bootup sequence.
1573 If a routing daemon starts, it will purge all of them.
1574 .sp
1575
1576 .B static
1577 - the route was installed by the administrator
1578 to override dynamic routing. Routing daemon will respect them
1579 and, probably, even advertise them to its peers.
1580 .sp
1581
1582 .B ra
1583 - the route was installed by Router Discovery protocol.
1584 .in -8
1585
1586 .sp
1587 The rest of the values are not reserved and the administrator is free
1588 to assign (or not to assign) protocol tags.
1589
1590 .TP
1591 .B onlink
1592 pretend that the nexthop is directly attached to this link,
1593 even if it does not match any interface prefix.
1594
1595 .SS ip route delete - delete route
1596
1597 .B ip route del
1598 has the same arguments as
1599 .BR "ip route add" ,
1600 but their semantics are a bit different.
1601
1602 Key values
1603 .RB "(" to ", " tos ", " preference " and " table ")"
1604 select the route to delete.  If optional attributes are present,
1605 .B ip
1606 verifies that they coincide with the attributes of the route to delete.
1607 If no route with the given key and attributes was found,
1608 .B ip route del
1609 fails.
1610
1611 .SS ip route show - list routes
1612 the command displays the contents of the routing tables or the route(s)
1613 selected by some criteria.
1614
1615 .TP
1616 .BI to " SELECTOR " (default)
1617 only select routes from the given range of destinations.
1618 .I SELECTOR
1619 consists of an optional modifier
1620 .RB "(" root ", " match " or " exact ")"
1621 and a prefix.
1622 .BI root " PREFIX"
1623 selects routes with prefixes not shorter than
1624 .IR PREFIX "."
1625 F.e.
1626 .BI root " 0/0"
1627 selects the entire routing table.
1628 .BI match " PREFIX"
1629 selects routes with prefixes not longer than
1630 .IR PREFIX "."
1631 F.e.
1632 .BI match " 10.0/16"
1633 selects
1634 .IR 10.0/16 ","
1635 .IR 10/8 " and " 0/0 ,
1636 but it does not select
1637 .IR 10.1/16 " and " 10.0.0/24 .
1638 And
1639 .BI exact " PREFIX"
1640 (or just
1641 .IR PREFIX ")"
1642 selects routes with this exact prefix. If neither of these options
1643 are present,
1644 .B ip
1645 assumes
1646 .BI root " 0/0"
1647 i.e. it lists the entire table.
1648
1649 .TP
1650 .BI tos " TOS"
1651 .BI dsfield " TOS"
1652 only select routes with the given TOS.
1653
1654 .TP
1655 .BI table " TABLEID"
1656 show the routes from this table(s).  The default setting is to show
1657 .BR table main "."
1658 .I TABLEID
1659 may either be the ID of a real table or one of the special values:
1660 .sp
1661 .in +8
1662 .B all
1663 - list all of the tables.
1664 .sp
1665 .B cache
1666 - dump the routing cache.
1667 .in -8
1668
1669 .TP
1670 .B cloned
1671 .TP
1672 .B cached
1673 list cloned routes i.e. routes which were dynamically forked from
1674 other routes because some route attribute (f.e. MTU) was updated.
1675 Actually, it is equivalent to
1676 .BR "table cache" "."
1677
1678 .TP
1679 .BI from " SELECTOR"
1680 the same syntax as for
1681 .BR to ","
1682 but it binds the source address range rather than destinations.
1683 Note that the
1684 .B from
1685 option only works with cloned routes.
1686
1687 .TP
1688 .BI protocol " RTPROTO"
1689 only list routes of this protocol.
1690
1691 .TP
1692 .BI scope " SCOPE_VAL"
1693 only list routes with this scope.
1694
1695 .TP
1696 .BI type " TYPE"
1697 only list routes of this type.
1698
1699 .TP
1700 .BI dev " NAME"
1701 only list routes going via this device.
1702
1703 .TP
1704 .BI via " PREFIX"
1705 only list routes going via the nexthop routers selected by
1706 .IR PREFIX "."
1707
1708 .TP
1709 .BI src " PREFIX"
1710 only list routes with preferred source addresses selected
1711 by
1712 .IR PREFIX "."
1713
1714 .TP
1715 .BI realm " REALMID"
1716 .TP
1717 .BI realms " FROMREALM/TOREALM"
1718 only list routes with these realms.
1719
1720 .SS ip route flush - flush routing tables
1721 this command flushes routes selected by some criteria.
1722
1723 .sp
1724 The arguments have the same syntax and semantics as the arguments of
1725 .BR "ip route show" ,
1726 but routing tables are not listed but purged.  The only difference is
1727 the default action:
1728 .B show
1729 dumps all the IP main routing table but
1730 .B flush
1731 prints the helper page.
1732
1733 .sp
1734 With the
1735 .B -statistics
1736 option, the command becomes verbose. It prints out the number of
1737 deleted routes and the number of rounds made to flush the routing
1738 table. If the option is given
1739 twice,
1740 .B ip route flush
1741 also dumps all the deleted routes in the format described in the
1742 previous subsection.
1743
1744 .SS ip route get - get a single route
1745 this command gets a single route to a destination and prints its
1746 contents exactly as the kernel sees it.
1747
1748 .TP
1749 .BI to " ADDRESS " (default)
1750 the destination address.
1751
1752 .TP
1753 .BI from " ADDRESS"
1754 the source address.
1755
1756 .TP
1757 .BI tos " TOS"
1758 .TP
1759 .BI dsfield " TOS"
1760 the Type Of Service.
1761
1762 .TP
1763 .BI iif " NAME"
1764 the device from which this packet is expected to arrive.
1765
1766 .TP
1767 .BI oif " NAME"
1768 force the output device on which this packet will be routed.
1769
1770 .TP
1771 .B connected
1772 if no source address
1773 .RB "(option " from ")"
1774 was given, relookup the route with the source set to the preferred
1775 address received from the first lookup.
1776 If policy routing is used, it may be a different route.
1777
1778 .P
1779 Note that this operation is not equivalent to
1780 .BR "ip route show" .
1781 .B show
1782 shows existing routes.
1783 .B get
1784 resolves them and creates new clones if necessary.  Essentially,
1785 .B get
1786 is equivalent to sending a packet along this path.
1787 If the
1788 .B iif
1789 argument is not given, the kernel creates a route
1790 to output packets towards the requested destination.
1791 This is equivalent to pinging the destination
1792 with a subsequent
1793 .BR "ip route ls cache" ,
1794 however, no packets are actually sent.  With the
1795 .B iif
1796 argument, the kernel pretends that a packet arrived from this interface
1797 and searches for a path to forward the packet.
1798
1799 .SH ip rule - routing policy database management
1800
1801 .BR "Rule" s
1802 in the routing policy database control the route selection algorithm.
1803
1804 .P
1805 Classic routing algorithms used in the Internet make routing decisions
1806 based only on the destination address of packets (and in theory,
1807 but not in practice, on the TOS field).
1808
1809 .P
1810 In some circumstances we want to route packets differently depending not only
1811 on destination addresses, but also on other packet fields: source address,
1812 IP protocol, transport protocol ports or even packet payload.
1813 This task is called 'policy routing'.
1814
1815 .P
1816 To solve this task, the conventional destination based routing table, ordered
1817 according to the longest match rule, is replaced with a 'routing policy
1818 database' (or RPDB), which selects routes by executing some set of rules.
1819
1820 .P
1821 Each policy routing rule consists of a
1822 .B selector
1823 and an
1824 .B action predicate.
1825 The RPDB is scanned in the order of increasing priority. The selector
1826 of each rule is applied to {source address, destination address, incoming
1827 interface, tos, fwmark} and, if the selector matches the packet,
1828 the action is performed.  The action predicate may return with success.
1829 In this case, it will either give a route or failure indication
1830 and the RPDB lookup is terminated. Otherwise, the RPDB program
1831 continues on the next rule.
1832
1833 .P
1834 Semantically, natural action is to select the nexthop and the output device.
1835
1836 .P
1837 At startup time the kernel configures the default RPDB consisting of three
1838 rules:
1839
1840 .TP
1841 1.
1842 Priority: 0, Selector: match anything, Action: lookup routing
1843 table
1844 .B local
1845 (ID 255).
1846 The
1847 .B local
1848 table is a special routing table containing
1849 high priority control routes for local and broadcast addresses.
1850 .sp
1851 Rule 0 is special. It cannot be deleted or overridden.
1852
1853 .TP
1854 2.
1855 Priority: 32766, Selector: match anything, Action: lookup routing
1856 table
1857 .B main
1858 (ID 254).
1859 The
1860 .B main
1861 table is the normal routing table containing all non-policy
1862 routes. This rule may be deleted and/or overridden with other
1863 ones by the administrator.
1864
1865 .TP
1866 3.
1867 Priority: 32767, Selector: match anything, Action: lookup routing
1868 table
1869 .B default
1870 (ID 253).
1871 The
1872 .B default
1873 table is empty.  It is reserved for some post-processing if no previous
1874 default rules selected the packet.
1875 This rule may also be deleted.
1876
1877 .P
1878 Each RPDB entry has additional
1879 attributes.  F.e. each rule has a pointer to some routing
1880 table.  NAT and masquerading rules have an attribute to select new IP
1881 address to translate/masquerade.  Besides that, rules have some
1882 optional attributes, which routes have, namely
1883 .BR "realms" .
1884 These values do not override those contained in the routing tables.  They
1885 are only used if the route did not select any attributes.
1886
1887 .sp
1888 The RPDB may contain rules of the following types:
1889
1890 .in +8
1891 .B unicast
1892 - the rule prescribes to return the route found
1893 in the routing table referenced by the rule.
1894
1895 .B blackhole
1896 - the rule prescribes to silently drop the packet.
1897
1898 .B unreachable
1899 - the rule prescribes to generate a 'Network is unreachable' error.
1900
1901 .B prohibit
1902 - the rule prescribes to generate 'Communication is administratively
1903 prohibited' error.
1904
1905 .B nat
1906 - the rule prescribes to translate the source address
1907 of the IP packet into some other value.
1908 .in -8
1909
1910 .SS ip rule add - insert a new rule
1911 .SS ip rule delete - delete a rule
1912
1913 .TP
1914 .BI type " TYPE " (default)
1915 the type of this rule.  The list of valid types was given in the previous
1916 subsection.
1917
1918 .TP
1919 .BI from " PREFIX"
1920 select the source prefix to match.
1921
1922 .TP
1923 .BI to " PREFIX"
1924 select the destination prefix to match.
1925
1926 .TP
1927 .BI iif " NAME"
1928 select the incoming device to match.  If the interface is loopback,
1929 the rule only matches packets originating from this host.  This means
1930 that you may create separate routing tables for forwarded and local
1931 packets and, hence, completely segregate them.
1932
1933 .TP
1934 .BI oif " NAME"
1935 select the outgoing device to match.  The outgoing interface is only
1936 available for packets originating from local sockets that are bound to
1937 a device.
1938
1939 .TP
1940 .BI tos " TOS"
1941 .TP
1942 .BI dsfield " TOS"
1943 select the TOS value to match.
1944
1945 .TP
1946 .BI fwmark " MARK"
1947 select the
1948 .B fwmark
1949 value to match.
1950
1951 .TP
1952 .BI priority " PREFERENCE"
1953 the priority of this rule.  Each rule should have an explicitly
1954 set
1955 .I unique
1956 priority value.
1957 The options preference and order are synonyms with priority.
1958
1959 .TP
1960 .BI table " TABLEID"
1961 the routing table identifier to lookup if the rule selector matches.
1962 It is also possible to use lookup instead of table.
1963
1964 .TP
1965 .BI realms " FROM/TO"
1966 Realms to select if the rule matched and the routing table lookup
1967 succeeded.  Realm
1968 .I TO
1969 is only used if the route did not select any realm.
1970
1971 .TP
1972 .BI nat " ADDRESS"
1973 The base of the IP address block to translate (for source addresses).
1974 The
1975 .I ADDRESS
1976 may be either the start of the block of NAT addresses (selected by NAT
1977 routes) or a local host address (or even zero).
1978 In the last case the router does not translate the packets, but
1979 masquerades them to this address.
1980 Using map-to instead of nat means the same thing.
1981
1982 .B Warning:
1983 Changes to the RPDB made with these commands do not become active
1984 immediately.  It is assumed that after a script finishes a batch of
1985 updates, it flushes the routing cache with
1986 .BR "ip route flush cache" .
1987
1988 .SS ip rule flush - also dumps all the deleted rules.
1989 This command has no arguments.
1990
1991 .SS ip rule show - list rules
1992 This command has no arguments.
1993 The options list or lst are synonyms with show.
1994
1995 .SH ip maddress - multicast addresses management
1996
1997 .B maddress
1998 objects are multicast addresses.
1999
2000 .SS ip maddress show - list multicast addresses
2001
2002 .TP
2003 .BI dev " NAME " (default)
2004 the device name.
2005
2006 .SS ip maddress add - add a multicast address
2007 .SS ip maddress delete - delete a multicast address
2008 these commands attach/detach a static link layer multicast address
2009 to listen on the interface.
2010 Note that it is impossible to join protocol multicast groups
2011 statically.  This command only manages link layer addresses.
2012
2013 .TP
2014 .BI address " LLADDRESS " (default)
2015 the link layer multicast address.
2016
2017 .TP
2018 .BI dev " NAME"
2019 the device to join/leave this multicast address.
2020
2021 .SH ip mroute - multicast routing cache management
2022 .B mroute
2023 objects are multicast routing cache entries created by a user level
2024 mrouting daemon (f.e.
2025 .B pimd
2026 or
2027 .B mrouted
2028 ).
2029
2030 Due to the limitations of the current interface to the multicast routing
2031 engine, it is impossible to change
2032 .B mroute
2033 objects administratively, so we may only display them.  This limitation
2034 will be removed in the future.
2035
2036 .SS ip mroute show - list mroute cache entries
2037
2038 .TP
2039 .BI to " PREFIX " (default)
2040 the prefix selecting the destination multicast addresses to list.
2041
2042 .TP
2043 .BI iif " NAME"
2044 the interface on which multicast packets are received.
2045
2046 .TP
2047 .BI from " PREFIX"
2048 the prefix selecting the IP source addresses of the multicast route.
2049
2050 .SH ip tunnel - tunnel configuration
2051 .B tunnel
2052 objects are tunnels, encapsulating packets in IP packets and then
2053 sending them over the IP infrastructure.
2054 The encapulating (or outer) address family is specified by the
2055 .B -f
2056 option.  The default is IPv4.
2057
2058 .SS ip tunnel add - add a new tunnel
2059 .SS ip tunnel change - change an existing tunnel
2060 .SS ip tunnel delete - destroy a tunnel
2061
2062 .TP
2063 .BI name " NAME " (default)
2064 select the tunnel device name.
2065
2066 .TP
2067 .BI mode " MODE"
2068 set the tunnel mode. Available modes depend on the encapsulating address family.
2069 .br
2070 Modes for IPv4 encapsulation available:
2071 .BR ipip ", " sit ", " isatap " and " gre "."
2072 .br
2073 Modes for IPv6 encapsulation available:
2074 .BR ip6ip6 ", " ipip6 " and " any "."
2075
2076 .TP
2077 .BI remote " ADDRESS"
2078 set the remote endpoint of the tunnel.
2079
2080 .TP
2081 .BI local " ADDRESS"
2082 set the fixed local address for tunneled packets.
2083 It must be an address on another interface of this host.
2084
2085 .TP
2086 .BI ttl " N"
2087 set a fixed TTL
2088 .I N
2089 on tunneled packets.
2090 .I N
2091 is a number in the range 1--255. 0 is a special value
2092 meaning that packets inherit the TTL value.
2093 The default value for IPv4 tunnels is:
2094 .BR "inherit" .
2095 The default value for IPv6 tunnels is:
2096 .BR "64" .
2097
2098
2099 .TP
2100 .BI tos " T"
2101 .TP
2102 .BI dsfield " T"
2103 .TP
2104 .BI tclass " T"
2105 set a fixed TOS (or traffic class in IPv6)
2106 .I T
2107 on tunneled packets.
2108 The default value is:
2109 .BR "inherit" .
2110
2111 .TP
2112 .BI dev " NAME"
2113 bind the tunnel to the device
2114 .I NAME
2115 so that tunneled packets will only be routed via this device and will
2116 not be able to escape to another device when the route to endpoint
2117 changes.
2118
2119 .TP
2120 .B nopmtudisc
2121 disable Path MTU Discovery on this tunnel.
2122 It is enabled by default.  Note that a fixed ttl is incompatible
2123 with this option: tunnelling with a fixed ttl always makes pmtu
2124 discovery.
2125
2126 .TP
2127 .BI key " K"
2128 .TP
2129 .BI ikey " K"
2130 .TP
2131 .BI okey " K"
2132 .RB ( " only GRE tunnels " )
2133 use keyed GRE with key
2134 .IR K ". " K
2135 is either a number or an IP address-like dotted quad.
2136 The
2137 .B key
2138 parameter sets the key to use in both directions.
2139 The
2140 .BR ikey " and " okey
2141 parameters set different keys for input and output.
2142
2143 .TP
2144 .BR csum ", " icsum ", " ocsum
2145 .RB ( " only GRE tunnels " )
2146 generate/require checksums for tunneled packets.
2147 The
2148 .B ocsum
2149 flag calculates checksums for outgoing packets.
2150 The
2151 .B icsum
2152 flag requires that all input packets have the correct
2153 checksum.  The
2154 .B csum
2155 flag is equivalent to the combination
2156 .BR "icsum ocsum" .
2157
2158 .TP
2159 .BR seq ", " iseq ", " oseq
2160 .RB ( " only GRE tunnels " )
2161 serialize packets.
2162 The
2163 .B oseq
2164 flag enables sequencing of outgoing packets.
2165 The
2166 .B iseq
2167 flag requires that all input packets are serialized.
2168 The
2169 .B  seq
2170 flag is equivalent to the combination
2171 .BR "iseq oseq" .
2172 .B It isn't work. Don't use it.
2173
2174 .TP
2175 .BR "dscp inherit"
2176 .RB ( " only IPv6 tunnels " )
2177 Inherit DS field between inner and outer header.
2178
2179 .TP
2180 .BI encaplim " ELIM"
2181 .RB ( " only IPv6 tunnels " )
2182 set a fixed encapsulation limit.  Default is 4.
2183
2184 .TP
2185 .BI flowlabel " FLOWLABEL"
2186 .RB ( " only IPv6 tunnels " )
2187 set a fixed flowlabel.
2188
2189 .SS ip tunnel prl - potential router list (ISATAP only)
2190
2191 .TP
2192 .BI dev " NAME"
2193 mandatory device name.
2194
2195 .TP
2196 .BI prl-default " ADDR"
2197 .TP
2198 .BI prl-nodefault " ADDR"
2199 .TP
2200 .BI prl-delete " ADDR"
2201 .RB "Add or delete " ADDR
2202 as a potential router or default router.
2203
2204 .SS ip tunnel show - list tunnels
2205 This command has no arguments.
2206
2207 .SH ip monitor and rtmon - state monitoring
2208
2209 The
2210 .B ip
2211 utility can monitor the state of devices, addresses
2212 and routes continuously.  This option has a slightly different format.
2213 Namely, the
2214 .B monitor
2215 command is the first in the command line and then the object list follows:
2216
2217 .BR "ip monitor" " [ " all " |"
2218 .IR LISTofOBJECTS " ]"
2219
2220 .I OBJECT-LIST
2221 is the list of object types that we want to monitor.
2222 It may contain
2223 .BR link ", " address " and " route "."
2224 If no
2225 .B file
2226 argument is given,
2227 .B ip
2228 opens RTNETLINK, listens on it and dumps state changes in the format
2229 described in previous sections.
2230
2231 .P
2232 If a file name is given, it does not listen on RTNETLINK,
2233 but opens the file containing RTNETLINK messages saved in binary format
2234 and dumps them.  Such a history file can be generated with the
2235 .B rtmon
2236 utility.  This utility has a command line syntax similar to
2237 .BR "ip monitor" .
2238 Ideally,
2239 .B rtmon
2240 should be started before the first network configuration command
2241 is issued. F.e. if you insert:
2242 .sp
2243 .in +8
2244 rtmon file /var/log/rtmon.log
2245 .in -8
2246 .sp
2247 in a startup script, you will be able to view the full history
2248 later.
2249
2250 .P
2251 Certainly, it is possible to start
2252 .B rtmon
2253 at any time.
2254 It prepends the history with the state snapshot dumped at the moment
2255 of starting.
2256
2257 .SH ip xfrm - setting xfrm
2258 xfrm is an IP framework, which can transform format of the datagrams,
2259 .br
2260 i.e. encrypt the packets with some algorithm. xfrm policy and xfrm state
2261 are associated through templates
2262 .IR TMPL_LIST "."
2263 This framework is used as a part of IPsec protocol.
2264
2265 .SS ip xfrm state add - add new state into xfrm
2266
2267 .SS ip xfrm state update - update existing xfrm state
2268
2269 .SS ip xfrm state allocspi - allocate SPI value
2270
2271 .TP
2272 .I MODE
2273 is set as default to
2274 .BR transport ","
2275 but it could be set to
2276 .BR tunnel "," ro " or " beet "."
2277
2278 .TP
2279 .I FLAG-LIST
2280 contains one or more flags.
2281
2282 .TP
2283 .I FLAG
2284 could be set to
2285 .BR noecn ", " decap-dscp " or " wildrecv "."
2286
2287 .TP
2288 .I ENCAP
2289 encapsulation is set to encapsulation type
2290 .IR ENCAP-TYPE ", source port " SPORT ", destination port "  DPORT " and " OADDR "."
2291
2292 .TP
2293 .I ENCAP-TYPE
2294 could be set to
2295 .BR espinudp " or " espinudp-nonike "."
2296
2297 .TP
2298 .I ALGO-LIST
2299 contains one or more algorithms
2300 .I ALGO
2301 which depend on the type of algorithm set by
2302 .IR ALGO_TYPE "."
2303 It can be used these algoritms
2304 .BR enc ", " auth " or " comp "."
2305
2306 .SS ip xfrm policy add - add a new policy
2307
2308 .SS ip xfrm policy update - update an existing policy
2309
2310 .SS ip xfrm policy delete - delete existing policy
2311
2312 .SS ip xfrm policy get - get existing policy
2313
2314 .SS ip xfrm policy deleteall - delete all existing xfrm policy
2315
2316 .SS ip xfrm policy list - print out the list of xfrm policy
2317
2318 .SS ip xfrm policy flush - flush policies
2319 It can be flush
2320 .BR all
2321 policies or only those specified with
2322 .BR ptype "."
2323
2324 .TP
2325 .BI dir " DIR "
2326 directory could be one of these:
2327 .BR "inp", " out " or " fwd".
2328
2329 .TP
2330 .IR SELECTOR
2331 selects for which addresses will be set up the policy. The selector
2332 is defined by source and destination address.
2333
2334 .TP
2335 .IR UPSPEC
2336 is defined by source port
2337 .BR sport ", "
2338 destination port
2339 .BR dport ", " type
2340 as number and
2341 .B code
2342 also number.
2343
2344 .TP
2345 .BI dev " DEV "
2346 specify network device.
2347
2348 .TP
2349 .BI index " INDEX "
2350 the number of indexed policy.
2351
2352 .TP
2353 .BI ptype " PTYPE "
2354 type is set as default on
2355 .BR "main" ,
2356 could be switch on
2357 .BR "sub" .
2358
2359 .TP
2360 .BI action " ACTION "
2361 is set as default on
2362 .BR "allow".
2363 It could be switch on
2364 .BR "block".
2365
2366 .TP
2367 .BI priority " PRIORITY "
2368 priority is a number. Default priority is set on zero.
2369
2370 .TP
2371 .IR LIMIT-LIST
2372 limits are set in seconds, bytes or numbers of packets.
2373
2374 .TP
2375 .IR TMPL-LIST
2376 template list is based on
2377 .IR ID ","
2378 .BR mode ", " reqid " and " level ". "
2379
2380 .TP
2381 .IR ID
2382 is specified by source address, destination address,
2383 .I proto
2384 and value of
2385 .IR spi "."
2386
2387 .TP
2388 .IR XFRM_PROTO
2389 values:
2390 .BR esp ", " ah ", " comp ", " route2 " or " hao "."
2391
2392 .TP
2393 .IR MODE
2394 is set as default on
2395 .BR transport ","
2396 but it could be set on
2397 .BR tunnel " or " beet "."
2398
2399 .TP
2400 .IR LEVEL
2401 is set as default on
2402 .BR required
2403 and the other choice is
2404 .BR use "."
2405
2406 .TP
2407 .IR UPSPEC
2408 is specified by
2409 .BR sport ", "
2410 .BR dport ", " type
2411 and
2412 .B code
2413 (NUMBER).
2414
2415 .SS ip xfrm monitor - is used for listing all objects or defined group of them.
2416 The
2417 .B xfrm monitor
2418 can monitor the policies for all objects or defined group of them.
2419
2420 .SH HISTORY
2421 .B ip
2422 was written by Alexey N. Kuznetsov and added in Linux 2.2.
2423 .SH SEE ALSO
2424 .BR tc (8)
2425 .br
2426 .RB "IP Command reference " ip-cref.ps
2427 .br
2428 .RB "IP tunnels " ip-cref.ps
2429 .br
2430 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
2431
2432 .SH AUTHOR
2433 Original Manpage  by Michail Litvak <mci@owl.openwall.com>