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