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 " } "
165 .BR "ip route restore"
170 .BI from " ADDRESS " iif " STRING"
177 .BR "ip route" " { " add " | " del " | " change " | " append " | "\
178 replace " | " monitor " } "
199 .IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]"
202 .IR NODE_SPEC " := [ " TYPE " ] " PREFIX " ["
215 .IR INFO_SPEC " := " "NH OPTIONS FLAGS" " ["
226 .IR NUMBER " ] " NHFLAGS
229 .IR OPTIONS " := " FLAGS " [ "
255 .BR unicast " | " local " | " broadcast " | " multicast " | "\
256 throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]"
259 .IR TABLE_ID " := [ "
260 .BR local "| " main " | " default " | " all " |"
265 .BR host " | " link " | " global " |"
270 .BR onlink " | " pervasive " ]"
274 .BR kernel " | " boot " | " static " |"
279 .RB " [ " list " | " add " | " del " | " flush " ]"
283 .IR SELECTOR " := [ "
291 .IR FWMARK[/MASK] " ] [ "
305 .BR prohibit " | " reject " | " unreachable " ] [ " realms
306 .RI "[" SRCREALM "/]" DSTREALM " ]"
309 .IR TABLE_ID " := [ "
310 .BR local " | " main " | " default " |"
314 .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
318 .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
324 .BR "ip neigh" " { " show " | " flush " } [ " to
332 .BR "ip tunnel" " { " add " | " change " | " del " | " show " | " prl " }"
342 .RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
344 .RB "[" i "|" o "]" csum " ] ]"
363 .RB "[ [" no "]" pmtudisc " ]"
366 .RB "[ " "dscp inherit" " ]"
370 .RB " { " ipip " | " gre " | " sit " | " isatap " | " ip6ip6 " | " ipip6 " | " any " }"
373 .IR ADDR " := { " IP_ADDRESS " |"
377 .IR TOS " := { " NUMBER " |"
387 .IR TTL " := { " 1 ".." 255 " | "
391 .IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"
394 .IR TIME " := " NUMBER "[s|ms|us|ns|j]"
397 .BR "ip maddr" " [ " add " | " del " ]"
398 .IB MULTIADDR " dev " STRING
401 .BR "ip maddr show" " [ " dev
405 .BR "ip mroute show" " ["
413 .BR "ip monitor" " [ " all " |"
414 .IR LISTofOBJECTS " ]"
418 .IR XFRM_OBJECT " { " COMMAND " }"
421 .IR XFRM_OBJECT " := { " state " | " policy " | " monitor " } "
424 .BR "ip xfrm state " { " add " | " update " } "
434 .RB " [ " replay-window
448 .BR "ip xfrm state allocspi "
462 .BR "ip xfrm state" " { " delete " | " get " } "
466 .BR "ip xfrm state" " { " deleteall " | " list " } [ "
477 .BR "ip xfrm state flush" " [ " proto
481 .BR "ip xfrm state count"
495 .IR XFRM_PROTO " := "
496 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
500 .RB " [ " transport " | " tunnel " | " ro " | " beet " ] "
501 .B (default=transport)
505 .RI " [ " FLAG-LIST " ] " FLAG
509 .RB " [ " noecn " | " decap-dscp " | " wildrecv " ] "
512 .IR ENCAP " := " ENCAP-TYPE " " SPORT " " DPORT " " OADDR
515 .IR ENCAP-TYPE " := "
521 .IR ALGO-LIST " := [ "
522 .IR ALGO-LIST " ] | [ "
533 .RB " [ " enc " | " auth " | " comp " ] "
538 .IR ADDR "[/" PLEN "]"
540 .IR ADDR "[/" PLEN "]"
541 .RI " [ " UPSPEC " ] "
563 .IR LIMIT-LIST " := [ " LIMIT-LIST " ] |"
569 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
571 .RB "[ ["byte-soft "|" byte-hard "]"
574 .RB " [ ["packet-soft "|" packet-hard "]"
578 .BR "ip xfrm policy" " { " add " | " update " } " " dir "
591 .RI " [ " LIMIT-LIST " ] [ "
595 .BR "ip xfrm policy" " { " delete " | " get " } " " dir "
596 .IR DIR " [ " SELECTOR " | "
605 .BR "ip xfrm policy" " { " deleteall " | " list " } "
618 .B "ip xfrm policy flush"
627 .RB " [ " main " | " sub " ] "
632 .RB " [ " in " | " out " | " fwd " ] "
637 .IR ADDR "[/" PLEN "]"
639 .IR ADDR "[/" PLEN] " [ " UPSPEC
662 .RB " [ " allow " | " block " ]"
666 .IR LIMIT-LIST " := "
668 .IR LIMIT-LIST " ] | "
674 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
676 .RB " [ [" byte-soft "|" byte-hard "]"
679 .RB "[" packet-soft "|" packet-hard "]"
685 .IR TMPL-LIST " ] | "
711 .IR XFRM_PROTO " := "
712 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
716 .RB " [ " transport " | " tunnel " | " beet " ] "
717 .B (default=transport)
721 .RB " [ " required " | " use " ] "
722 .B (default=required)
725 .BR "ip xfrm monitor" " [ " all " | "
726 .IR LISTofOBJECTS " ] "
734 .BR "\-V" , " -Version"
735 print the version of the
740 .BR "\-s" , " \-stats", " \-statistics"
741 output more information. If the option
742 appears twice or more, the amount of information increases.
743 As a rule, the information is statistics or some time values.
746 .BR "\-l" , " \-loops"
747 Specify maximum number of loops the 'ip addr flush' logic
748 will attempt before giving up. The default is 10.
749 Zero (0) means loop until all addresses are removed.
752 .BR "\-f" , " \-family"
753 followed by protocol family identifier:
754 .BR "inet" , " inet6"
757 ,enforce the protocol family to use. If the option is not present,
758 the protocol family is guessed from other arguments. If the rest
759 of the command line does not give enough information to guess the
762 falls back to the default one, usually
767 is a special family identifier meaning that no networking protocol
778 .BR "\-family inet6" .
783 .BR "\-family link" .
786 .BR "\-o" , " \-oneline"
787 output each record on a single line, replacing line feeds
790 character. This is convenient when you want to count records
798 .BR "\-r" , " \-resolve"
799 use the system's name resolver to print DNS names instead of
802 .SH IP - COMMAND SYNTAX
813 - protocol (IP or IPv6) address on a device.
817 - label configuration for protocol address selection.
821 - ARP or NDISC cache entry.
825 - routing table entry.
829 - rule in routing policy database.
837 - multicast routing cache entry.
845 - framework for IPsec protocol.
848 The names of all objects may be written in full or
849 abbreviated form, f.e.
859 Specifies the action to perform on the object.
860 The set of possible actions depends on the object type.
861 As a rule, it is possible to
862 .BR "add" , " delete"
867 ) objects, but some objects do not allow all of these operations
868 or have some additional commands. The
870 command is available for all objects. It prints
871 out a list of available commands and argument syntax conventions.
873 If no command is given, some default command is assumed.
876 or, if the objects of this class cannot be listed,
879 .SH ip link - network device configuration
882 is a network device and the corresponding commands
883 display and change the state of devices.
885 .SS ip link add - add virtual link
889 specifies the physical device to act operate on.
892 specifies the name of the new virtual device.
895 specifies the type of the new device.
901 - 802.1q tagged virrtual LAN interface
904 - virtual interface base on link layer address (MAC)
907 - Controller Area Network interface
910 .SS ip link delete - delete virtual link
912 specifies the virtual device to act operate on.
914 specifies the type of the device.
919 specifies the physical device to act operate on.
921 .SS ip link set - change device attributes
926 specifies network device to operate on. When configuring SR-IOV Virtual Fuction
927 (VF) devices, this keyword should specify the associated Physical Function (PF)
932 change the state of the device to
938 .BR "arp on " or " arp off"
944 .BR "multicast on " or " multicast off"
950 .BR "dynamic on " or " dynamic off"
957 change the name of the device. This operation is not
958 recommended if the device is running or has some addresses
962 .BI txqueuelen " NUMBER"
965 change the transmit queue length of the device.
974 .BI address " LLADDRESS"
975 change the station address of the interface.
978 .BI broadcast " LLADDRESS"
982 .BI peer " LLADDRESS"
983 change the link layer broadcast address or the peer address when
989 move the device to the network namespace associated with the process
994 give the device a symbolic name for easy reference.
998 specify a Virtual Function device to be configured. The associated PF device
999 must be specified using the
1004 .BI mac " LLADDRESS"
1005 - change the station address for the specified VF. The
1007 parameter must be specified.
1011 - change the assigned VLAN for the specified VF. When specified, all traffic
1012 sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
1013 will be filtered for the specified VLAN ID, and will have all VLAN tags
1014 stripped before being passed to the VF. Setting this parameter to 0 disables
1015 VLAN tagging and filtering. The
1017 parameter must be specified.
1021 - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
1022 tags transmitted by the VF will include the specified priority bits in the
1023 VLAN tag. If not specified, the value is assumed to be 0. Both the
1027 parameters must be specified. Setting both
1031 as 0 disables VLAN tagging and filtering for the VF.
1035 - change the allowed transmit bandwidth, in Mbps, for the specified VF.
1036 Setting this parameter to 0 disables rate limiting. The
1038 parameter must be specified.
1043 If multiple parameter changes are requested,
1045 aborts immediately after any of the changes have failed.
1046 This is the only case when
1048 can move the system to an unpredictable state. The solution
1049 is to avoid changing several parameters with one
1053 .SS ip link show - display device attributes
1056 .BI dev " NAME " (default)
1058 specifies the network device to show.
1059 If this argument is omitted all devices are listed.
1063 only display running interfaces.
1065 .SH ip address - protocol address management.
1069 is a protocol (IP or IPv6) address attached
1070 to a network device. Each device must have at least one address
1071 to use the corresponding protocol. It is possible to have several
1072 different addresses attached to one device. These addresses are not
1073 discriminated, so that the term
1075 is not quite appropriate for them and we do not use it in this document.
1079 command displays addresses and their properties, adds new addresses
1080 and deletes old ones.
1082 .SS ip address add - add new protocol address.
1086 the name of the device to add the address to.
1089 .BI local " ADDRESS " (default)
1090 the address of the interface. The format of the address depends
1091 on the protocol. It is a dotted quad for IP and a sequence of
1092 hexadecimal halfwords separated by colons for IPv6. The
1094 may be followed by a slash and a decimal number which encodes
1095 the network prefix length.
1099 the address of the remote endpoint for pointopoint interfaces.
1102 may be followed by a slash and a decimal number, encoding the network
1103 prefix length. If a peer address is specified, the local address
1104 cannot have a prefix length. The network prefix is associated
1105 with the peer rather than with the local address.
1108 .BI broadcast " ADDRESS"
1109 the broadcast address on the interface.
1111 It is possible to use the special symbols
1115 instead of the broadcast address. In this case, the broadcast address
1116 is derived by setting/resetting the host bits of the interface prefix.
1120 Each address may be tagged with a label string.
1121 In order to preserve compatibility with Linux-2.0 net aliases,
1122 this string must coincide with the name of the device or must be prefixed
1123 with the device name followed by colon.
1126 .BI scope " SCOPE_VALUE"
1127 the scope of the area where this address is valid.
1128 The available scopes are listed in file
1129 .BR "/etc/iproute2/rt_scopes" .
1130 Predefined scope values are:
1134 - the address is globally valid.
1137 - (IPv6 only) the address is site local, i.e. it is
1138 valid inside this site.
1141 - the address is link local, i.e. it is valid only on this device.
1144 - the address is valid only inside this host.
1147 .SS ip address delete - delete protocol address
1149 coincide with the arguments of
1151 The device name is a required argument. The rest are optional.
1152 If no arguments are given, the first address is deleted.
1154 .SS ip address show - look at protocol addresses
1157 .BI dev " NAME " (default)
1161 .BI scope " SCOPE_VAL"
1162 only list addresses with this scope.
1166 only list addresses matching this prefix.
1169 .BI label " PATTERN"
1170 only list addresses with labels matching the
1173 is a usual shell style pattern.
1176 .BR dynamic " and " permanent
1177 (IPv6 only) only list addresses installed due to stateless
1178 address configuration or only list permanent (not dynamic)
1183 (IPv6 only) only list addresses which have not yet passed duplicate
1188 (IPv6 only) only list deprecated addresses.
1192 (IPv6 only) only list addresses which have failed duplicate
1197 (IPv6 only) only list temporary addresses.
1200 .BR primary " and " secondary
1201 only list primary (or secondary) addresses.
1203 .SS ip address flush - flush protocol addresses
1204 This command flushes the protocol addresses selected by some criteria.
1207 This command has the same arguments as
1209 The difference is that it does not run when no arguments are given.
1213 This command (and other
1215 commands described below) is pretty dangerous. If you make a mistake,
1216 it will not forgive it, but will cruelly purge all the addresses.
1221 option, the command becomes verbose. It prints out the number of deleted
1222 addresses and the number of rounds made to flush the address list. If
1223 this option is given twice,
1225 also dumps all the deleted addresses in the format described in the
1226 previous subsection.
1228 .SH ip addrlabel - protocol address label management.
1230 IPv6 address label is used for address selection
1231 described in RFC 3484. Precedence is managed by userspace,
1232 and only label is stored in kernel.
1234 .SS ip addrlabel add - add an address label
1235 the command adds an address label entry to the kernel.
1237 .BI prefix " PREFIX"
1240 the outgoing interface.
1243 the label for the prefix.
1244 0xffffffff is reserved.
1245 .SS ip addrlabel del - delete an address label
1246 the command deletes an address label entry in the kernel.
1248 coincide with the arguments of
1250 but label is not required.
1251 .SS ip addrlabel list - list address labels
1252 the command show contents of address labels.
1253 .SS ip addrlabel flush - flush address labels
1254 the command flushes the contents of address labels and it does not restore default settings.
1255 .SH ip neighbour - neighbour/arp tables management.
1258 objects establish bindings between protocol addresses and
1259 link layer addresses for hosts sharing the same link.
1260 Neighbour entries are organized into tables. The IPv4 neighbour table
1261 is known by another name - the ARP table.
1264 The corresponding commands display neighbour bindings
1265 and their properties, add new neighbour entries and delete old ones.
1267 .SS ip neighbour add - add a new neighbour entry
1268 .SS ip neighbour change - change an existing entry
1269 .SS ip neighbour replace - add a new entry or change an existing one
1271 These commands create new neighbour records or update existing ones.
1274 .BI to " ADDRESS " (default)
1275 the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
1279 the interface to which this neighbour is attached.
1282 .BI lladdr " LLADDRESS"
1283 the link layer address of the neighbour.
1289 .BI nud " NUD_STATE"
1290 the state of the neighbour entry.
1292 is an abbreviation for 'Neighbour Unreachability Detection'.
1293 The state can take one of the following values:
1297 - the neighbour entry is valid forever and can be only
1298 be removed administratively.
1302 - the neighbour entry is valid. No attempts to validate
1303 this entry will be made but it can be removed when its lifetime expires.
1307 - the neighbour entry is valid until the reachability
1312 - the neighbour entry is valid but suspicious.
1315 does not change the neighbour state if it was valid and the address
1316 is not changed by this command.
1319 .SS ip neighbour delete - delete a neighbour entry
1320 This command invalidates a neighbour entry.
1323 The arguments are the same as with
1324 .BR "ip neigh add" ,
1333 Attempts to delete or manually change a
1335 entry created by the kernel may result in unpredictable behaviour.
1336 Particularly, the kernel may try to resolve this address even
1339 interface or if the address is multicast or broadcast.
1341 .SS ip neighbour show - list neighbour entries
1343 This commands displays neighbour tables.
1346 .BI to " ADDRESS " (default)
1347 the prefix selecting the neighbours to list.
1351 only list the neighbours attached to this device.
1355 only list neighbours which are not currently in use.
1358 .BI nud " NUD_STATE"
1359 only list neighbour entries in this state.
1361 takes values listed below or the special value
1363 which means all states. This option may occur more than once.
1364 If this option is absent,
1366 lists all entries except for
1371 .SS ip neighbour flush - flush neighbour entries
1372 This command flushes neighbour tables, selecting
1373 entries to flush by some criteria.
1376 This command has the same arguments as
1378 The differences are that it does not run when no arguments are given,
1379 and that the default neighbour states to be flushed do not include
1387 option, the command becomes verbose. It prints out the number of
1388 deleted neighbours and the number of rounds made to flush the
1389 neighbour table. If the option is given
1392 also dumps all the deleted neighbours.
1394 .SH ip route - routing table management
1395 Manipulate route entries in the kernel routing tables keep
1396 information about paths to other networked nodes.
1402 - the route entry describes real paths to the destinations covered
1403 by the route prefix.
1407 - these destinations are unreachable. Packets are discarded and the
1411 The local senders get an
1417 - these destinations are unreachable. Packets are discarded silently.
1418 The local senders get an
1424 - these destinations are unreachable. Packets are discarded and the
1426 .I communication administratively prohibited
1427 is generated. The local senders get an
1433 - the destinations are assigned to this host. The packets are looped
1434 back and delivered locally.
1438 - the destinations are broadcast addresses. The packets are sent as
1443 - a special control route used together with policy rules. If such a
1444 route is selected, lookup in this table is terminated pretending that
1445 no route was found. Without policy routing it is equivalent to the
1446 absence of the route in the routing table. The packets are dropped
1447 and the ICMP message
1449 is generated. The local senders get an
1455 - a special NAT route. Destinations covered by the prefix
1456 are considered to be dummy (or external) addresses which require translation
1457 to real (or internal) ones before forwarding. The addresses to translate to
1458 are selected with the attribute
1460 Route NAT is no longer supported in Linux 2.6.
1466 .RI "- " "not implemented"
1467 the destinations are
1469 addresses assigned to this host. They are mainly equivalent
1472 with one difference: such addresses are invalid when used
1473 as the source address of any packet.
1477 - a special type used for multicast routing. It is not present in
1478 normal routing tables.
1483 Linux-2.x can pack routes into several routing tables identified
1484 by a number in the range from 1 to 2^31 or by name from the file
1485 .B /etc/iproute2/rt_tables
1486 By default all normal routes are inserted into the
1488 table (ID 254) and the kernel only uses this table when calculating routes.
1489 Values (0, 253, 254, and 255) are reserved for built-in use.
1492 Actually, one other table always exists, which is invisible but
1493 even more important. It is the
1495 table (ID 255). This table
1496 consists of routes for local and broadcast addresses. The kernel maintains
1497 this table automatically and the administrator usually need not modify it
1500 The multiple routing tables enter the game when
1504 .SS ip route add - add new route
1505 .SS ip route change - change route
1506 .SS ip route replace - change or add new one
1509 .BI to " TYPE PREFIX " (default)
1510 the destination prefix of the route. If
1520 is an IP or IPv6 address optionally followed by a slash and the
1521 prefix length. If the length of the prefix is missing,
1523 assumes a full-length host route. There is also a special
1526 - which is equivalent to IP
1535 the Type Of Service (TOS) key. This key has no associated mask and
1536 the longest match is understood as: First, compare the TOS
1537 of the route and of the packet. If they are not equal, then the packet
1538 may still match a route with a zero TOS.
1540 is either an 8 bit hexadecimal number or an identifier
1542 .BR "/etc/iproute2/rt_dsfield" .
1545 .BI metric " NUMBER"
1547 .BI preference " NUMBER"
1548 the preference value of the route.
1550 is an arbitrary 32bit number.
1553 .BI table " TABLEID"
1554 the table to add this route to.
1556 may be a number or a string from the file
1557 .BR "/etc/iproute2/rt_tables" .
1558 If this parameter is omitted,
1562 table, with the exception of
1563 .BR local " , " broadcast " and " nat
1564 routes, which are put into the
1570 the output device name.
1574 the address of the nexthop router. Actually, the sense of this field
1575 depends on the route type. For normal
1577 routes it is either the true next hop router or, if it is a direct
1578 route installed in BSD compatibility mode, it can be a local address
1579 of the interface. For NAT routes it is the first address of the block
1580 of translated IP destinations.
1584 the source address to prefer when sending to the destinations
1585 covered by the route prefix.
1588 .BI realm " REALMID"
1589 the realm to which this route is assigned.
1591 may be a number or a string from the file
1592 .BR "/etc/iproute2/rt_realms" .
1597 .BI "mtu lock" " MTU"
1598 the MTU along the path to the destination. If the modifier
1600 is not used, the MTU may be updated by the kernel due to
1601 Path MTU Discovery. If the modifier
1603 is used, no path MTU discovery will be tried, all packets
1604 will be sent without the DF bit in IPv4 case or fragmented
1608 .BI window " NUMBER"
1609 the maximal window for TCP to advertise to these destinations,
1610 measured in bytes. It limits maximal data bursts that our TCP
1611 peers are allowed to send to us.
1615 the initial RTT ('Round Trip Time') estimate. If no suffix is
1616 specified the units are raw values passed directly to the
1617 routing code to maintain compatibility with previous releases.
1618 Otherwise if a suffix of s, sec or secs is used to specify
1619 seconds; ms, msec or msecs to specify milliseconds; us, usec
1620 or usecs to specify microseconds; ns, nsec or nsecs to specify
1621 nanoseconds; j, hz or jiffies to specify jiffies, the value is
1622 converted to what the routing code expects.
1626 .BI rttvar " TIME " "(2.3.15+ only)"
1627 the initial RTT variance estimate. Values are specified as with
1632 .BI rto_min " TIME " "(2.6.23+ only)"
1633 the minimum TCP Retransmission TimeOut to use when communicating with this
1634 destination. Values are specified as with
1639 .BI ssthresh " NUMBER " "(2.3.15+ only)"
1640 an estimate for the initial slow start threshold.
1643 .BI cwnd " NUMBER " "(2.3.15+ only)"
1644 the clamp for congestion window. It is ignored if the
1649 .BI initcwnd " NUMBER " "(2.5.70+ only)"
1650 the initial congestion window size for connections to this destination.
1651 Actual window size is this value multiplied by the MSS
1652 (``Maximal Segment Size'') for same connection. The default is
1653 zero, meaning to use the values specified in RFC2414.
1656 .BI initrwnd " NUMBER " "(2.6.33+ only)"
1657 the initial receive window size for connections to this destination.
1658 Actual window size is this value multiplied by the MSS of the connection.
1659 The default value is zero, meaning to use Slow Start value.
1662 .BI advmss " NUMBER " "(2.3.15+ only)"
1663 the MSS ('Maximal Segment Size') to advertise to these
1664 destinations when establishing TCP connections. If it is not given,
1665 Linux uses a default value calculated from the first hop device MTU.
1666 (If the path to these destination is asymmetric, this guess may be wrong.)
1669 .BI reordering " NUMBER " "(2.3.15+ only)"
1670 Maximal reordering on the path to this destination.
1671 If it is not given, Linux uses the value selected with
1674 .BR "net/ipv4/tcp_reordering" .
1677 .BI nexthop " NEXTHOP"
1678 the nexthop of a multipath route.
1680 is a complex value with its own syntax similar to the top level
1685 - is the nexthop router.
1689 - is the output device.
1692 .BI weight " NUMBER"
1693 - is a weight for this element of a multipath
1694 route reflecting its relative bandwidth or quality.
1698 .BI scope " SCOPE_VAL"
1699 the scope of the destinations covered by the route prefix.
1701 may be a number or a string from the file
1702 .BR "/etc/iproute2/rt_scopes" .
1703 If this parameter is omitted,
1712 .BR unicast " and " broadcast
1714 .BR host " for " local
1718 .BI protocol " RTPROTO"
1719 the routing protocol identifier of this route.
1721 may be a number or a string from the file
1722 .BR "/etc/iproute2/rt_protos" .
1723 If the routing protocol ID is not given,
1724 .B ip assumes protocol
1726 (i.e. it assumes the route was added by someone who doesn't
1727 understand what they are doing). Several protocol values have
1728 a fixed interpretation.
1733 - the route was installed due to an ICMP redirect.
1737 - the route was installed by the kernel during autoconfiguration.
1741 - the route was installed during the bootup sequence.
1742 If a routing daemon starts, it will purge all of them.
1746 - the route was installed by the administrator
1747 to override dynamic routing. Routing daemon will respect them
1748 and, probably, even advertise them to its peers.
1752 - the route was installed by Router Discovery protocol.
1756 The rest of the values are not reserved and the administrator is free
1757 to assign (or not to assign) protocol tags.
1761 pretend that the nexthop is directly attached to this link,
1762 even if it does not match any interface prefix.
1764 .SS ip route delete - delete route
1767 has the same arguments as
1768 .BR "ip route add" ,
1769 but their semantics are a bit different.
1772 .RB "(" to ", " tos ", " preference " and " table ")"
1773 select the route to delete. If optional attributes are present,
1775 verifies that they coincide with the attributes of the route to delete.
1776 If no route with the given key and attributes was found,
1780 .SS ip route show - list routes
1781 the command displays the contents of the routing tables or the route(s)
1782 selected by some criteria.
1785 .BI to " SELECTOR " (default)
1786 only select routes from the given range of destinations.
1788 consists of an optional modifier
1789 .RB "(" root ", " match " or " exact ")"
1792 selects routes with prefixes not shorter than
1796 selects the entire routing table.
1798 selects routes with prefixes not longer than
1801 .BI match " 10.0/16"
1804 .IR 10/8 " and " 0/0 ,
1805 but it does not select
1806 .IR 10.1/16 " and " 10.0.0/24 .
1811 selects routes with this exact prefix. If neither of these options
1816 i.e. it lists the entire table.
1821 only select routes with the given TOS.
1824 .BI table " TABLEID"
1825 show the routes from this table(s). The default setting is to show
1828 may either be the ID of a real table or one of the special values:
1832 - list all of the tables.
1835 - dump the routing cache.
1842 list cloned routes i.e. routes which were dynamically forked from
1843 other routes because some route attribute (f.e. MTU) was updated.
1844 Actually, it is equivalent to
1845 .BR "table cache" "."
1848 .BI from " SELECTOR"
1849 the same syntax as for
1851 but it binds the source address range rather than destinations.
1854 option only works with cloned routes.
1857 .BI protocol " RTPROTO"
1858 only list routes of this protocol.
1861 .BI scope " SCOPE_VAL"
1862 only list routes with this scope.
1866 only list routes of this type.
1870 only list routes going via this device.
1874 only list routes going via the nexthop routers selected by
1879 only list routes with preferred source addresses selected
1884 .BI realm " REALMID"
1886 .BI realms " FROMREALM/TOREALM"
1887 only list routes with these realms.
1889 .SS ip route flush - flush routing tables
1890 this command flushes routes selected by some criteria.
1893 The arguments have the same syntax and semantics as the arguments of
1894 .BR "ip route show" ,
1895 but routing tables are not listed but purged. The only difference is
1898 dumps all the IP main routing table but
1900 prints the helper page.
1905 option, the command becomes verbose. It prints out the number of
1906 deleted routes and the number of rounds made to flush the routing
1907 table. If the option is given
1910 also dumps all the deleted routes in the format described in the
1911 previous subsection.
1913 .SS ip route get - get a single route
1914 this command gets a single route to a destination and prints its
1915 contents exactly as the kernel sees it.
1918 .BI to " ADDRESS " (default)
1919 the destination address.
1929 the Type Of Service.
1933 the device from which this packet is expected to arrive.
1937 force the output device on which this packet will be routed.
1941 if no source address
1942 .RB "(option " from ")"
1943 was given, relookup the route with the source set to the preferred
1944 address received from the first lookup.
1945 If policy routing is used, it may be a different route.
1948 Note that this operation is not equivalent to
1949 .BR "ip route show" .
1951 shows existing routes.
1953 resolves them and creates new clones if necessary. Essentially,
1955 is equivalent to sending a packet along this path.
1958 argument is not given, the kernel creates a route
1959 to output packets towards the requested destination.
1960 This is equivalent to pinging the destination
1962 .BR "ip route ls cache" ,
1963 however, no packets are actually sent. With the
1965 argument, the kernel pretends that a packet arrived from this interface
1966 and searches for a path to forward the packet.
1968 .SS ip route save - save routing table information to stdout
1969 this command behaves like
1971 except that the output is raw data suitable for passing to
1972 .BR "ip route restore" .
1974 .SS ip route restore - restore routing table information from stdin
1975 this command expects to read a data stream as returned from
1976 .BR "ip route save" .
1977 It will attempt to restore the routing table information exactly as
1978 it was at the time of the save, so any translation of information
1979 in the stream (such as device indexes) must be done first. Any existing
1980 routes are left unchanged. Any routes specified in the data stream that
1981 already exist in the table will be ignored.
1983 .SH ip rule - routing policy database management
1986 in the routing policy database control the route selection algorithm.
1989 Classic routing algorithms used in the Internet make routing decisions
1990 based only on the destination address of packets (and in theory,
1991 but not in practice, on the TOS field).
1994 In some circumstances we want to route packets differently depending not only
1995 on destination addresses, but also on other packet fields: source address,
1996 IP protocol, transport protocol ports or even packet payload.
1997 This task is called 'policy routing'.
2000 To solve this task, the conventional destination based routing table, ordered
2001 according to the longest match rule, is replaced with a 'routing policy
2002 database' (or RPDB), which selects routes by executing some set of rules.
2005 Each policy routing rule consists of a
2008 .B action predicate.
2009 The RPDB is scanned in the order of increasing priority. The selector
2010 of each rule is applied to {source address, destination address, incoming
2011 interface, tos, fwmark} and, if the selector matches the packet,
2012 the action is performed. The action predicate may return with success.
2013 In this case, it will either give a route or failure indication
2014 and the RPDB lookup is terminated. Otherwise, the RPDB program
2015 continues on the next rule.
2018 Semantically, natural action is to select the nexthop and the output device.
2021 At startup time the kernel configures the default RPDB consisting of three
2026 Priority: 0, Selector: match anything, Action: lookup routing
2032 table is a special routing table containing
2033 high priority control routes for local and broadcast addresses.
2035 Rule 0 is special. It cannot be deleted or overridden.
2039 Priority: 32766, Selector: match anything, Action: lookup routing
2045 table is the normal routing table containing all non-policy
2046 routes. This rule may be deleted and/or overridden with other
2047 ones by the administrator.
2051 Priority: 32767, Selector: match anything, Action: lookup routing
2057 table is empty. It is reserved for some post-processing if no previous
2058 default rules selected the packet.
2059 This rule may also be deleted.
2062 Each RPDB entry has additional
2063 attributes. F.e. each rule has a pointer to some routing
2064 table. NAT and masquerading rules have an attribute to select new IP
2065 address to translate/masquerade. Besides that, rules have some
2066 optional attributes, which routes have, namely
2068 These values do not override those contained in the routing tables. They
2069 are only used if the route did not select any attributes.
2072 The RPDB may contain rules of the following types:
2076 - the rule prescribes to return the route found
2077 in the routing table referenced by the rule.
2080 - the rule prescribes to silently drop the packet.
2083 - the rule prescribes to generate a 'Network is unreachable' error.
2086 - the rule prescribes to generate 'Communication is administratively
2090 - the rule prescribes to translate the source address
2091 of the IP packet into some other value.
2094 .SS ip rule add - insert a new rule
2095 .SS ip rule delete - delete a rule
2098 .BI type " TYPE " (default)
2099 the type of this rule. The list of valid types was given in the previous
2104 select the source prefix to match.
2108 select the destination prefix to match.
2112 select the incoming device to match. If the interface is loopback,
2113 the rule only matches packets originating from this host. This means
2114 that you may create separate routing tables for forwarded and local
2115 packets and, hence, completely segregate them.
2119 select the outgoing device to match. The outgoing interface is only
2120 available for packets originating from local sockets that are bound to
2127 select the TOS value to match.
2136 .BI priority " PREFERENCE"
2137 the priority of this rule. Each rule should have an explicitly
2141 The options preference and order are synonyms with priority.
2144 .BI table " TABLEID"
2145 the routing table identifier to lookup if the rule selector matches.
2146 It is also possible to use lookup instead of table.
2149 .BI realms " FROM/TO"
2150 Realms to select if the rule matched and the routing table lookup
2153 is only used if the route did not select any realm.
2157 The base of the IP address block to translate (for source addresses).
2160 may be either the start of the block of NAT addresses (selected by NAT
2161 routes) or a local host address (or even zero).
2162 In the last case the router does not translate the packets, but
2163 masquerades them to this address.
2164 Using map-to instead of nat means the same thing.
2167 Changes to the RPDB made with these commands do not become active
2168 immediately. It is assumed that after a script finishes a batch of
2169 updates, it flushes the routing cache with
2170 .BR "ip route flush cache" .
2172 .SS ip rule flush - also dumps all the deleted rules.
2173 This command has no arguments.
2175 .SS ip rule show - list rules
2176 This command has no arguments.
2177 The options list or lst are synonyms with show.
2179 .SH ip maddress - multicast addresses management
2182 objects are multicast addresses.
2184 .SS ip maddress show - list multicast addresses
2187 .BI dev " NAME " (default)
2190 .SS ip maddress add - add a multicast address
2191 .SS ip maddress delete - delete a multicast address
2192 these commands attach/detach a static link layer multicast address
2193 to listen on the interface.
2194 Note that it is impossible to join protocol multicast groups
2195 statically. This command only manages link layer addresses.
2198 .BI address " LLADDRESS " (default)
2199 the link layer multicast address.
2203 the device to join/leave this multicast address.
2205 .SH ip mroute - multicast routing cache management
2207 objects are multicast routing cache entries created by a user level
2208 mrouting daemon (f.e.
2214 Due to the limitations of the current interface to the multicast routing
2215 engine, it is impossible to change
2217 objects administratively, so we may only display them. This limitation
2218 will be removed in the future.
2220 .SS ip mroute show - list mroute cache entries
2223 .BI to " PREFIX " (default)
2224 the prefix selecting the destination multicast addresses to list.
2228 the interface on which multicast packets are received.
2232 the prefix selecting the IP source addresses of the multicast route.
2234 .SH ip tunnel - tunnel configuration
2236 objects are tunnels, encapsulating packets in IP packets and then
2237 sending them over the IP infrastructure.
2238 The encapulating (or outer) address family is specified by the
2240 option. The default is IPv4.
2242 .SS ip tunnel add - add a new tunnel
2243 .SS ip tunnel change - change an existing tunnel
2244 .SS ip tunnel delete - destroy a tunnel
2247 .BI name " NAME " (default)
2248 select the tunnel device name.
2252 set the tunnel mode. Available modes depend on the encapsulating address family.
2254 Modes for IPv4 encapsulation available:
2255 .BR ipip ", " sit ", " isatap " and " gre "."
2257 Modes for IPv6 encapsulation available:
2258 .BR ip6ip6 ", " ipip6 " and " any "."
2261 .BI remote " ADDRESS"
2262 set the remote endpoint of the tunnel.
2265 .BI local " ADDRESS"
2266 set the fixed local address for tunneled packets.
2267 It must be an address on another interface of this host.
2273 on tunneled packets.
2275 is a number in the range 1--255. 0 is a special value
2276 meaning that packets inherit the TTL value.
2277 The default value for IPv4 tunnels is:
2279 The default value for IPv6 tunnels is:
2289 set a fixed TOS (or traffic class in IPv6)
2291 on tunneled packets.
2292 The default value is:
2297 bind the tunnel to the device
2299 so that tunneled packets will only be routed via this device and will
2300 not be able to escape to another device when the route to endpoint
2305 disable Path MTU Discovery on this tunnel.
2306 It is enabled by default. Note that a fixed ttl is incompatible
2307 with this option: tunnelling with a fixed ttl always makes pmtu
2316 .RB ( " only GRE tunnels " )
2317 use keyed GRE with key
2319 is either a number or an IP address-like dotted quad.
2322 parameter sets the key to use in both directions.
2324 .BR ikey " and " okey
2325 parameters set different keys for input and output.
2328 .BR csum ", " icsum ", " ocsum
2329 .RB ( " only GRE tunnels " )
2330 generate/require checksums for tunneled packets.
2333 flag calculates checksums for outgoing packets.
2336 flag requires that all input packets have the correct
2339 flag is equivalent to the combination
2343 .BR seq ", " iseq ", " oseq
2344 .RB ( " only GRE tunnels " )
2348 flag enables sequencing of outgoing packets.
2351 flag requires that all input packets are serialized.
2354 flag is equivalent to the combination
2356 .B It isn't work. Don't use it.
2360 .RB ( " only IPv6 tunnels " )
2361 Inherit DS field between inner and outer header.
2364 .BI encaplim " ELIM"
2365 .RB ( " only IPv6 tunnels " )
2366 set a fixed encapsulation limit. Default is 4.
2369 .BI flowlabel " FLOWLABEL"
2370 .RB ( " only IPv6 tunnels " )
2371 set a fixed flowlabel.
2373 .SS ip tunnel prl - potential router list (ISATAP only)
2377 mandatory device name.
2380 .BI prl-default " ADDR"
2382 .BI prl-nodefault " ADDR"
2384 .BI prl-delete " ADDR"
2385 .RB "Add or delete " ADDR
2386 as a potential router or default router.
2388 .SS ip tunnel show - list tunnels
2389 This command has no arguments.
2391 .SH ip monitor and rtmon - state monitoring
2395 utility can monitor the state of devices, addresses
2396 and routes continuously. This option has a slightly different format.
2399 command is the first in the command line and then the object list follows:
2401 .BR "ip monitor" " [ " all " |"
2402 .IR LISTofOBJECTS " ]"
2405 is the list of object types that we want to monitor.
2407 .BR link ", " address " and " route "."
2412 opens RTNETLINK, listens on it and dumps state changes in the format
2413 described in previous sections.
2416 If a file name is given, it does not listen on RTNETLINK,
2417 but opens the file containing RTNETLINK messages saved in binary format
2418 and dumps them. Such a history file can be generated with the
2420 utility. This utility has a command line syntax similar to
2424 should be started before the first network configuration command
2425 is issued. F.e. if you insert:
2428 rtmon file /var/log/rtmon.log
2431 in a startup script, you will be able to view the full history
2435 Certainly, it is possible to start
2438 It prepends the history with the state snapshot dumped at the moment
2441 .SH ip xfrm - setting xfrm
2442 xfrm is an IP framework, which can transform format of the datagrams,
2444 i.e. encrypt the packets with some algorithm. xfrm policy and xfrm state
2445 are associated through templates
2447 This framework is used as a part of IPsec protocol.
2449 .SS ip xfrm state add - add new state into xfrm
2451 .SS ip xfrm state update - update existing xfrm state
2453 .SS ip xfrm state allocspi - allocate SPI value
2457 is set as default to
2459 but it could be set to
2460 .BR tunnel "," ro " or " beet "."
2464 contains one or more flags.
2469 .BR noecn ", " decap-dscp " or " wildrecv "."
2473 encapsulation is set to encapsulation type
2474 .IR ENCAP-TYPE ", source port " SPORT ", destination port " DPORT " and " OADDR "."
2479 .BR espinudp " or " espinudp-nonike "."
2483 contains one or more algorithms
2485 which depend on the type of algorithm set by
2487 Valid algorithms are:
2488 .BR enc ", " auth " or " comp "."
2490 .SS ip xfrm policy add - add a new policy
2492 .SS ip xfrm policy update - update an existing policy
2494 .SS ip xfrm policy delete - delete existing policy
2496 .SS ip xfrm policy get - get existing policy
2498 .SS ip xfrm policy deleteall - delete all existing xfrm policy
2500 .SS ip xfrm policy list - print out the list of xfrm policy
2502 .SS ip xfrm policy flush - flush policies
2505 policies or only those specified with
2510 directory could be one of these:
2511 .BR "inp", " out " or " fwd".
2515 selects for which addresses will be set up the policy. The selector
2516 is defined by source and destination address.
2520 is defined by source port
2528 as dotted-quad or number.
2532 specify network device.
2536 the number of indexed policy.
2540 type is set as default on
2546 .BI action " ACTION "
2547 is set as default on
2549 It could be switch on
2553 .BI priority " PRIORITY "
2554 priority is a number. Default priority is set on zero.
2558 limits are set in seconds, bytes or numbers of packets.
2562 template list is based on
2564 .BR mode ", " reqid " and " level ". "
2568 is specified by source address, destination address,
2576 .BR esp ", " ah ", " comp ", " route2 " or " hao "."
2580 is set as default on
2582 but it could be set on
2583 .BR tunnel " or " beet "."
2587 is set as default on
2589 and the other choice is
2595 .BR sport " and " dport " (for UDP/TCP), "
2596 .BR type " and " code " (for ICMP; as number) or "
2597 .BR key " (for GRE; as dotted-quad or number)."
2600 .SS ip xfrm monitor - is used for listing all objects or defined group of them.
2603 can monitor the policies for all objects or defined group of them.
2607 was written by Alexey N. Kuznetsov and added in Linux 2.2.
2611 .RB "IP Command reference " ip-cref.ps
2613 .RB "IP tunnels " ip-cref.ps
2615 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
2618 Original Manpage by Michail Litvak <mci@owl.openwall.com>