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 add link " DEVICE
50 .BR vlan " | " maclan " | " can " ]"
53 .BI "ip link delete " DEVICE
58 .BI "ip link set " DEVICE
59 .RB "{ " up " | " down " | " arp " { " on " | " off " } |"
61 .BR promisc " { " on " | " off " } |"
63 .BR allmulticast " { " on " | " off " } |"
65 .BR dynamic " { " on " | " off " } |"
67 .BR multicast " { " on " | " off " } |"
105 .BR "ip addr" " { " add " | " del " } "
106 .IB IFADDR " dev " STRING
109 .BR "ip addr" " { " show " | " flush " } [ " dev
114 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
119 .IR IFADDR " := " PREFIX " | " ADDR
133 .RB "[ " host " | " link " | " global " | "
137 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
141 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
142 tentative " | " deprecated " | " dadfailed " | " temporary " ]"
145 .BR "ip addrlabel" " { " add " | " del " } " prefix
153 .BR "ip addrlabel" " { " list " | " flush " }"
157 .BR list " | " flush " } "
163 .BI from " ADDRESS " iif " STRING"
170 .BR "ip route" " { " add " | " del " | " change " | " append " | "\
171 replace " | " monitor " } "
192 .IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]"
195 .IR NODE_SPEC " := [ " TYPE " ] " PREFIX " ["
208 .IR INFO_SPEC " := " "NH OPTIONS FLAGS" " ["
219 .IR NUMBER " ] " NHFLAGS
222 .IR OPTIONS " := " FLAGS " [ "
244 .BR unicast " | " local " | " broadcast " | " multicast " | "\
245 throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]"
248 .IR TABLE_ID " := [ "
249 .BR local "| " main " | " default " | " all " |"
254 .BR host " | " link " | " global " |"
259 .BR onlink " | " pervasive " ]"
263 .BR kernel " | " boot " | " static " |"
268 .RB " [ " list " | " add " | " del " | " flush " ]"
272 .IR SELECTOR " := [ "
280 .IR FWMARK[/MASK] " ] [ "
294 .BR prohibit " | " reject " | " unreachable " ] [ " realms
295 .RI "[" SRCREALM "/]" DSTREALM " ]"
298 .IR TABLE_ID " := [ "
299 .BR local " | " main " | " default " |"
303 .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
307 .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
313 .BR "ip neigh" " { " show " | " flush " } [ " to
321 .BR "ip tunnel" " { " add " | " change " | " del " | " show " | " prl " }"
331 .RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
333 .RB "[" i "|" o "]" csum " ] ]"
352 .RB "[ [" no "]" pmtudisc " ]"
355 .RB "[ " "dscp inherit" " ]"
359 .RB " { " ipip " | " gre " | " sit " | " isatap " | " ip6ip6 " | " ipip6 " | " any " }"
362 .IR ADDR " := { " IP_ADDRESS " |"
366 .IR TOS " := { " NUMBER " |"
376 .IR TTL " := { " 1 ".." 255 " | "
380 .IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"
383 .IR TIME " := " NUMBER "[s|ms|us|ns|j]"
386 .BR "ip maddr" " [ " add " | " del " ]"
387 .IB MULTIADDR " dev " STRING
390 .BR "ip maddr show" " [ " dev
394 .BR "ip mroute show" " ["
402 .BR "ip monitor" " [ " all " |"
403 .IR LISTofOBJECTS " ]"
407 .IR XFRM_OBJECT " { " COMMAND " }"
410 .IR XFRM_OBJECT " := { " state " | " policy " | " monitor " } "
413 .BR "ip xfrm state " { " add " | " update " } "
423 .RB " [ " replay-window
437 .BR "ip xfrm state allocspi "
451 .BR "ip xfrm state" " { " delete " | " get " } "
455 .BR "ip xfrm state" " { " deleteall " | " list " } [ "
466 .BR "ip xfrm state flush" " [ " proto
470 .BR "ip xfrm state count"
484 .IR XFRM_PROTO " := "
485 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
489 .RB " [ " transport " | " tunnel " | " ro " | " beet " ] "
490 .B (default=transport)
494 .RI " [ " FLAG-LIST " ] " FLAG
498 .RB " [ " noecn " | " decap-dscp " | " wildrecv " ] "
501 .IR ENCAP " := " ENCAP-TYPE " " SPORT " " DPORT " " OADDR
504 .IR ENCAP-TYPE " := "
510 .IR ALGO-LIST " := [ "
511 .IR ALGO-LIST " ] | [ "
522 .RB " [ " enc " | " auth " | " comp " ] "
527 .IR ADDR "[/" PLEN "]"
529 .IR ADDR "[/" PLEN "]"
530 .RI " [ " UPSPEC " ] "
549 .IR LIMIT-LIST " := [ " LIMIT-LIST " ] |"
555 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
557 .RB "[ ["byte-soft "|" byte-hard "]"
560 .RB " [ ["packet-soft "|" packet-hard "]"
564 .BR "ip xfrm policy" " { " add " | " update " } " " dir "
577 .RI " [ " LIMIT-LIST " ] [ "
581 .BR "ip xfrm policy" " { " delete " | " get " } " " dir "
582 .IR DIR " [ " SELECTOR " | "
591 .BR "ip xfrm policy" " { " deleteall " | " list " } "
604 .B "ip xfrm policy flush"
613 .RB " [ " main " | " sub " ] "
618 .RB " [ " in " | " out " | " fwd " ] "
623 .IR ADDR "[/" PLEN "]"
625 .IR ADDR "[/" PLEN] " [ " UPSPEC
645 .RB " [ " allow " | " block " ]"
649 .IR LIMIT-LIST " := "
651 .IR LIMIT-LIST " ] | "
657 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
659 .RB " [ [" byte-soft "|" byte-hard "]"
662 .RB "[" packet-soft "|" packet-hard "]"
668 .IR TMPL-LIST " ] | "
694 .IR XFRM_PROTO " := "
695 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
699 .RB " [ " transport " | " tunnel " | " beet " ] "
700 .B (default=transport)
704 .RB " [ " required " | " use " ] "
705 .B (default=required)
708 .BR "ip xfrm monitor" " [ " all " | "
709 .IR LISTofOBJECTS " ] "
717 .BR "\-V" , " -Version"
718 print the version of the
723 .BR "\-s" , " \-stats", " \-statistics"
724 output more information. If the option
725 appears twice or more, the amount of information increases.
726 As a rule, the information is statistics or some time values.
729 .BR "\-f" , " \-family"
730 followed by protocol family identifier:
731 .BR "inet" , " inet6"
734 ,enforce the protocol family to use. If the option is not present,
735 the protocol family is guessed from other arguments. If the rest
736 of the command line does not give enough information to guess the
739 falls back to the default one, usually
744 is a special family identifier meaning that no networking protocol
755 .BR "\-family inet6" .
760 .BR "\-family link" .
763 .BR "\-o" , " \-oneline"
764 output each record on a single line, replacing line feeds
767 character. This is convenient when you want to count records
775 .BR "\-r" , " \-resolve"
776 use the system's name resolver to print DNS names instead of
779 .SH IP - COMMAND SYNTAX
790 - protocol (IP or IPv6) address on a device.
794 - label configuration for protocol address selection.
798 - ARP or NDISC cache entry.
802 - routing table entry.
806 - rule in routing policy database.
814 - multicast routing cache entry.
822 - framework for IPsec protocol.
825 The names of all objects may be written in full or
826 abbreviated form, f.e.
836 Specifies the action to perform on the object.
837 The set of possible actions depends on the object type.
838 As a rule, it is possible to
839 .BR "add" , " delete"
844 ) objects, but some objects do not allow all of these operations
845 or have some additional commands. The
847 command is available for all objects. It prints
848 out a list of available commands and argument syntax conventions.
850 If no command is given, some default command is assumed.
853 or, if the objects of this class cannot be listed,
856 .SH ip link - network device configuration
859 is a network device and the corresponding commands
860 display and change the state of devices.
862 .SS ip link add - add virtual link
866 specifies the physical device to act operate on.
869 specifies the name of the new virtual device.
872 specifies the type of the new device.
878 - 802.1q tagged virrtual LAN interface
881 - virtual interface base on link layer address (MAC)
884 - Controller Area Network interface
887 .SS ip link delete - delete virtual link
889 specifies the virtual device to act operate on.
891 specifies the type of the device.
896 specifies the physical device to act operate on.
898 .SS ip link set - change device attributes
903 specifies network device to operate on. When configuring SR-IOV Virtual Fuction
904 (VF) devices, this keyword should specify the associated Physical Function (PF)
909 change the state of the device to
915 .BR "arp on " or " arp off"
921 .BR "multicast on " or " multicast off"
927 .BR "dynamic on " or " dynamic off"
934 change the name of the device. This operation is not
935 recommended if the device is running or has some addresses
939 .BI txqueuelen " NUMBER"
942 change the transmit queue length of the device.
951 .BI address " LLADDRESS"
952 change the station address of the interface.
955 .BI broadcast " LLADDRESS"
959 .BI peer " LLADDRESS"
960 change the link layer broadcast address or the peer address when
966 move the device to the network namespace associated with the process
971 give the device a symbolic name for easy reference.
975 specify a Virtual Function device to be configured. The associated PF device
976 must be specified using the
982 - change the station address for the specified VF. The
984 parameter must be specified.
988 - change the assigned VLAN for the specified VF. When specified, all traffic
989 sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
990 will be filtered for the specified VLAN ID, and will have all VLAN tags
991 stripped before being passed to the VF. Setting this parameter to 0 disables
992 VLAN tagging and filtering. The
994 parameter must be specified.
998 - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
999 tags transmitted by the VF will include the specified priority bits in the
1000 VLAN tag. If not specified, the value is assumed to be 0. Both the
1004 parameters must be specified. Setting both
1008 as 0 disables VLAN tagging and filtering for the VF.
1012 - change the allowed transmit bandwidth, in Mbps, for the specified VF.
1013 Setting this parameter to 0 disables rate limiting. The
1015 parameter must be specified.
1020 If multiple parameter changes are requested,
1022 aborts immediately after any of the changes have failed.
1023 This is the only case when
1025 can move the system to an unpredictable state. The solution
1026 is to avoid changing several parameters with one
1030 .SS ip link show - display device attributes
1033 .BI dev " NAME " (default)
1035 specifies the network device to show.
1036 If this argument is omitted all devices are listed.
1040 only display running interfaces.
1042 .SH ip address - protocol address management.
1046 is a protocol (IP or IPv6) address attached
1047 to a network device. Each device must have at least one address
1048 to use the corresponding protocol. It is possible to have several
1049 different addresses attached to one device. These addresses are not
1050 discriminated, so that the term
1052 is not quite appropriate for them and we do not use it in this document.
1056 command displays addresses and their properties, adds new addresses
1057 and deletes old ones.
1059 .SS ip address add - add new protocol address.
1063 the name of the device to add the address to.
1066 .BI local " ADDRESS " (default)
1067 the address of the interface. The format of the address depends
1068 on the protocol. It is a dotted quad for IP and a sequence of
1069 hexadecimal halfwords separated by colons for IPv6. The
1071 may be followed by a slash and a decimal number which encodes
1072 the network prefix length.
1076 the address of the remote endpoint for pointopoint interfaces.
1079 may be followed by a slash and a decimal number, encoding the network
1080 prefix length. If a peer address is specified, the local address
1081 cannot have a prefix length. The network prefix is associated
1082 with the peer rather than with the local address.
1085 .BI broadcast " ADDRESS"
1086 the broadcast address on the interface.
1088 It is possible to use the special symbols
1092 instead of the broadcast address. In this case, the broadcast address
1093 is derived by setting/resetting the host bits of the interface prefix.
1097 Each address may be tagged with a label string.
1098 In order to preserve compatibility with Linux-2.0 net aliases,
1099 this string must coincide with the name of the device or must be prefixed
1100 with the device name followed by colon.
1103 .BI scope " SCOPE_VALUE"
1104 the scope of the area where this address is valid.
1105 The available scopes are listed in file
1106 .BR "/etc/iproute2/rt_scopes" .
1107 Predefined scope values are:
1111 - the address is globally valid.
1114 - (IPv6 only) the address is site local, i.e. it is
1115 valid inside this site.
1118 - the address is link local, i.e. it is valid only on this device.
1121 - the address is valid only inside this host.
1124 .SS ip address delete - delete protocol address
1126 coincide with the arguments of
1128 The device name is a required argument. The rest are optional.
1129 If no arguments are given, the first address is deleted.
1131 .SS ip address show - look at protocol addresses
1134 .BI dev " NAME " (default)
1138 .BI scope " SCOPE_VAL"
1139 only list addresses with this scope.
1143 only list addresses matching this prefix.
1146 .BI label " PATTERN"
1147 only list addresses with labels matching the
1150 is a usual shell style pattern.
1153 .BR dynamic " and " permanent
1154 (IPv6 only) only list addresses installed due to stateless
1155 address configuration or only list permanent (not dynamic)
1160 (IPv6 only) only list addresses which have not yet passed duplicate
1165 (IPv6 only) only list deprecated addresses.
1169 (IPv6 only) only list addresses which have failed duplicate
1174 (IPv6 only) only list temporary addresses.
1177 .BR primary " and " secondary
1178 only list primary (or secondary) addresses.
1180 .SS ip address flush - flush protocol addresses
1181 This command flushes the protocol addresses selected by some criteria.
1184 This command has the same arguments as
1186 The difference is that it does not run when no arguments are given.
1190 This command (and other
1192 commands described below) is pretty dangerous. If you make a mistake,
1193 it will not forgive it, but will cruelly purge all the addresses.
1198 option, the command becomes verbose. It prints out the number of deleted
1199 addresses and the number of rounds made to flush the address list. If
1200 this option is given twice,
1202 also dumps all the deleted addresses in the format described in the
1203 previous subsection.
1205 .SH ip addrlabel - protocol address label management.
1207 IPv6 address label is used for address selection
1208 described in RFC 3484. Precedence is managed by userspace,
1209 and only label is stored in kernel.
1211 .SS ip addrlabel add - add an address label
1212 the command adds an address label entry to the kernel.
1214 .BI prefix " PREFIX"
1217 the outgoing interface.
1220 the label for the prefix.
1221 0xffffffff is reserved.
1222 .SS ip addrlabel del - delete an address label
1223 the command deletes an address label entry in the kernel.
1225 coincide with the arguments of
1227 but label is not required.
1228 .SS ip addrlabel list - list address labels
1229 the command show contents of address labels.
1230 .SS ip addrlabel flush - flush address labels
1231 the command flushes the contents of address labels and it does not restore default settings.
1232 .SH ip neighbour - neighbour/arp tables management.
1235 objects establish bindings between protocol addresses and
1236 link layer addresses for hosts sharing the same link.
1237 Neighbour entries are organized into tables. The IPv4 neighbour table
1238 is known by another name - the ARP table.
1241 The corresponding commands display neighbour bindings
1242 and their properties, add new neighbour entries and delete old ones.
1244 .SS ip neighbour add - add a new neighbour entry
1245 .SS ip neighbour change - change an existing entry
1246 .SS ip neighbour replace - add a new entry or change an existing one
1248 These commands create new neighbour records or update existing ones.
1251 .BI to " ADDRESS " (default)
1252 the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
1256 the interface to which this neighbour is attached.
1259 .BI lladdr " LLADDRESS"
1260 the link layer address of the neighbour.
1266 .BI nud " NUD_STATE"
1267 the state of the neighbour entry.
1269 is an abbreviation for 'Neigh bour Unreachability Detection'.
1270 The state can take one of the following values:
1274 - the neighbour entry is valid forever and can be only
1275 be removed administratively.
1279 - the neighbour entry is valid. No attempts to validate
1280 this entry will be made but it can be removed when its lifetime expires.
1284 - the neighbour entry is valid until the reachability
1289 - the neighbour entry is valid but suspicious.
1292 does not change the neighbour state if it was valid and the address
1293 is not changed by this command.
1296 .SS ip neighbour delete - delete a neighbour entry
1297 This command invalidates a neighbour entry.
1300 The arguments are the same as with
1301 .BR "ip neigh add" ,
1310 Attempts to delete or manually change a
1312 entry created by the kernel may result in unpredictable behaviour.
1313 Particularly, the kernel may try to resolve this address even
1316 interface or if the address is multicast or broadcast.
1318 .SS ip neighbour show - list neighbour entries
1320 This commands displays neighbour tables.
1323 .BI to " ADDRESS " (default)
1324 the prefix selecting the neighbours to list.
1328 only list the neighbours attached to this device.
1332 only list neighbours which are not currently in use.
1335 .BI nud " NUD_STATE"
1336 only list neighbour entries in this state.
1338 takes values listed below or the special value
1340 which means all states. This option may occur more than once.
1341 If this option is absent,
1343 lists all entries except for
1348 .SS ip neighbour flush - flush neighbour entries
1349 This command flushes neighbour tables, selecting
1350 entries to flush by some criteria.
1353 This command has the same arguments as
1355 The differences are that it does not run when no arguments are given,
1356 and that the default neighbour states to be flushed do not include
1364 option, the command becomes verbose. It prints out the number of
1365 deleted neighbours and the number of rounds made to flush the
1366 neighbour table. If the option is given
1369 also dumps all the deleted neighbours.
1371 .SH ip route - routing table management
1372 Manipulate route entries in the kernel routing tables keep
1373 information about paths to other networked nodes.
1379 - the route entry describes real paths to the destinations covered
1380 by the route prefix.
1384 - these destinations are unreachable. Packets are discarded and the
1388 The local senders get an
1394 - these destinations are unreachable. Packets are discarded silently.
1395 The local senders get an
1401 - these destinations are unreachable. Packets are discarded and the
1403 .I communication administratively prohibited
1404 is generated. The local senders get an
1410 - the destinations are assigned to this host. The packets are looped
1411 back and delivered locally.
1415 - the destinations are broadcast addresses. The packets are sent as
1420 - a special control route used together with policy rules. If such a
1421 route is selected, lookup in this table is terminated pretending that
1422 no route was found. Without policy routing it is equivalent to the
1423 absence of the route in the routing table. The packets are dropped
1424 and the ICMP message
1426 is generated. The local senders get an
1432 - a special NAT route. Destinations covered by the prefix
1433 are considered to be dummy (or external) addresses which require translation
1434 to real (or internal) ones before forwarding. The addresses to translate to
1435 are selected with the attribute
1437 Route NAT is no longer supported in Linux 2.6.
1443 .RI "- " "not implemented"
1444 the destinations are
1446 addresses assigned to this host. They are mainly equivalent
1449 with one difference: such addresses are invalid when used
1450 as the source address of any packet.
1454 - a special type used for multicast routing. It is not present in
1455 normal routing tables.
1460 Linux-2.x can pack routes into several routing tables identified
1461 by a number in the range from 1 to 2^31 or by name from the file
1462 .B /etc/iproute2/rt_tables
1463 By default all normal routes are inserted into the
1465 table (ID 254) and the kernel only uses this table when calculating routes.
1466 Values (0, 253, 254, and 255) are reserved for built-in use.
1469 Actually, one other table always exists, which is invisible but
1470 even more important. It is the
1472 table (ID 255). This table
1473 consists of routes for local and broadcast addresses. The kernel maintains
1474 this table automatically and the administrator usually need not modify it
1477 The multiple routing tables enter the game when
1481 .SS ip route add - add new route
1482 .SS ip route change - change route
1483 .SS ip route replace - change or add new one
1486 .BI to " TYPE PREFIX " (default)
1487 the destination prefix of the route. If
1497 is an IP or IPv6 address optionally followed by a slash and the
1498 prefix length. If the length of the prefix is missing,
1500 assumes a full-length host route. There is also a special
1503 - which is equivalent to IP
1512 the Type Of Service (TOS) key. This key has no associated mask and
1513 the longest match is understood as: First, compare the TOS
1514 of the route and of the packet. If they are not equal, then the packet
1515 may still match a route with a zero TOS.
1517 is either an 8 bit hexadecimal number or an identifier
1519 .BR "/etc/iproute2/rt_dsfield" .
1522 .BI metric " NUMBER"
1524 .BI preference " NUMBER"
1525 the preference value of the route.
1527 is an arbitrary 32bit number.
1530 .BI table " TABLEID"
1531 the table to add this route to.
1533 may be a number or a string from the file
1534 .BR "/etc/iproute2/rt_tables" .
1535 If this parameter is omitted,
1539 table, with the exception of
1540 .BR local " , " broadcast " and " nat
1541 routes, which are put into the
1547 the output device name.
1551 the address of the nexthop router. Actually, the sense of this field
1552 depends on the route type. For normal
1554 routes it is either the true next hop router or, if it is a direct
1555 route installed in BSD compatibility mode, it can be a local address
1556 of the interface. For NAT routes it is the first address of the block
1557 of translated IP destinations.
1561 the source address to prefer when sending to the destinations
1562 covered by the route prefix.
1565 .BI realm " REALMID"
1566 the realm to which this route is assigned.
1568 may be a number or a string from the file
1569 .BR "/etc/iproute2/rt_realms" .
1574 .BI "mtu lock" " MTU"
1575 the MTU along the path to the destination. If the modifier
1577 is not used, the MTU may be updated by the kernel due to
1578 Path MTU Discovery. If the modifier
1580 is used, no path MTU discovery will be tried, all packets
1581 will be sent without the DF bit in IPv4 case or fragmented
1585 .BI window " NUMBER"
1586 the maximal window for TCP to advertise to these destinations,
1587 measured in bytes. It limits maximal data bursts that our TCP
1588 peers are allowed to send to us.
1592 the initial RTT ('Round Trip Time') estimate. If no suffix is
1593 specified the units are raw values passed directly to the
1594 routing code to maintain compatability with previous releases.
1595 Otherwise if a suffix of s, sec or secs is used to specify
1596 seconds; ms, msec or msecs to specify milliseconds; us, usec
1597 or usecs to specify microseconds; ns, nsec or nsecs to specify
1598 nanoseconds; j, hz or jiffies to specify jiffies, the value is
1599 converted to what the routing code expects.
1603 .BI rttvar " TIME " "(2.3.15+ only)"
1604 the initial RTT variance estimate. Values are specified as with
1609 .BI rto_min " TIME " "(2.6.23+ only)"
1610 the minimum TCP Retransmission TimeOut to use when communicating with this
1611 destination. Values are specified as with
1616 .BI ssthresh " NUMBER " "(2.3.15+ only)"
1617 an estimate for the initial slow start threshold.
1620 .BI cwnd " NUMBER " "(2.3.15+ only)"
1621 the clamp for congestion window. It is ignored if the
1626 .BI advmss " NUMBER " "(2.3.15+ only)"
1627 the MSS ('Maximal Segment Size') to advertise to these
1628 destinations when establishing TCP connections. If it is not given,
1629 Linux uses a default value calculated from the first hop device MTU.
1630 (If the path to these destination is asymmetric, this guess may be wrong.)
1633 .BI reordering " NUMBER " "(2.3.15+ only)"
1634 Maximal reordering on the path to this destination.
1635 If it is not given, Linux uses the value selected with
1638 .BR "net/ipv4/tcp_reordering" .
1641 .BI nexthop " NEXTHOP"
1642 the nexthop of a multipath route.
1644 is a complex value with its own syntax similar to the top level
1649 - is the nexthop router.
1653 - is the output device.
1656 .BI weight " NUMBER"
1657 - is a weight for this element of a multipath
1658 route reflecting its relative bandwidth or quality.
1662 .BI scope " SCOPE_VAL"
1663 the scope of the destinations covered by the route prefix.
1665 may be a number or a string from the file
1666 .BR "/etc/iproute2/rt_scopes" .
1667 If this parameter is omitted,
1676 .BR unicast " and " broadcast
1678 .BR host " for " local
1682 .BI protocol " RTPROTO"
1683 the routing protocol identifier of this route.
1685 may be a number or a string from the file
1686 .BR "/etc/iproute2/rt_protos" .
1687 If the routing protocol ID is not given,
1688 .B ip assumes protocol
1690 (i.e. it assumes the route was added by someone who doesn't
1691 understand what they are doing). Several protocol values have
1692 a fixed interpretation.
1697 - the route was installed due to an ICMP redirect.
1701 - the route was installed by the kernel during autoconfiguration.
1705 - the route was installed during the bootup sequence.
1706 If a routing daemon starts, it will purge all of them.
1710 - the route was installed by the administrator
1711 to override dynamic routing. Routing daemon will respect them
1712 and, probably, even advertise them to its peers.
1716 - the route was installed by Router Discovery protocol.
1720 The rest of the values are not reserved and the administrator is free
1721 to assign (or not to assign) protocol tags.
1725 pretend that the nexthop is directly attached to this link,
1726 even if it does not match any interface prefix.
1728 .SS ip route delete - delete route
1731 has the same arguments as
1732 .BR "ip route add" ,
1733 but their semantics are a bit different.
1736 .RB "(" to ", " tos ", " preference " and " table ")"
1737 select the route to delete. If optional attributes are present,
1739 verifies that they coincide with the attributes of the route to delete.
1740 If no route with the given key and attributes was found,
1744 .SS ip route show - list routes
1745 the command displays the contents of the routing tables or the route(s)
1746 selected by some criteria.
1749 .BI to " SELECTOR " (default)
1750 only select routes from the given range of destinations.
1752 consists of an optional modifier
1753 .RB "(" root ", " match " or " exact ")"
1756 selects routes with prefixes not shorter than
1760 selects the entire routing table.
1762 selects routes with prefixes not longer than
1765 .BI match " 10.0/16"
1768 .IR 10/8 " and " 0/0 ,
1769 but it does not select
1770 .IR 10.1/16 " and " 10.0.0/24 .
1775 selects routes with this exact prefix. If neither of these options
1780 i.e. it lists the entire table.
1785 only select routes with the given TOS.
1788 .BI table " TABLEID"
1789 show the routes from this table(s). The default setting is to show
1792 may either be the ID of a real table or one of the special values:
1796 - list all of the tables.
1799 - dump the routing cache.
1806 list cloned routes i.e. routes which were dynamically forked from
1807 other routes because some route attribute (f.e. MTU) was updated.
1808 Actually, it is equivalent to
1809 .BR "table cache" "."
1812 .BI from " SELECTOR"
1813 the same syntax as for
1815 but it binds the source address range rather than destinations.
1818 option only works with cloned routes.
1821 .BI protocol " RTPROTO"
1822 only list routes of this protocol.
1825 .BI scope " SCOPE_VAL"
1826 only list routes with this scope.
1830 only list routes of this type.
1834 only list routes going via this device.
1838 only list routes going via the nexthop routers selected by
1843 only list routes with preferred source addresses selected
1848 .BI realm " REALMID"
1850 .BI realms " FROMREALM/TOREALM"
1851 only list routes with these realms.
1853 .SS ip route flush - flush routing tables
1854 this command flushes routes selected by some criteria.
1857 The arguments have the same syntax and semantics as the arguments of
1858 .BR "ip route show" ,
1859 but routing tables are not listed but purged. The only difference is
1862 dumps all the IP main routing table but
1864 prints the helper page.
1869 option, the command becomes verbose. It prints out the number of
1870 deleted routes and the number of rounds made to flush the routing
1871 table. If the option is given
1874 also dumps all the deleted routes in the format described in the
1875 previous subsection.
1877 .SS ip route get - get a single route
1878 this command gets a single route to a destination and prints its
1879 contents exactly as the kernel sees it.
1882 .BI to " ADDRESS " (default)
1883 the destination address.
1893 the Type Of Service.
1897 the device from which this packet is expected to arrive.
1901 force the output device on which this packet will be routed.
1905 if no source address
1906 .RB "(option " from ")"
1907 was given, relookup the route with the source set to the preferred
1908 address received from the first lookup.
1909 If policy routing is used, it may be a different route.
1912 Note that this operation is not equivalent to
1913 .BR "ip route show" .
1915 shows existing routes.
1917 resolves them and creates new clones if necessary. Essentially,
1919 is equivalent to sending a packet along this path.
1922 argument is not given, the kernel creates a route
1923 to output packets towards the requested destination.
1924 This is equivalent to pinging the destination
1926 .BR "ip route ls cache" ,
1927 however, no packets are actually sent. With the
1929 argument, the kernel pretends that a packet arrived from this interface
1930 and searches for a path to forward the packet.
1932 .SH ip rule - routing policy database management
1935 in the routing policy database control the route selection algorithm.
1938 Classic routing algorithms used in the Internet make routing decisions
1939 based only on the destination address of packets (and in theory,
1940 but not in practice, on the TOS field).
1943 In some circumstances we want to route packets differently depending not only
1944 on destination addresses, but also on other packet fields: source address,
1945 IP protocol, transport protocol ports or even packet payload.
1946 This task is called 'policy routing'.
1949 To solve this task, the conventional destination based routing table, ordered
1950 according to the longest match rule, is replaced with a 'routing policy
1951 database' (or RPDB), which selects routes by executing some set of rules.
1954 Each policy routing rule consists of a
1957 .B action predicate.
1958 The RPDB is scanned in the order of increasing priority. The selector
1959 of each rule is applied to {source address, destination address, incoming
1960 interface, tos, fwmark} and, if the selector matches the packet,
1961 the action is performed. The action predicate may return with success.
1962 In this case, it will either give a route or failure indication
1963 and the RPDB lookup is terminated. Otherwise, the RPDB program
1964 continues on the next rule.
1967 Semantically, natural action is to select the nexthop and the output device.
1970 At startup time the kernel configures the default RPDB consisting of three
1975 Priority: 0, Selector: match anything, Action: lookup routing
1981 table is a special routing table containing
1982 high priority control routes for local and broadcast addresses.
1984 Rule 0 is special. It cannot be deleted or overridden.
1988 Priority: 32766, Selector: match anything, Action: lookup routing
1994 table is the normal routing table containing all non-policy
1995 routes. This rule may be deleted and/or overridden with other
1996 ones by the administrator.
2000 Priority: 32767, Selector: match anything, Action: lookup routing
2006 table is empty. It is reserved for some post-processing if no previous
2007 default rules selected the packet.
2008 This rule may also be deleted.
2011 Each RPDB entry has additional
2012 attributes. F.e. each rule has a pointer to some routing
2013 table. NAT and masquerading rules have an attribute to select new IP
2014 address to translate/masquerade. Besides that, rules have some
2015 optional attributes, which routes have, namely
2017 These values do not override those contained in the routing tables. They
2018 are only used if the route did not select any attributes.
2021 The RPDB may contain rules of the following types:
2025 - the rule prescribes to return the route found
2026 in the routing table referenced by the rule.
2029 - the rule prescribes to silently drop the packet.
2032 - the rule prescribes to generate a 'Network is unreachable' error.
2035 - the rule prescribes to generate 'Communication is administratively
2039 - the rule prescribes to translate the source address
2040 of the IP packet into some other value.
2043 .SS ip rule add - insert a new rule
2044 .SS ip rule delete - delete a rule
2047 .BI type " TYPE " (default)
2048 the type of this rule. The list of valid types was given in the previous
2053 select the source prefix to match.
2057 select the destination prefix to match.
2061 select the incoming device to match. If the interface is loopback,
2062 the rule only matches packets originating from this host. This means
2063 that you may create separate routing tables for forwarded and local
2064 packets and, hence, completely segregate them.
2068 select the outgoing device to match. The outgoing interface is only
2069 available for packets originating from local sockets that are bound to
2076 select the TOS value to match.
2085 .BI priority " PREFERENCE"
2086 the priority of this rule. Each rule should have an explicitly
2090 The options preference and order are synonyms with priority.
2093 .BI table " TABLEID"
2094 the routing table identifier to lookup if the rule selector matches.
2095 It is also possible to use lookup instead of table.
2098 .BI realms " FROM/TO"
2099 Realms to select if the rule matched and the routing table lookup
2102 is only used if the route did not select any realm.
2106 The base of the IP address block to translate (for source addresses).
2109 may be either the start of the block of NAT addresses (selected by NAT
2110 routes) or a local host address (or even zero).
2111 In the last case the router does not translate the packets, but
2112 masquerades them to this address.
2113 Using map-to instead of nat means the same thing.
2116 Changes to the RPDB made with these commands do not become active
2117 immediately. It is assumed that after a script finishes a batch of
2118 updates, it flushes the routing cache with
2119 .BR "ip route flush cache" .
2121 .SS ip rule flush - also dumps all the deleted rules.
2122 This command has no arguments.
2124 .SS ip rule show - list rules
2125 This command has no arguments.
2126 The options list or lst are synonyms with show.
2128 .SH ip maddress - multicast addresses management
2131 objects are multicast addresses.
2133 .SS ip maddress show - list multicast addresses
2136 .BI dev " NAME " (default)
2139 .SS ip maddress add - add a multicast address
2140 .SS ip maddress delete - delete a multicast address
2141 these commands attach/detach a static link layer multicast address
2142 to listen on the interface.
2143 Note that it is impossible to join protocol multicast groups
2144 statically. This command only manages link layer addresses.
2147 .BI address " LLADDRESS " (default)
2148 the link layer multicast address.
2152 the device to join/leave this multicast address.
2154 .SH ip mroute - multicast routing cache management
2156 objects are multicast routing cache entries created by a user level
2157 mrouting daemon (f.e.
2163 Due to the limitations of the current interface to the multicast routing
2164 engine, it is impossible to change
2166 objects administratively, so we may only display them. This limitation
2167 will be removed in the future.
2169 .SS ip mroute show - list mroute cache entries
2172 .BI to " PREFIX " (default)
2173 the prefix selecting the destination multicast addresses to list.
2177 the interface on which multicast packets are received.
2181 the prefix selecting the IP source addresses of the multicast route.
2183 .SH ip tunnel - tunnel configuration
2185 objects are tunnels, encapsulating packets in IP packets and then
2186 sending them over the IP infrastructure.
2187 The encapulating (or outer) address family is specified by the
2189 option. The default is IPv4.
2191 .SS ip tunnel add - add a new tunnel
2192 .SS ip tunnel change - change an existing tunnel
2193 .SS ip tunnel delete - destroy a tunnel
2196 .BI name " NAME " (default)
2197 select the tunnel device name.
2201 set the tunnel mode. Available modes depend on the encapsulating address family.
2203 Modes for IPv4 encapsulation available:
2204 .BR ipip ", " sit ", " isatap " and " gre "."
2206 Modes for IPv6 encapsulation available:
2207 .BR ip6ip6 ", " ipip6 " and " any "."
2210 .BI remote " ADDRESS"
2211 set the remote endpoint of the tunnel.
2214 .BI local " ADDRESS"
2215 set the fixed local address for tunneled packets.
2216 It must be an address on another interface of this host.
2222 on tunneled packets.
2224 is a number in the range 1--255. 0 is a special value
2225 meaning that packets inherit the TTL value.
2226 The default value for IPv4 tunnels is:
2228 The default value for IPv6 tunnels is:
2238 set a fixed TOS (or traffic class in IPv6)
2240 on tunneled packets.
2241 The default value is:
2246 bind the tunnel to the device
2248 so that tunneled packets will only be routed via this device and will
2249 not be able to escape to another device when the route to endpoint
2254 disable Path MTU Discovery on this tunnel.
2255 It is enabled by default. Note that a fixed ttl is incompatible
2256 with this option: tunnelling with a fixed ttl always makes pmtu
2265 .RB ( " only GRE tunnels " )
2266 use keyed GRE with key
2268 is either a number or an IP address-like dotted quad.
2271 parameter sets the key to use in both directions.
2273 .BR ikey " and " okey
2274 parameters set different keys for input and output.
2277 .BR csum ", " icsum ", " ocsum
2278 .RB ( " only GRE tunnels " )
2279 generate/require checksums for tunneled packets.
2282 flag calculates checksums for outgoing packets.
2285 flag requires that all input packets have the correct
2288 flag is equivalent to the combination
2292 .BR seq ", " iseq ", " oseq
2293 .RB ( " only GRE tunnels " )
2297 flag enables sequencing of outgoing packets.
2300 flag requires that all input packets are serialized.
2303 flag is equivalent to the combination
2305 .B It isn't work. Don't use it.
2309 .RB ( " only IPv6 tunnels " )
2310 Inherit DS field between inner and outer header.
2313 .BI encaplim " ELIM"
2314 .RB ( " only IPv6 tunnels " )
2315 set a fixed encapsulation limit. Default is 4.
2318 .BI flowlabel " FLOWLABEL"
2319 .RB ( " only IPv6 tunnels " )
2320 set a fixed flowlabel.
2322 .SS ip tunnel prl - potential router list (ISATAP only)
2326 mandatory device name.
2329 .BI prl-default " ADDR"
2331 .BI prl-nodefault " ADDR"
2333 .BI prl-delete " ADDR"
2334 .RB "Add or delete " ADDR
2335 as a potential router or default router.
2337 .SS ip tunnel show - list tunnels
2338 This command has no arguments.
2340 .SH ip monitor and rtmon - state monitoring
2344 utility can monitor the state of devices, addresses
2345 and routes continuously. This option has a slightly different format.
2348 command is the first in the command line and then the object list follows:
2350 .BR "ip monitor" " [ " all " |"
2351 .IR LISTofOBJECTS " ]"
2354 is the list of object types that we want to monitor.
2356 .BR link ", " address " and " route "."
2361 opens RTNETLINK, listens on it and dumps state changes in the format
2362 described in previous sections.
2365 If a file name is given, it does not listen on RTNETLINK,
2366 but opens the file containing RTNETLINK messages saved in binary format
2367 and dumps them. Such a history file can be generated with the
2369 utility. This utility has a command line syntax similar to
2373 should be started before the first network configuration command
2374 is issued. F.e. if you insert:
2377 rtmon file /var/log/rtmon.log
2380 in a startup script, you will be able to view the full history
2384 Certainly, it is possible to start
2387 It prepends the history with the state snapshot dumped at the moment
2390 .SH ip xfrm - setting xfrm
2391 xfrm is an IP framework, which can transform format of the datagrams,
2393 i.e. encrypt the packets with some algorithm. xfrm policy and xfrm state
2394 are associated through templates
2396 This framework is used as a part of IPsec protocol.
2398 .SS ip xfrm state add - add new state into xfrm
2400 .SS ip xfrm state update - update existing xfrm state
2402 .SS ip xfrm state allocspi - allocate SPI value
2406 is set as default to
2408 but it could be set to
2409 .BR tunnel "," ro " or " beet "."
2413 contains one or more flags.
2418 .BR noecn ", " decap-dscp " or " wildrecv "."
2422 encapsulation is set to encapsulation type
2423 .IR ENCAP-TYPE ", source port " SPORT ", destination port " DPORT " and " OADDR "."
2428 .BR espinudp " or " espinudp-nonike "."
2432 contains one or more algorithms
2434 which depend on the type of algorithm set by
2436 It can be used these algoritms
2437 .BR enc ", " auth " or " comp "."
2439 .SS ip xfrm policy add - add a new policy
2441 .SS ip xfrm policy update - update an existing policy
2443 .SS ip xfrm policy delete - delete existing policy
2445 .SS ip xfrm policy get - get existing policy
2447 .SS ip xfrm policy deleteall - delete all existing xfrm policy
2449 .SS ip xfrm policy list - print out the list of xfrm policy
2451 .SS ip xfrm policy flush - flush policies
2454 policies or only those specified with
2459 directory could be one of these:
2460 .BR "inp", " out " or " fwd".
2464 selects for which addresses will be set up the policy. The selector
2465 is defined by source and destination address.
2469 is defined by source port
2479 specify network device.
2483 the number of indexed policy.
2487 type is set as default on
2493 .BI action " ACTION "
2494 is set as default on
2496 It could be switch on
2500 .BI priority " PRIORITY "
2501 priority is a number. Default priority is set on zero.
2505 limits are set in seconds, bytes or numbers of packets.
2509 template list is based on
2511 .BR mode ", " reqid " and " level ". "
2515 is specified by source address, destination address,
2523 .BR esp ", " ah ", " comp ", " route2 " or " hao "."
2527 is set as default on
2529 but it could be set on
2530 .BR tunnel " or " beet "."
2534 is set as default on
2536 and the other choice is
2548 .SS ip xfrm monitor - is used for listing all objects or defined group of them.
2551 can monitor the policies for all objects or defined group of them.
2555 was written by Alexey N. Kuznetsov and added in Linux 2.2.
2559 .RB "IP Command reference " ip-cref.ps
2561 .RB "IP tunnels " ip-cref.ps
2563 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
2566 Original Manpage by Michail Litvak <mci@owl.openwall.com>