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