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