1 .TH IP 8 "17 January 2002" "iproute2" "Linux"
3 ip \- show / manipulate routing, devices, policy routing and tunnels
10 .RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
16 .BR link " | " addr " | " addrlabel " | " route " | " rule " | " neigh " | "\
17 tunnel " | " maddr " | " mroute " | " monitor " }"
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] }
30 .BI "ip link set " DEVICE
31 .RB "{ " up " | " down " | " arp " { " on " | " off " } |"
33 .BR promisc " { " on " | " off " } |"
35 .BR allmulticast " { " on " | " off " } |"
37 .BR dynamic " { " on " | " off " } |"
39 .BR multicast " { " on " | " off " } |"
79 .BR "ip addr" " { " add " | " del " } "
80 .IB IFADDR " dev " STRING
83 .BR "ip addr" " { " show " | " flush " } [ " dev
88 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
93 .IR IFADDR " := " PREFIX " | " ADDR
107 .RB "[ " host " | " link " | " global " | "
111 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
115 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
116 tentative " | " deprecated " | " dadfailed " | " temporary " ]"
119 .BR "ip addrlabel" " { " add " | " del " } " prefix
127 .BR "ip addrlabel" " { " list " | " flush " }"
131 .BR list " | " flush " } "
137 .BI from " ADDRESS " iif " STRING"
144 .BR "ip route" " { " add " | " del " | " change " | " append " | "\
145 replace " | " monitor " } "
166 .IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]"
169 .IR NODE_SPEC " := [ " TYPE " ] " PREFIX " ["
182 .IR INFO_SPEC " := " "NH OPTIONS FLAGS" " ["
193 .IR NUMBER " ] " NHFLAGS
196 .IR OPTIONS " := " FLAGS " [ "
218 .BR unicast " | " local " | " broadcast " | " multicast " | "\
219 throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]"
222 .IR TABLE_ID " := [ "
223 .BR local "| " main " | " default " | " all " |"
228 .BR host " | " link " | " global " |"
233 .BR onlink " | " pervasive " ]"
237 .BR kernel " | " boot " | " static " |"
242 .RB " [ " list " | " add " | " del " | " flush " ]"
246 .IR SELECTOR " := [ "
254 .IR FWMARK[/MASK] " ] [ "
268 .BR prohibit " | " reject " | " unreachable " ] [ " realms
269 .RI "[" SRCREALM "/]" DSTREALM " ]"
272 .IR TABLE_ID " := [ "
273 .BR local " | " main " | " default " |"
277 .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
281 .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
287 .BR "ip neigh" " { " show " | " flush " } [ " to
295 .BR "ip tunnel" " { " add " | " change " | " del " | " show " | " prl " }"
305 .RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
307 .RB "[" i "|" o "]" csum " ] ]"
326 .RB "[ [" no "]" pmtudisc " ]"
329 .RB "[ " "dscp inherit" " ]"
333 .RB " { " ipip " | " gre " | " sit " | " isatap " | " ip6ip6 " | " ipip6 " | " any " }"
336 .IR ADDR " := { " IP_ADDRESS " |"
340 .IR TOS " := { " NUMBER " |"
350 .IR TTL " := { " 1 ".." 255 " | "
354 .IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"
357 .IR TIME " := " NUMBER "[s|ms|us|ns|j]"
360 .BR "ip maddr" " [ " add " | " del " ]"
361 .IB MULTIADDR " dev " STRING
364 .BR "ip maddr show" " [ " dev
368 .BR "ip mroute show" " ["
376 .BR "ip monitor" " [ " all " |"
377 .IR LISTofOBJECTS " ]"
381 .IR XFRM_OBJECT " { " COMMAND " }"
384 .IR XFRM_OBJECT " := { " state " | " policy " | " monitor " } "
387 .BR "ip xfrm state " { " add " | " update " } "
397 .RB " [ " replay-window
411 .BR "ip xfrm state allocspi "
425 .BR "ip xfrm state" " { " delete " | " get " } "
429 .BR "ip xfrm state" " { " deleteall " | " list " } [ "
440 .BR "ip xfrm state flush" " [ " proto
444 .BR "ip xfrm state count"
458 .IR XFRM_PROTO " := "
459 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
463 .RB " [ " transport " | " tunnel " | " ro " | " beet " ] "
464 .B (default=transport)
468 .RI " [ " FLAG-LIST " ] " FLAG
472 .RB " [ " noecn " | " decap-dscp " | " wildrecv " ] "
475 .IR ENCAP " := " ENCAP-TYPE " " SPORT " " DPORT " " OADDR
478 .IR ENCAP-TYPE " := "
484 .IR ALGO-LIST " := [ "
485 .IR ALGO-LIST " ] | [ "
496 .RB " [ " enc " | " auth " | " comp " ] "
501 .IR ADDR "[/" PLEN "]"
503 .IR ADDR "[/" PLEN "]"
504 .RI " [ " UPSPEC " ] "
523 .IR LIMIT-LIST " := [ " LIMIT-LIST " ] |"
529 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
531 .RB "[ ["byte-soft "|" byte-hard "]"
534 .RB " [ ["packet-soft "|" packet-hard "]"
538 .BR "ip xfrm policy" " { " add " | " update " } " " dir "
551 .RI " [ " LIMIT-LIST " ] [ "
555 .BR "ip xfrm policy" " { " delete " | " get " } " " dir "
556 .IR DIR " [ " SELECTOR " | "
565 .BR "ip xfrm policy" " { " deleteall " | " list " } "
578 .B "ip xfrm policy flush"
587 .RB " [ " main " | " sub " ] "
592 .RB " [ " in " | " out " | " fwd " ] "
597 .IR ADDR "[/" PLEN "]"
599 .IR ADDR "[/" PLEN] " [ " UPSPEC
619 .RB " [ " allow " | " block " ]"
623 .IR LIMIT-LIST " := "
625 .IR LIMIT-LIST " ] | "
631 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
633 .RB " [ [" byte-soft "|" byte-hard "]"
636 .RB "[" packet-soft "|" packet-hard "]"
642 .IR TMPL-LIST " ] | "
668 .IR XFRM_PROTO " := "
669 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
673 .RB " [ " transport " | " tunnel " | " beet " ] "
674 .B (default=transport)
678 .RB " [ " required " | " use " ] "
679 .B (default=required)
682 .BR "ip xfrm monitor" " [ " all " | "
683 .IR LISTofOBJECTS " ] "
691 .BR "\-V" , " -Version"
692 print the version of the
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.
703 .BR "\-f" , " \-family"
704 followed by protocol family identifier:
705 .BR "inet" , " inet6"
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
713 falls back to the default one, usually
718 is a special family identifier meaning that no networking protocol
729 .BR "\-family inet6" .
734 .BR "\-family link" .
737 .BR "\-o" , " \-oneline"
738 output each record on a single line, replacing line feeds
741 character. This is convenient when you want to count records
749 .BR "\-r" , " \-resolve"
750 use the system's name resolver to print DNS names instead of
753 .SH IP - COMMAND SYNTAX
764 - protocol (IP or IPv6) address on a device.
768 - label configuration for protocol address selection.
772 - ARP or NDISC cache entry.
776 - routing table entry.
780 - rule in routing policy database.
788 - multicast routing cache entry.
796 - framework for IPsec protocol.
799 The names of all objects may be written in full or
800 abbreviated form, f.e.
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"
818 ) objects, but some objects do not allow all of these operations
819 or have some additional commands. The
821 command is available for all objects. It prints
822 out a list of available commands and argument syntax conventions.
824 If no command is given, some default command is assumed.
827 or, if the objects of this class cannot be listed,
830 .SH ip link - network device configuration
833 is a network device and the corresponding commands
834 display and change the state of devices.
836 .SS ip link set - change device attributes
839 .BI dev " NAME " (default)
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)
847 change the state of the device to
853 .BR "arp on " or " arp off"
859 .BR "multicast on " or " multicast off"
865 .BR "dynamic on " or " dynamic off"
872 change the name of the device. This operation is not
873 recommended if the device is running or has some addresses
877 .BI txqueuelen " NUMBER"
880 change the transmit queue length of the device.
889 .BI address " LLADDRESS"
890 change the station address of the interface.
893 .BI broadcast " LLADDRESS"
897 .BI peer " LLADDRESS"
898 change the link layer broadcast address or the peer address when
904 move the device to the network namespace associated with the process
909 give the device a symbolic name for easy reference.
913 specify a Virtual Function device to be configured. The associated PF device
914 must be specified using the
920 - change the station address for the specified VF. The
922 parameter must be specified.
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
932 parameter must be specified.
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
942 parameters must be specified. Setting both
946 as 0 disables VLAN tagging and filtering for the VF.
950 - change the allowed transmit bandwidth, in Mbps, for the specified VF.
951 Setting this parameter to 0 disables rate limiting. The
953 parameter must be specified.
958 If multiple parameter changes are requested,
960 aborts immediately after any of the changes have failed.
961 This is the only case when
963 can move the system to an unpredictable state. The solution
964 is to avoid changing several parameters with one
968 .SS ip link show - display device attributes
971 .BI dev " NAME " (default)
973 specifies the network device to show.
974 If this argument is omitted all devices are listed.
978 only display running interfaces.
980 .SH ip address - protocol address management.
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
990 is not quite appropriate for them and we do not use it in this document.
994 command displays addresses and their properties, adds new addresses
995 and deletes old ones.
997 .SS ip address add - add new protocol address.
1001 the name of the device to add the address to.
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
1009 may be followed by a slash and a decimal number which encodes
1010 the network prefix length.
1014 the address of the remote endpoint for pointopoint interfaces.
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.
1023 .BI broadcast " ADDRESS"
1024 the broadcast address on the interface.
1026 It is possible to use the special symbols
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.
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.
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:
1049 - the address is globally valid.
1052 - (IPv6 only) the address is site local, i.e. it is
1053 valid inside this site.
1056 - the address is link local, i.e. it is valid only on this device.
1059 - the address is valid only inside this host.
1062 .SS ip address delete - delete protocol address
1064 coincide with the arguments of
1066 The device name is a required argument. The rest are optional.
1067 If no arguments are given, the first address is deleted.
1069 .SS ip address show - look at protocol addresses
1072 .BI dev " NAME " (default)
1076 .BI scope " SCOPE_VAL"
1077 only list addresses with this scope.
1081 only list addresses matching this prefix.
1084 .BI label " PATTERN"
1085 only list addresses with labels matching the
1088 is a usual shell style pattern.
1091 .BR dynamic " and " permanent
1092 (IPv6 only) only list addresses installed due to stateless
1093 address configuration or only list permanent (not dynamic)
1098 (IPv6 only) only list addresses which have not yet passed duplicate
1103 (IPv6 only) only list deprecated addresses.
1107 (IPv6 only) only list addresses which have failed duplicate
1112 (IPv6 only) only list temporary addresses.
1115 .BR primary " and " secondary
1116 only list primary (or secondary) addresses.
1118 .SS ip address flush - flush protocol addresses
1119 This command flushes the protocol addresses selected by some criteria.
1122 This command has the same arguments as
1124 The difference is that it does not run when no arguments are given.
1128 This command (and other
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.
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,
1140 also dumps all the deleted addresses in the format described in the
1141 previous subsection.
1143 .SH ip addrlabel - protocol address label management.
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.
1149 .SS ip addrlabel add - add an address label
1150 the command adds an address label entry to the kernel.
1152 .BI prefix " PREFIX"
1155 the outgoing interface.
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.
1163 coincide with the arguments of
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.
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.
1179 The corresponding commands display neighbour bindings
1180 and their properties, add new neighbour entries and delete old ones.
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
1186 These commands create new neighbour records or update existing ones.
1189 .BI to " ADDRESS " (default)
1190 the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
1194 the interface to which this neighbour is attached.
1197 .BI lladdr " LLADDRESS"
1198 the link layer address of the neighbour.
1204 .BI nud " NUD_STATE"
1205 the state of the neighbour entry.
1207 is an abbreviation for 'Neigh bour Unreachability Detection'.
1208 The state can take one of the following values:
1212 - the neighbour entry is valid forever and can be only
1213 be removed administratively.
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.
1222 - the neighbour entry is valid until the reachability
1227 - the neighbour entry is valid but suspicious.
1230 does not change the neighbour state if it was valid and the address
1231 is not changed by this command.
1234 .SS ip neighbour delete - delete a neighbour entry
1235 This command invalidates a neighbour entry.
1238 The arguments are the same as with
1239 .BR "ip neigh add" ,
1248 Attempts to delete or manually change a
1250 entry created by the kernel may result in unpredictable behaviour.
1251 Particularly, the kernel may try to resolve this address even
1254 interface or if the address is multicast or broadcast.
1256 .SS ip neighbour show - list neighbour entries
1258 This commands displays neighbour tables.
1261 .BI to " ADDRESS " (default)
1262 the prefix selecting the neighbours to list.
1266 only list the neighbours attached to this device.
1270 only list neighbours which are not currently in use.
1273 .BI nud " NUD_STATE"
1274 only list neighbour entries in this state.
1276 takes values listed below or the special value
1278 which means all states. This option may occur more than once.
1279 If this option is absent,
1281 lists all entries except for
1286 .SS ip neighbour flush - flush neighbour entries
1287 This command flushes neighbour tables, selecting
1288 entries to flush by some criteria.
1291 This command has the same arguments as
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
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
1307 also dumps all the deleted neighbours.
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.
1317 - the route entry describes real paths to the destinations covered
1318 by the route prefix.
1322 - these destinations are unreachable. Packets are discarded and the
1326 The local senders get an
1332 - these destinations are unreachable. Packets are discarded silently.
1333 The local senders get an
1339 - these destinations are unreachable. Packets are discarded and the
1341 .I communication administratively prohibited
1342 is generated. The local senders get an
1348 - the destinations are assigned to this host. The packets are looped
1349 back and delivered locally.
1353 - the destinations are broadcast addresses. The packets are sent as
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
1364 is generated. The local senders get an
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
1375 Route NAT is no longer supported in Linux 2.6.
1381 .RI "- " "not implemented"
1382 the destinations are
1384 addresses assigned to this host. They are mainly equivalent
1387 with one difference: such addresses are invalid when used
1388 as the source address of any packet.
1392 - a special type used for multicast routing. It is not present in
1393 normal routing 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
1401 .B /etc/iproute2/rt_tables
1402 By default all normal routes are inserted into the
1404 table (ID 254) and the kernel only uses this table when calculating routes.
1407 Actually, one other table always exists, which is invisible but
1408 even more important. It is the
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
1415 The multiple routing tables enter the game when
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
1424 .BI to " TYPE PREFIX " (default)
1425 the destination prefix of the route. If
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,
1438 assumes a full-length host route. There is also a special
1441 - which is equivalent to IP
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.
1455 is either an 8 bit hexadecimal number or an identifier
1457 .BR "/etc/iproute2/rt_dsfield" .
1460 .BI metric " NUMBER"
1462 .BI preference " NUMBER"
1463 the preference value of the route.
1465 is an arbitrary 32bit number.
1468 .BI table " TABLEID"
1469 the table to add this route to.
1471 may be a number or a string from the file
1472 .BR "/etc/iproute2/rt_tables" .
1473 If this parameter is omitted,
1477 table, with the exception of
1478 .BR local " , " broadcast " and " nat
1479 routes, which are put into the
1485 the output device name.
1489 the address of the nexthop router. Actually, the sense of this field
1490 depends on the route type. For normal
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.
1499 the source address to prefer when sending to the destinations
1500 covered by the route prefix.
1503 .BI realm " REALMID"
1504 the realm to which this route is assigned.
1506 may be a number or a string from the file
1507 .BR "/etc/iproute2/rt_realms" .
1512 .BI "mtu lock" " MTU"
1513 the MTU along the path to the destination. If the modifier
1515 is not used, the MTU may be updated by the kernel due to
1516 Path MTU Discovery. If the modifier
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
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.
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.
1541 .BI rttvar " TIME " "(2.3.15+ only)"
1542 the initial RTT variance estimate. Values are specified as with
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
1554 .BI ssthresh " NUMBER " "(2.3.15+ only)"
1555 an estimate for the initial slow start threshold.
1558 .BI cwnd " NUMBER " "(2.3.15+ only)"
1559 the clamp for congestion window. It is ignored if the
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.)
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
1576 .BR "net/ipv4/tcp_reordering" .
1579 .BI nexthop " NEXTHOP"
1580 the nexthop of a multipath route.
1582 is a complex value with its own syntax similar to the top level
1587 - is the nexthop router.
1591 - is the output device.
1594 .BI weight " NUMBER"
1595 - is a weight for this element of a multipath
1596 route reflecting its relative bandwidth or quality.
1600 .BI scope " SCOPE_VAL"
1601 the scope of the destinations covered by the route prefix.
1603 may be a number or a string from the file
1604 .BR "/etc/iproute2/rt_scopes" .
1605 If this parameter is omitted,
1614 .BR unicast " and " broadcast
1616 .BR host " for " local
1620 .BI protocol " RTPROTO"
1621 the routing protocol identifier of this route.
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
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.
1635 - the route was installed due to an ICMP redirect.
1639 - the route was installed by the kernel during autoconfiguration.
1643 - the route was installed during the bootup sequence.
1644 If a routing daemon starts, it will purge all of them.
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.
1654 - the route was installed by Router Discovery protocol.
1658 The rest of the values are not reserved and the administrator is free
1659 to assign (or not to assign) protocol tags.
1663 pretend that the nexthop is directly attached to this link,
1664 even if it does not match any interface prefix.
1666 .SS ip route delete - delete route
1669 has the same arguments as
1670 .BR "ip route add" ,
1671 but their semantics are a bit different.
1674 .RB "(" to ", " tos ", " preference " and " table ")"
1675 select the route to delete. If optional attributes are present,
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,
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.
1687 .BI to " SELECTOR " (default)
1688 only select routes from the given range of destinations.
1690 consists of an optional modifier
1691 .RB "(" root ", " match " or " exact ")"
1694 selects routes with prefixes not shorter than
1698 selects the entire routing table.
1700 selects routes with prefixes not longer than
1703 .BI match " 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 .
1713 selects routes with this exact prefix. If neither of these options
1718 i.e. it lists the entire table.
1723 only select routes with the given TOS.
1726 .BI table " TABLEID"
1727 show the routes from this table(s). The default setting is to show
1730 may either be the ID of a real table or one of the special values:
1734 - list all of the tables.
1737 - dump the routing cache.
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" "."
1750 .BI from " SELECTOR"
1751 the same syntax as for
1753 but it binds the source address range rather than destinations.
1756 option only works with cloned routes.
1759 .BI protocol " RTPROTO"
1760 only list routes of this protocol.
1763 .BI scope " SCOPE_VAL"
1764 only list routes with this scope.
1768 only list routes of this type.
1772 only list routes going via this device.
1776 only list routes going via the nexthop routers selected by
1781 only list routes with preferred source addresses selected
1786 .BI realm " REALMID"
1788 .BI realms " FROMREALM/TOREALM"
1789 only list routes with these realms.
1791 .SS ip route flush - flush routing tables
1792 this command flushes routes selected by some criteria.
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
1800 dumps all the IP main routing table but
1802 prints the helper page.
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
1812 also dumps all the deleted routes in the format described in the
1813 previous subsection.
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.
1820 .BI to " ADDRESS " (default)
1821 the destination address.
1831 the Type Of Service.
1835 the device from which this packet is expected to arrive.
1839 force the output device on which this packet will be routed.
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.
1850 Note that this operation is not equivalent to
1851 .BR "ip route show" .
1853 shows existing routes.
1855 resolves them and creates new clones if necessary. Essentially,
1857 is equivalent to sending a packet along this path.
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
1864 .BR "ip route ls cache" ,
1865 however, no packets are actually sent. With the
1867 argument, the kernel pretends that a packet arrived from this interface
1868 and searches for a path to forward the packet.
1870 .SH ip rule - routing policy database management
1873 in the routing policy database control the route selection algorithm.
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).
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'.
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.
1892 Each policy routing rule consists of a
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.
1905 Semantically, natural action is to select the nexthop and the output device.
1908 At startup time the kernel configures the default RPDB consisting of three
1913 Priority: 0, Selector: match anything, Action: lookup routing
1919 table is a special routing table containing
1920 high priority control routes for local and broadcast addresses.
1922 Rule 0 is special. It cannot be deleted or overridden.
1926 Priority: 32766, Selector: match anything, Action: lookup routing
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.
1938 Priority: 32767, Selector: match anything, Action: lookup routing
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.
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
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.
1959 The RPDB may contain rules of the following types:
1963 - the rule prescribes to return the route found
1964 in the routing table referenced by the rule.
1967 - the rule prescribes to silently drop the packet.
1970 - the rule prescribes to generate a 'Network is unreachable' error.
1973 - the rule prescribes to generate 'Communication is administratively
1977 - the rule prescribes to translate the source address
1978 of the IP packet into some other value.
1981 .SS ip rule add - insert a new rule
1982 .SS ip rule delete - delete a rule
1985 .BI type " TYPE " (default)
1986 the type of this rule. The list of valid types was given in the previous
1991 select the source prefix to match.
1995 select the destination prefix to match.
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.
2006 select the outgoing device to match. The outgoing interface is only
2007 available for packets originating from local sockets that are bound to
2014 select the TOS value to match.
2023 .BI priority " PREFERENCE"
2024 the priority of this rule. Each rule should have an explicitly
2028 The options preference and order are synonyms with priority.
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.
2036 .BI realms " FROM/TO"
2037 Realms to select if the rule matched and the routing table lookup
2040 is only used if the route did not select any realm.
2044 The base of the IP address block to translate (for source addresses).
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.
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" .
2059 .SS ip rule flush - also dumps all the deleted rules.
2060 This command has no arguments.
2062 .SS ip rule show - list rules
2063 This command has no arguments.
2064 The options list or lst are synonyms with show.
2066 .SH ip maddress - multicast addresses management
2069 objects are multicast addresses.
2071 .SS ip maddress show - list multicast addresses
2074 .BI dev " NAME " (default)
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.
2085 .BI address " LLADDRESS " (default)
2086 the link layer multicast address.
2090 the device to join/leave this multicast address.
2092 .SH ip mroute - multicast routing cache management
2094 objects are multicast routing cache entries created by a user level
2095 mrouting daemon (f.e.
2101 Due to the limitations of the current interface to the multicast routing
2102 engine, it is impossible to change
2104 objects administratively, so we may only display them. This limitation
2105 will be removed in the future.
2107 .SS ip mroute show - list mroute cache entries
2110 .BI to " PREFIX " (default)
2111 the prefix selecting the destination multicast addresses to list.
2115 the interface on which multicast packets are received.
2119 the prefix selecting the IP source addresses of the multicast route.
2121 .SH ip tunnel - tunnel configuration
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
2127 option. The default is IPv4.
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
2134 .BI name " NAME " (default)
2135 select the tunnel device name.
2139 set the tunnel mode. Available modes depend on the encapsulating address family.
2141 Modes for IPv4 encapsulation available:
2142 .BR ipip ", " sit ", " isatap " and " gre "."
2144 Modes for IPv6 encapsulation available:
2145 .BR ip6ip6 ", " ipip6 " and " any "."
2148 .BI remote " ADDRESS"
2149 set the remote endpoint of the tunnel.
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.
2160 on tunneled packets.
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:
2166 The default value for IPv6 tunnels is:
2176 set a fixed TOS (or traffic class in IPv6)
2178 on tunneled packets.
2179 The default value is:
2184 bind the tunnel to the device
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
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
2203 .RB ( " only GRE tunnels " )
2204 use keyed GRE with key
2206 is either a number or an IP address-like dotted quad.
2209 parameter sets the key to use in both directions.
2211 .BR ikey " and " okey
2212 parameters set different keys for input and output.
2215 .BR csum ", " icsum ", " ocsum
2216 .RB ( " only GRE tunnels " )
2217 generate/require checksums for tunneled packets.
2220 flag calculates checksums for outgoing packets.
2223 flag requires that all input packets have the correct
2226 flag is equivalent to the combination
2230 .BR seq ", " iseq ", " oseq
2231 .RB ( " only GRE tunnels " )
2235 flag enables sequencing of outgoing packets.
2238 flag requires that all input packets are serialized.
2241 flag is equivalent to the combination
2243 .B It isn't work. Don't use it.
2247 .RB ( " only IPv6 tunnels " )
2248 Inherit DS field between inner and outer header.
2251 .BI encaplim " ELIM"
2252 .RB ( " only IPv6 tunnels " )
2253 set a fixed encapsulation limit. Default is 4.
2256 .BI flowlabel " FLOWLABEL"
2257 .RB ( " only IPv6 tunnels " )
2258 set a fixed flowlabel.
2260 .SS ip tunnel prl - potential router list (ISATAP only)
2264 mandatory device name.
2267 .BI prl-default " ADDR"
2269 .BI prl-nodefault " ADDR"
2271 .BI prl-delete " ADDR"
2272 .RB "Add or delete " ADDR
2273 as a potential router or default router.
2275 .SS ip tunnel show - list tunnels
2276 This command has no arguments.
2278 .SH ip monitor and rtmon - state monitoring
2282 utility can monitor the state of devices, addresses
2283 and routes continuously. This option has a slightly different format.
2286 command is the first in the command line and then the object list follows:
2288 .BR "ip monitor" " [ " all " |"
2289 .IR LISTofOBJECTS " ]"
2292 is the list of object types that we want to monitor.
2294 .BR link ", " address " and " route "."
2299 opens RTNETLINK, listens on it and dumps state changes in the format
2300 described in previous sections.
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
2307 utility. This utility has a command line syntax similar to
2311 should be started before the first network configuration command
2312 is issued. F.e. if you insert:
2315 rtmon file /var/log/rtmon.log
2318 in a startup script, you will be able to view the full history
2322 Certainly, it is possible to start
2325 It prepends the history with the state snapshot dumped at the moment
2328 .SH ip xfrm - setting xfrm
2329 xfrm is an IP framework, which can transform format of the datagrams,
2331 i.e. encrypt the packets with some algorithm. xfrm policy and xfrm state
2332 are associated through templates
2334 This framework is used as a part of IPsec protocol.
2336 .SS ip xfrm state add - add new state into xfrm
2338 .SS ip xfrm state update - update existing xfrm state
2340 .SS ip xfrm state allocspi - allocate SPI value
2344 is set as default to
2346 but it could be set to
2347 .BR tunnel "," ro " or " beet "."
2351 contains one or more flags.
2356 .BR noecn ", " decap-dscp " or " wildrecv "."
2360 encapsulation is set to encapsulation type
2361 .IR ENCAP-TYPE ", source port " SPORT ", destination port " DPORT " and " OADDR "."
2366 .BR espinudp " or " espinudp-nonike "."
2370 contains one or more algorithms
2372 which depend on the type of algorithm set by
2374 It can be used these algoritms
2375 .BR enc ", " auth " or " comp "."
2377 .SS ip xfrm policy add - add a new policy
2379 .SS ip xfrm policy update - update an existing policy
2381 .SS ip xfrm policy delete - delete existing policy
2383 .SS ip xfrm policy get - get existing policy
2385 .SS ip xfrm policy deleteall - delete all existing xfrm policy
2387 .SS ip xfrm policy list - print out the list of xfrm policy
2389 .SS ip xfrm policy flush - flush policies
2392 policies or only those specified with
2397 directory could be one of these:
2398 .BR "inp", " out " or " fwd".
2402 selects for which addresses will be set up the policy. The selector
2403 is defined by source and destination address.
2407 is defined by source port
2417 specify network device.
2421 the number of indexed policy.
2425 type is set as default on
2431 .BI action " ACTION "
2432 is set as default on
2434 It could be switch on
2438 .BI priority " PRIORITY "
2439 priority is a number. Default priority is set on zero.
2443 limits are set in seconds, bytes or numbers of packets.
2447 template list is based on
2449 .BR mode ", " reqid " and " level ". "
2453 is specified by source address, destination address,
2461 .BR esp ", " ah ", " comp ", " route2 " or " hao "."
2465 is set as default on
2467 but it could be set on
2468 .BR tunnel " or " beet "."
2472 is set as default on
2474 and the other choice is
2486 .SS ip xfrm monitor - is used for listing all objects or defined group of them.
2489 can monitor the policies for all objects or defined group of them.
2493 was written by Alexey N. Kuznetsov and added in Linux 2.2.
2497 .RB "IP Command reference " ip-cref.ps
2499 .RB "IP tunnels " ip-cref.ps
2501 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
2504 Original Manpage by Michail Litvak <mci@owl.openwall.com>