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
61 .RB "} { " up " | " down " | " arp " { " on " | " off " } |"
63 .BR promisc " { " on " | " off " } |"
65 .BR allmulticast " { " on " | " off " } |"
67 .BR dynamic " { " on " | " off " } |"
69 .BR multicast " { " on " | " off " } |"
104 .RI "[ " DEVICE " | "
109 .BR "ip addr" " { " add " | " del " } "
110 .IB IFADDR " dev " STRING
113 .BR "ip addr" " { " show " | " flush " } [ " dev
118 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
123 .IR IFADDR " := " PREFIX " | " ADDR
137 .RB "[ " host " | " link " | " global " | "
141 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
145 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
146 tentative " | " deprecated " | " dadfailed " | " temporary " ]"
149 .BR "ip addrlabel" " { " add " | " del " } " prefix
157 .BR "ip addrlabel" " { " list " | " flush " }"
161 .BR list " | " flush " } "
169 .BR "ip route restore"
174 .BI from " ADDRESS " iif " STRING"
181 .BR "ip route" " { " add " | " del " | " change " | " append " | "\
182 replace " | " monitor " } "
203 .IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]"
206 .IR NODE_SPEC " := [ " TYPE " ] " PREFIX " ["
219 .IR INFO_SPEC " := " "NH OPTIONS FLAGS" " ["
230 .IR NUMBER " ] " NHFLAGS
233 .IR OPTIONS " := " FLAGS " [ "
259 .BR unicast " | " local " | " broadcast " | " multicast " | "\
260 throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]"
263 .IR TABLE_ID " := [ "
264 .BR local "| " main " | " default " | " all " |"
269 .BR host " | " link " | " global " |"
274 .BR onlink " | " pervasive " ]"
278 .BR kernel " | " boot " | " static " |"
283 .RB " [ " list " | " add " | " del " | " flush " ]"
287 .IR SELECTOR " := [ "
295 .IR FWMARK[/MASK] " ] [ "
309 .BR prohibit " | " reject " | " unreachable " ] [ " realms
310 .RI "[" SRCREALM "/]" DSTREALM " ]"
313 .IR TABLE_ID " := [ "
314 .BR local " | " main " | " default " |"
318 .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
322 .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
328 .BR "ip neigh" " { " show " | " flush " } [ " to
336 .BR "ip tunnel" " { " add " | " change " | " del " | " show " | " prl " }"
346 .RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
348 .RB "[" i "|" o "]" csum " ] ]"
367 .RB "[ [" no "]" pmtudisc " ]"
370 .RB "[ " "dscp inherit" " ]"
374 .RB " { " ipip " | " gre " | " sit " | " isatap " | " ip6ip6 " | " ipip6 " | " any " }"
377 .IR ADDR " := { " IP_ADDRESS " |"
381 .IR TOS " := { " NUMBER " |"
391 .IR TTL " := { " 1 ".." 255 " | "
395 .IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"
398 .IR TIME " := " NUMBER "[s|ms]"
401 .BR "ip maddr" " [ " add " | " del " ]"
402 .IB MULTIADDR " dev " STRING
405 .BR "ip maddr show" " [ " dev
409 .BR "ip mroute show" " ["
417 .BR "ip monitor" " [ " all " |"
418 .IR LISTofOBJECTS " ]"
422 .IR XFRM_OBJECT " { " COMMAND " }"
425 .IR XFRM_OBJECT " := { " state " | " policy " | " monitor " } "
428 .BR "ip xfrm state " { " add " | " update " } "
438 .RB " [ " replay-window
452 .BR "ip xfrm state allocspi "
466 .BR "ip xfrm state" " { " delete " | " get " } "
470 .BR "ip xfrm state" " { " deleteall " | " list " } [ "
481 .BR "ip xfrm state flush" " [ " proto
485 .BR "ip xfrm state count"
499 .IR XFRM_PROTO " := "
500 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
504 .RB " [ " transport " | " tunnel " | " ro " | " beet " ] "
505 .B (default=transport)
509 .RI " [ " FLAG-LIST " ] " FLAG
513 .RB " [ " noecn " | " decap-dscp " | " wildrecv " ] "
516 .IR ENCAP " := " ENCAP-TYPE " " SPORT " " DPORT " " OADDR
519 .IR ENCAP-TYPE " := "
525 .IR ALGO-LIST " := [ "
526 .IR ALGO-LIST " ] | [ "
537 .RB " [ " enc " | " auth " | " comp " ] "
542 .IR ADDR "[/" PLEN "]"
544 .IR ADDR "[/" PLEN "]"
545 .RI " [ " UPSPEC " ] "
567 .IR LIMIT-LIST " := [ " LIMIT-LIST " ] |"
573 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
575 .RB "[ ["byte-soft "|" byte-hard "]"
578 .RB " [ ["packet-soft "|" packet-hard "]"
582 .BR "ip xfrm policy" " { " add " | " update " } " " dir "
595 .RI " [ " LIMIT-LIST " ] [ "
599 .BR "ip xfrm policy" " { " delete " | " get " } " " dir "
600 .IR DIR " [ " SELECTOR " | "
609 .BR "ip xfrm policy" " { " deleteall " | " list " } "
622 .B "ip xfrm policy flush"
631 .RB " [ " main " | " sub " ] "
636 .RB " [ " in " | " out " | " fwd " ] "
641 .IR ADDR "[/" PLEN "]"
643 .IR ADDR "[/" PLEN] " [ " UPSPEC
666 .RB " [ " allow " | " block " ]"
670 .IR LIMIT-LIST " := "
672 .IR LIMIT-LIST " ] | "
678 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
680 .RB " [ [" byte-soft "|" byte-hard "]"
683 .RB "[" packet-soft "|" packet-hard "]"
689 .IR TMPL-LIST " ] | "
715 .IR XFRM_PROTO " := "
716 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
720 .RB " [ " transport " | " tunnel " | " beet " ] "
721 .B (default=transport)
725 .RB " [ " required " | " use " ] "
726 .B (default=required)
729 .BR "ip xfrm monitor" " [ " all " | "
730 .IR LISTofOBJECTS " ] "
738 .BR "\-V" , " -Version"
739 print the version of the
744 .BR "\-s" , " \-stats", " \-statistics"
745 output more information. If the option
746 appears twice or more, the amount of information increases.
747 As a rule, the information is statistics or some time values.
750 .BR "\-l" , " \-loops"
751 Specify maximum number of loops the 'ip addr flush' logic
752 will attempt before giving up. The default is 10.
753 Zero (0) means loop until all addresses are removed.
756 .BR "\-f" , " \-family"
757 followed by protocol family identifier:
758 .BR "inet" , " inet6"
761 ,enforce the protocol family to use. If the option is not present,
762 the protocol family is guessed from other arguments. If the rest
763 of the command line does not give enough information to guess the
766 falls back to the default one, usually
771 is a special family identifier meaning that no networking protocol
782 .BR "\-family inet6" .
787 .BR "\-family link" .
790 .BR "\-o" , " \-oneline"
791 output each record on a single line, replacing line feeds
794 character. This is convenient when you want to count records
802 .BR "\-r" , " \-resolve"
803 use the system's name resolver to print DNS names instead of
806 .SH IP - COMMAND SYNTAX
817 - protocol (IP or IPv6) address on a device.
821 - label configuration for protocol address selection.
825 - ARP or NDISC cache entry.
829 - routing table entry.
833 - rule in routing policy database.
841 - multicast routing cache entry.
849 - framework for IPsec protocol.
852 The names of all objects may be written in full or
853 abbreviated form, f.e.
863 Specifies the action to perform on the object.
864 The set of possible actions depends on the object type.
865 As a rule, it is possible to
866 .BR "add" , " delete"
871 ) objects, but some objects do not allow all of these operations
872 or have some additional commands. The
874 command is available for all objects. It prints
875 out a list of available commands and argument syntax conventions.
877 If no command is given, some default command is assumed.
880 or, if the objects of this class cannot be listed,
883 .SH ip link - network device configuration
886 is a network device and the corresponding commands
887 display and change the state of devices.
889 .SS ip link add - add virtual link
893 specifies the physical device to act operate on.
896 specifies the name of the new virtual device.
899 specifies the type of the new device.
905 - 802.1q tagged virrtual LAN interface
908 - virtual interface base on link layer address (MAC)
911 - Controller Area Network interface
914 .SS ip link delete - delete virtual link
916 specifies the virtual device to act operate on.
918 specifies the type of the device.
923 specifies the physical device to act operate on.
925 .SS ip link set - change device attributes
930 specifies network device to operate on. When configuring SR-IOV Virtual Fuction
931 (VF) devices, this keyword should specify the associated Physical Function (PF)
937 has a dual role: If both group and dev are present, then move the device to the
938 specified group. If only a group is specified, then the command operates on
939 all devices in that group.
943 change the state of the device to
949 .BR "arp on " or " arp off"
955 .BR "multicast on " or " multicast off"
961 .BR "dynamic on " or " dynamic off"
968 change the name of the device. This operation is not
969 recommended if the device is running or has some addresses
973 .BI txqueuelen " NUMBER"
976 change the transmit queue length of the device.
985 .BI address " LLADDRESS"
986 change the station address of the interface.
989 .BI broadcast " LLADDRESS"
993 .BI peer " LLADDRESS"
994 change the link layer broadcast address or the peer address when
1000 move the device to the network namespace associated with the process
1005 give the device a symbolic name for easy reference.
1009 specify the group the device belongs to.
1010 The available groups are listed in file
1011 .BR "/etc/iproute2/group" .
1015 specify a Virtual Function device to be configured. The associated PF device
1016 must be specified using the
1021 .BI mac " LLADDRESS"
1022 - change the station address for the specified VF. The
1024 parameter must be specified.
1028 - change the assigned VLAN for the specified VF. When specified, all traffic
1029 sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
1030 will be filtered for the specified VLAN ID, and will have all VLAN tags
1031 stripped before being passed to the VF. Setting this parameter to 0 disables
1032 VLAN tagging and filtering. The
1034 parameter must be specified.
1038 - assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
1039 tags transmitted by the VF will include the specified priority bits in the
1040 VLAN tag. If not specified, the value is assumed to be 0. Both the
1044 parameters must be specified. Setting both
1048 as 0 disables VLAN tagging and filtering for the VF.
1052 - change the allowed transmit bandwidth, in Mbps, for the specified VF.
1053 Setting this parameter to 0 disables rate limiting. The
1055 parameter must be specified.
1060 If multiple parameter changes are requested,
1062 aborts immediately after any of the changes have failed.
1063 This is the only case when
1065 can move the system to an unpredictable state. The solution
1066 is to avoid changing several parameters with one
1070 .SS ip link show - display device attributes
1073 .BI dev " NAME " (default)
1075 specifies the network device to show.
1076 If this argument is omitted all devices in the default group are listed.
1081 specifies what group of devices to show.
1085 only display running interfaces.
1087 .SH ip address - protocol address management.
1091 is a protocol (IP or IPv6) address attached
1092 to a network device. Each device must have at least one address
1093 to use the corresponding protocol. It is possible to have several
1094 different addresses attached to one device. These addresses are not
1095 discriminated, so that the term
1097 is not quite appropriate for them and we do not use it in this document.
1101 command displays addresses and their properties, adds new addresses
1102 and deletes old ones.
1104 .SS ip address add - add new protocol address.
1108 the name of the device to add the address to.
1111 .BI local " ADDRESS " (default)
1112 the address of the interface. The format of the address depends
1113 on the protocol. It is a dotted quad for IP and a sequence of
1114 hexadecimal halfwords separated by colons for IPv6. The
1116 may be followed by a slash and a decimal number which encodes
1117 the network prefix length.
1121 the address of the remote endpoint for pointopoint interfaces.
1124 may be followed by a slash and a decimal number, encoding the network
1125 prefix length. If a peer address is specified, the local address
1126 cannot have a prefix length. The network prefix is associated
1127 with the peer rather than with the local address.
1130 .BI broadcast " ADDRESS"
1131 the broadcast address on the interface.
1133 It is possible to use the special symbols
1137 instead of the broadcast address. In this case, the broadcast address
1138 is derived by setting/resetting the host bits of the interface prefix.
1142 Each address may be tagged with a label string.
1143 In order to preserve compatibility with Linux-2.0 net aliases,
1144 this string must coincide with the name of the device or must be prefixed
1145 with the device name followed by colon.
1148 .BI scope " SCOPE_VALUE"
1149 the scope of the area where this address is valid.
1150 The available scopes are listed in file
1151 .BR "/etc/iproute2/rt_scopes" .
1152 Predefined scope values are:
1156 - the address is globally valid.
1159 - (IPv6 only) the address is site local, i.e. it is
1160 valid inside this site.
1163 - the address is link local, i.e. it is valid only on this device.
1166 - the address is valid only inside this host.
1169 .SS ip address delete - delete protocol address
1171 coincide with the arguments of
1173 The device name is a required argument. The rest are optional.
1174 If no arguments are given, the first address is deleted.
1176 .SS ip address show - look at protocol addresses
1179 .BI dev " NAME " (default)
1183 .BI scope " SCOPE_VAL"
1184 only list addresses with this scope.
1188 only list addresses matching this prefix.
1191 .BI label " PATTERN"
1192 only list addresses with labels matching the
1195 is a usual shell style pattern.
1198 .BR dynamic " and " permanent
1199 (IPv6 only) only list addresses installed due to stateless
1200 address configuration or only list permanent (not dynamic)
1205 (IPv6 only) only list addresses which have not yet passed duplicate
1210 (IPv6 only) only list deprecated addresses.
1214 (IPv6 only) only list addresses which have failed duplicate
1219 (IPv6 only) only list temporary addresses.
1222 .BR primary " and " secondary
1223 only list primary (or secondary) addresses.
1225 .SS ip address flush - flush protocol addresses
1226 This command flushes the protocol addresses selected by some criteria.
1229 This command has the same arguments as
1231 The difference is that it does not run when no arguments are given.
1235 This command (and other
1237 commands described below) is pretty dangerous. If you make a mistake,
1238 it will not forgive it, but will cruelly purge all the addresses.
1243 option, the command becomes verbose. It prints out the number of deleted
1244 addresses and the number of rounds made to flush the address list. If
1245 this option is given twice,
1247 also dumps all the deleted addresses in the format described in the
1248 previous subsection.
1250 .SH ip addrlabel - protocol address label management.
1252 IPv6 address label is used for address selection
1253 described in RFC 3484. Precedence is managed by userspace,
1254 and only label is stored in kernel.
1256 .SS ip addrlabel add - add an address label
1257 the command adds an address label entry to the kernel.
1259 .BI prefix " PREFIX"
1262 the outgoing interface.
1265 the label for the prefix.
1266 0xffffffff is reserved.
1267 .SS ip addrlabel del - delete an address label
1268 the command deletes an address label entry in the kernel.
1270 coincide with the arguments of
1272 but label is not required.
1273 .SS ip addrlabel list - list address labels
1274 the command show contents of address labels.
1275 .SS ip addrlabel flush - flush address labels
1276 the command flushes the contents of address labels and it does not restore default settings.
1277 .SH ip neighbour - neighbour/arp tables management.
1280 objects establish bindings between protocol addresses and
1281 link layer addresses for hosts sharing the same link.
1282 Neighbour entries are organized into tables. The IPv4 neighbour table
1283 is known by another name - the ARP table.
1286 The corresponding commands display neighbour bindings
1287 and their properties, add new neighbour entries and delete old ones.
1289 .SS ip neighbour add - add a new neighbour entry
1290 .SS ip neighbour change - change an existing entry
1291 .SS ip neighbour replace - add a new entry or change an existing one
1293 These commands create new neighbour records or update existing ones.
1296 .BI to " ADDRESS " (default)
1297 the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
1301 the interface to which this neighbour is attached.
1304 .BI lladdr " LLADDRESS"
1305 the link layer address of the neighbour.
1311 .BI nud " NUD_STATE"
1312 the state of the neighbour entry.
1314 is an abbreviation for 'Neighbour Unreachability Detection'.
1315 The state can take one of the following values:
1319 - the neighbour entry is valid forever and can be only
1320 be removed administratively.
1324 - the neighbour entry is valid. No attempts to validate
1325 this entry will be made but it can be removed when its lifetime expires.
1329 - the neighbour entry is valid until the reachability
1334 - the neighbour entry is valid but suspicious.
1337 does not change the neighbour state if it was valid and the address
1338 is not changed by this command.
1341 .SS ip neighbour delete - delete a neighbour entry
1342 This command invalidates a neighbour entry.
1345 The arguments are the same as with
1346 .BR "ip neigh add" ,
1355 Attempts to delete or manually change a
1357 entry created by the kernel may result in unpredictable behaviour.
1358 Particularly, the kernel may try to resolve this address even
1361 interface or if the address is multicast or broadcast.
1363 .SS ip neighbour show - list neighbour entries
1365 This commands displays neighbour tables.
1368 .BI to " ADDRESS " (default)
1369 the prefix selecting the neighbours to list.
1373 only list the neighbours attached to this device.
1377 only list neighbours which are not currently in use.
1380 .BI nud " NUD_STATE"
1381 only list neighbour entries in this state.
1383 takes values listed below or the special value
1385 which means all states. This option may occur more than once.
1386 If this option is absent,
1388 lists all entries except for
1393 .SS ip neighbour flush - flush neighbour entries
1394 This command flushes neighbour tables, selecting
1395 entries to flush by some criteria.
1398 This command has the same arguments as
1400 The differences are that it does not run when no arguments are given,
1401 and that the default neighbour states to be flushed do not include
1409 option, the command becomes verbose. It prints out the number of
1410 deleted neighbours and the number of rounds made to flush the
1411 neighbour table. If the option is given
1414 also dumps all the deleted neighbours.
1416 .SH ip route - routing table management
1417 Manipulate route entries in the kernel routing tables keep
1418 information about paths to other networked nodes.
1424 - the route entry describes real paths to the destinations covered
1425 by the route prefix.
1429 - these destinations are unreachable. Packets are discarded and the
1433 The local senders get an
1439 - these destinations are unreachable. Packets are discarded silently.
1440 The local senders get an
1446 - these destinations are unreachable. Packets are discarded and the
1448 .I communication administratively prohibited
1449 is generated. The local senders get an
1455 - the destinations are assigned to this host. The packets are looped
1456 back and delivered locally.
1460 - the destinations are broadcast addresses. The packets are sent as
1465 - a special control route used together with policy rules. If such a
1466 route is selected, lookup in this table is terminated pretending that
1467 no route was found. Without policy routing it is equivalent to the
1468 absence of the route in the routing table. The packets are dropped
1469 and the ICMP message
1471 is generated. The local senders get an
1477 - a special NAT route. Destinations covered by the prefix
1478 are considered to be dummy (or external) addresses which require translation
1479 to real (or internal) ones before forwarding. The addresses to translate to
1480 are selected with the attribute
1482 Route NAT is no longer supported in Linux 2.6.
1488 .RI "- " "not implemented"
1489 the destinations are
1491 addresses assigned to this host. They are mainly equivalent
1494 with one difference: such addresses are invalid when used
1495 as the source address of any packet.
1499 - a special type used for multicast routing. It is not present in
1500 normal routing tables.
1505 Linux-2.x can pack routes into several routing tables identified
1506 by a number in the range from 1 to 2^31 or by name from the file
1507 .B /etc/iproute2/rt_tables
1508 By default all normal routes are inserted into the
1510 table (ID 254) and the kernel only uses this table when calculating routes.
1511 Values (0, 253, 254, and 255) are reserved for built-in use.
1514 Actually, one other table always exists, which is invisible but
1515 even more important. It is the
1517 table (ID 255). This table
1518 consists of routes for local and broadcast addresses. The kernel maintains
1519 this table automatically and the administrator usually need not modify it
1522 The multiple routing tables enter the game when
1526 .SS ip route add - add new route
1527 .SS ip route change - change route
1528 .SS ip route replace - change or add new one
1531 .BI to " TYPE PREFIX " (default)
1532 the destination prefix of the route. If
1542 is an IP or IPv6 address optionally followed by a slash and the
1543 prefix length. If the length of the prefix is missing,
1545 assumes a full-length host route. There is also a special
1548 - which is equivalent to IP
1557 the Type Of Service (TOS) key. This key has no associated mask and
1558 the longest match is understood as: First, compare the TOS
1559 of the route and of the packet. If they are not equal, then the packet
1560 may still match a route with a zero TOS.
1562 is either an 8 bit hexadecimal number or an identifier
1564 .BR "/etc/iproute2/rt_dsfield" .
1567 .BI metric " NUMBER"
1569 .BI preference " NUMBER"
1570 the preference value of the route.
1572 is an arbitrary 32bit number.
1575 .BI table " TABLEID"
1576 the table to add this route to.
1578 may be a number or a string from the file
1579 .BR "/etc/iproute2/rt_tables" .
1580 If this parameter is omitted,
1584 table, with the exception of
1585 .BR local " , " broadcast " and " nat
1586 routes, which are put into the
1592 the output device name.
1596 the address of the nexthop router. Actually, the sense of this field
1597 depends on the route type. For normal
1599 routes it is either the true next hop router or, if it is a direct
1600 route installed in BSD compatibility mode, it can be a local address
1601 of the interface. For NAT routes it is the first address of the block
1602 of translated IP destinations.
1606 the source address to prefer when sending to the destinations
1607 covered by the route prefix.
1610 .BI realm " REALMID"
1611 the realm to which this route is assigned.
1613 may be a number or a string from the file
1614 .BR "/etc/iproute2/rt_realms" .
1619 .BI "mtu lock" " MTU"
1620 the MTU along the path to the destination. If the modifier
1622 is not used, the MTU may be updated by the kernel due to
1623 Path MTU Discovery. If the modifier
1625 is used, no path MTU discovery will be tried, all packets
1626 will be sent without the DF bit in IPv4 case or fragmented
1630 .BI window " NUMBER"
1631 the maximal window for TCP to advertise to these destinations,
1632 measured in bytes. It limits maximal data bursts that our TCP
1633 peers are allowed to send to us.
1637 the initial RTT ('Round Trip Time') estimate. If no suffix is
1638 specified the units are raw values passed directly to the
1639 routing code to maintain compatibility with previous releases.
1640 Otherwise if a suffix of s, sec or secs is used to specify
1641 seconds and ms, msec or msecs to specify milliseconds.
1645 .BI rttvar " TIME " "(2.3.15+ only)"
1646 the initial RTT variance estimate. Values are specified as with
1651 .BI rto_min " TIME " "(2.6.23+ only)"
1652 the minimum TCP Retransmission TimeOut to use when communicating with this
1653 destination. Values are specified as with
1658 .BI ssthresh " NUMBER " "(2.3.15+ only)"
1659 an estimate for the initial slow start threshold.
1662 .BI cwnd " NUMBER " "(2.3.15+ only)"
1663 the clamp for congestion window. It is ignored if the
1668 .BI initcwnd " NUMBER " "(2.5.70+ only)"
1669 the initial congestion window size for connections to this destination.
1670 Actual window size is this value multiplied by the MSS
1671 (``Maximal Segment Size'') for same connection. The default is
1672 zero, meaning to use the values specified in RFC2414.
1675 .BI initrwnd " NUMBER " "(2.6.33+ only)"
1676 the initial receive window size for connections to this destination.
1677 Actual window size is this value multiplied by the MSS of the connection.
1678 The default value is zero, meaning to use Slow Start value.
1681 .BI advmss " NUMBER " "(2.3.15+ only)"
1682 the MSS ('Maximal Segment Size') to advertise to these
1683 destinations when establishing TCP connections. If it is not given,
1684 Linux uses a default value calculated from the first hop device MTU.
1685 (If the path to these destination is asymmetric, this guess may be wrong.)
1688 .BI reordering " NUMBER " "(2.3.15+ only)"
1689 Maximal reordering on the path to this destination.
1690 If it is not given, Linux uses the value selected with
1693 .BR "net/ipv4/tcp_reordering" .
1696 .BI nexthop " NEXTHOP"
1697 the nexthop of a multipath route.
1699 is a complex value with its own syntax similar to the top level
1704 - is the nexthop router.
1708 - is the output device.
1711 .BI weight " NUMBER"
1712 - is a weight for this element of a multipath
1713 route reflecting its relative bandwidth or quality.
1717 .BI scope " SCOPE_VAL"
1718 the scope of the destinations covered by the route prefix.
1720 may be a number or a string from the file
1721 .BR "/etc/iproute2/rt_scopes" .
1722 If this parameter is omitted,
1731 .BR unicast " and " broadcast
1733 .BR host " for " local
1737 .BI protocol " RTPROTO"
1738 the routing protocol identifier of this route.
1740 may be a number or a string from the file
1741 .BR "/etc/iproute2/rt_protos" .
1742 If the routing protocol ID is not given,
1743 .B ip assumes protocol
1745 (i.e. it assumes the route was added by someone who doesn't
1746 understand what they are doing). Several protocol values have
1747 a fixed interpretation.
1752 - the route was installed due to an ICMP redirect.
1756 - the route was installed by the kernel during autoconfiguration.
1760 - the route was installed during the bootup sequence.
1761 If a routing daemon starts, it will purge all of them.
1765 - the route was installed by the administrator
1766 to override dynamic routing. Routing daemon will respect them
1767 and, probably, even advertise them to its peers.
1771 - the route was installed by Router Discovery protocol.
1775 The rest of the values are not reserved and the administrator is free
1776 to assign (or not to assign) protocol tags.
1780 pretend that the nexthop is directly attached to this link,
1781 even if it does not match any interface prefix.
1783 .SS ip route delete - delete route
1786 has the same arguments as
1787 .BR "ip route add" ,
1788 but their semantics are a bit different.
1791 .RB "(" to ", " tos ", " preference " and " table ")"
1792 select the route to delete. If optional attributes are present,
1794 verifies that they coincide with the attributes of the route to delete.
1795 If no route with the given key and attributes was found,
1799 .SS ip route show - list routes
1800 the command displays the contents of the routing tables or the route(s)
1801 selected by some criteria.
1804 .BI to " SELECTOR " (default)
1805 only select routes from the given range of destinations.
1807 consists of an optional modifier
1808 .RB "(" root ", " match " or " exact ")"
1811 selects routes with prefixes not shorter than
1815 selects the entire routing table.
1817 selects routes with prefixes not longer than
1820 .BI match " 10.0/16"
1823 .IR 10/8 " and " 0/0 ,
1824 but it does not select
1825 .IR 10.1/16 " and " 10.0.0/24 .
1830 selects routes with this exact prefix. If neither of these options
1835 i.e. it lists the entire table.
1840 only select routes with the given TOS.
1843 .BI table " TABLEID"
1844 show the routes from this table(s). The default setting is to show
1847 may either be the ID of a real table or one of the special values:
1851 - list all of the tables.
1854 - dump the routing cache.
1861 list cloned routes i.e. routes which were dynamically forked from
1862 other routes because some route attribute (f.e. MTU) was updated.
1863 Actually, it is equivalent to
1864 .BR "table cache" "."
1867 .BI from " SELECTOR"
1868 the same syntax as for
1870 but it binds the source address range rather than destinations.
1873 option only works with cloned routes.
1876 .BI protocol " RTPROTO"
1877 only list routes of this protocol.
1880 .BI scope " SCOPE_VAL"
1881 only list routes with this scope.
1885 only list routes of this type.
1889 only list routes going via this device.
1893 only list routes going via the nexthop routers selected by
1898 only list routes with preferred source addresses selected
1903 .BI realm " REALMID"
1905 .BI realms " FROMREALM/TOREALM"
1906 only list routes with these realms.
1908 .SS ip route flush - flush routing tables
1909 this command flushes routes selected by some criteria.
1912 The arguments have the same syntax and semantics as the arguments of
1913 .BR "ip route show" ,
1914 but routing tables are not listed but purged. The only difference is
1917 dumps all the IP main routing table but
1919 prints the helper page.
1924 option, the command becomes verbose. It prints out the number of
1925 deleted routes and the number of rounds made to flush the routing
1926 table. If the option is given
1929 also dumps all the deleted routes in the format described in the
1930 previous subsection.
1932 .SS ip route get - get a single route
1933 this command gets a single route to a destination and prints its
1934 contents exactly as the kernel sees it.
1937 .BI to " ADDRESS " (default)
1938 the destination address.
1948 the Type Of Service.
1952 the device from which this packet is expected to arrive.
1956 force the output device on which this packet will be routed.
1960 if no source address
1961 .RB "(option " from ")"
1962 was given, relookup the route with the source set to the preferred
1963 address received from the first lookup.
1964 If policy routing is used, it may be a different route.
1967 Note that this operation is not equivalent to
1968 .BR "ip route show" .
1970 shows existing routes.
1972 resolves them and creates new clones if necessary. Essentially,
1974 is equivalent to sending a packet along this path.
1977 argument is not given, the kernel creates a route
1978 to output packets towards the requested destination.
1979 This is equivalent to pinging the destination
1981 .BR "ip route ls cache" ,
1982 however, no packets are actually sent. With the
1984 argument, the kernel pretends that a packet arrived from this interface
1985 and searches for a path to forward the packet.
1987 .SS ip route save - save routing table information to stdout
1988 this command behaves like
1990 except that the output is raw data suitable for passing to
1991 .BR "ip route restore" .
1993 .SS ip route restore - restore routing table information from stdin
1994 this command expects to read a data stream as returned from
1995 .BR "ip route save" .
1996 It will attempt to restore the routing table information exactly as
1997 it was at the time of the save, so any translation of information
1998 in the stream (such as device indexes) must be done first. Any existing
1999 routes are left unchanged. Any routes specified in the data stream that
2000 already exist in the table will be ignored.
2002 .SH ip rule - routing policy database management
2005 in the routing policy database control the route selection algorithm.
2008 Classic routing algorithms used in the Internet make routing decisions
2009 based only on the destination address of packets (and in theory,
2010 but not in practice, on the TOS field).
2013 In some circumstances we want to route packets differently depending not only
2014 on destination addresses, but also on other packet fields: source address,
2015 IP protocol, transport protocol ports or even packet payload.
2016 This task is called 'policy routing'.
2019 To solve this task, the conventional destination based routing table, ordered
2020 according to the longest match rule, is replaced with a 'routing policy
2021 database' (or RPDB), which selects routes by executing some set of rules.
2024 Each policy routing rule consists of a
2027 .B action predicate.
2028 The RPDB is scanned in the order of increasing priority. The selector
2029 of each rule is applied to {source address, destination address, incoming
2030 interface, tos, fwmark} and, if the selector matches the packet,
2031 the action is performed. The action predicate may return with success.
2032 In this case, it will either give a route or failure indication
2033 and the RPDB lookup is terminated. Otherwise, the RPDB program
2034 continues on the next rule.
2037 Semantically, natural action is to select the nexthop and the output device.
2040 At startup time the kernel configures the default RPDB consisting of three
2045 Priority: 0, Selector: match anything, Action: lookup routing
2051 table is a special routing table containing
2052 high priority control routes for local and broadcast addresses.
2054 Rule 0 is special. It cannot be deleted or overridden.
2058 Priority: 32766, Selector: match anything, Action: lookup routing
2064 table is the normal routing table containing all non-policy
2065 routes. This rule may be deleted and/or overridden with other
2066 ones by the administrator.
2070 Priority: 32767, Selector: match anything, Action: lookup routing
2076 table is empty. It is reserved for some post-processing if no previous
2077 default rules selected the packet.
2078 This rule may also be deleted.
2081 Each RPDB entry has additional
2082 attributes. F.e. each rule has a pointer to some routing
2083 table. NAT and masquerading rules have an attribute to select new IP
2084 address to translate/masquerade. Besides that, rules have some
2085 optional attributes, which routes have, namely
2087 These values do not override those contained in the routing tables. They
2088 are only used if the route did not select any attributes.
2091 The RPDB may contain rules of the following types:
2095 - the rule prescribes to return the route found
2096 in the routing table referenced by the rule.
2099 - the rule prescribes to silently drop the packet.
2102 - the rule prescribes to generate a 'Network is unreachable' error.
2105 - the rule prescribes to generate 'Communication is administratively
2109 - the rule prescribes to translate the source address
2110 of the IP packet into some other value.
2113 .SS ip rule add - insert a new rule
2114 .SS ip rule delete - delete a rule
2117 .BI type " TYPE " (default)
2118 the type of this rule. The list of valid types was given in the previous
2123 select the source prefix to match.
2127 select the destination prefix to match.
2131 select the incoming device to match. If the interface is loopback,
2132 the rule only matches packets originating from this host. This means
2133 that you may create separate routing tables for forwarded and local
2134 packets and, hence, completely segregate them.
2138 select the outgoing device to match. The outgoing interface is only
2139 available for packets originating from local sockets that are bound to
2146 select the TOS value to match.
2155 .BI priority " PREFERENCE"
2156 the priority of this rule. Each rule should have an explicitly
2160 The options preference and order are synonyms with priority.
2163 .BI table " TABLEID"
2164 the routing table identifier to lookup if the rule selector matches.
2165 It is also possible to use lookup instead of table.
2168 .BI realms " FROM/TO"
2169 Realms to select if the rule matched and the routing table lookup
2172 is only used if the route did not select any realm.
2176 The base of the IP address block to translate (for source addresses).
2179 may be either the start of the block of NAT addresses (selected by NAT
2180 routes) or a local host address (or even zero).
2181 In the last case the router does not translate the packets, but
2182 masquerades them to this address.
2183 Using map-to instead of nat means the same thing.
2186 Changes to the RPDB made with these commands do not become active
2187 immediately. It is assumed that after a script finishes a batch of
2188 updates, it flushes the routing cache with
2189 .BR "ip route flush cache" .
2191 .SS ip rule flush - also dumps all the deleted rules.
2192 This command has no arguments.
2194 .SS ip rule show - list rules
2195 This command has no arguments.
2196 The options list or lst are synonyms with show.
2198 .SH ip maddress - multicast addresses management
2201 objects are multicast addresses.
2203 .SS ip maddress show - list multicast addresses
2206 .BI dev " NAME " (default)
2209 .SS ip maddress add - add a multicast address
2210 .SS ip maddress delete - delete a multicast address
2211 these commands attach/detach a static link layer multicast address
2212 to listen on the interface.
2213 Note that it is impossible to join protocol multicast groups
2214 statically. This command only manages link layer addresses.
2217 .BI address " LLADDRESS " (default)
2218 the link layer multicast address.
2222 the device to join/leave this multicast address.
2224 .SH ip mroute - multicast routing cache management
2226 objects are multicast routing cache entries created by a user level
2227 mrouting daemon (f.e.
2233 Due to the limitations of the current interface to the multicast routing
2234 engine, it is impossible to change
2236 objects administratively, so we may only display them. This limitation
2237 will be removed in the future.
2239 .SS ip mroute show - list mroute cache entries
2242 .BI to " PREFIX " (default)
2243 the prefix selecting the destination multicast addresses to list.
2247 the interface on which multicast packets are received.
2251 the prefix selecting the IP source addresses of the multicast route.
2253 .SH ip tunnel - tunnel configuration
2255 objects are tunnels, encapsulating packets in IP packets and then
2256 sending them over the IP infrastructure.
2257 The encapulating (or outer) address family is specified by the
2259 option. The default is IPv4.
2261 .SS ip tunnel add - add a new tunnel
2262 .SS ip tunnel change - change an existing tunnel
2263 .SS ip tunnel delete - destroy a tunnel
2266 .BI name " NAME " (default)
2267 select the tunnel device name.
2271 set the tunnel mode. Available modes depend on the encapsulating address family.
2273 Modes for IPv4 encapsulation available:
2274 .BR ipip ", " sit ", " isatap " and " gre "."
2276 Modes for IPv6 encapsulation available:
2277 .BR ip6ip6 ", " ipip6 " and " any "."
2280 .BI remote " ADDRESS"
2281 set the remote endpoint of the tunnel.
2284 .BI local " ADDRESS"
2285 set the fixed local address for tunneled packets.
2286 It must be an address on another interface of this host.
2292 on tunneled packets.
2294 is a number in the range 1--255. 0 is a special value
2295 meaning that packets inherit the TTL value.
2296 The default value for IPv4 tunnels is:
2298 The default value for IPv6 tunnels is:
2308 set a fixed TOS (or traffic class in IPv6)
2310 on tunneled packets.
2311 The default value is:
2316 bind the tunnel to the device
2318 so that tunneled packets will only be routed via this device and will
2319 not be able to escape to another device when the route to endpoint
2324 disable Path MTU Discovery on this tunnel.
2325 It is enabled by default. Note that a fixed ttl is incompatible
2326 with this option: tunnelling with a fixed ttl always makes pmtu
2335 .RB ( " only GRE tunnels " )
2336 use keyed GRE with key
2338 is either a number or an IP address-like dotted quad.
2341 parameter sets the key to use in both directions.
2343 .BR ikey " and " okey
2344 parameters set different keys for input and output.
2347 .BR csum ", " icsum ", " ocsum
2348 .RB ( " only GRE tunnels " )
2349 generate/require checksums for tunneled packets.
2352 flag calculates checksums for outgoing packets.
2355 flag requires that all input packets have the correct
2358 flag is equivalent to the combination
2362 .BR seq ", " iseq ", " oseq
2363 .RB ( " only GRE tunnels " )
2367 flag enables sequencing of outgoing packets.
2370 flag requires that all input packets are serialized.
2373 flag is equivalent to the combination
2375 .B It isn't work. Don't use it.
2379 .RB ( " only IPv6 tunnels " )
2380 Inherit DS field between inner and outer header.
2383 .BI encaplim " ELIM"
2384 .RB ( " only IPv6 tunnels " )
2385 set a fixed encapsulation limit. Default is 4.
2388 .BI flowlabel " FLOWLABEL"
2389 .RB ( " only IPv6 tunnels " )
2390 set a fixed flowlabel.
2392 .SS ip tunnel prl - potential router list (ISATAP only)
2396 mandatory device name.
2399 .BI prl-default " ADDR"
2401 .BI prl-nodefault " ADDR"
2403 .BI prl-delete " ADDR"
2404 .RB "Add or delete " ADDR
2405 as a potential router or default router.
2407 .SS ip tunnel show - list tunnels
2408 This command has no arguments.
2410 .SH ip monitor and rtmon - state monitoring
2414 utility can monitor the state of devices, addresses
2415 and routes continuously. This option has a slightly different format.
2418 command is the first in the command line and then the object list follows:
2420 .BR "ip monitor" " [ " all " |"
2421 .IR LISTofOBJECTS " ]"
2424 is the list of object types that we want to monitor.
2426 .BR link ", " address " and " route "."
2431 opens RTNETLINK, listens on it and dumps state changes in the format
2432 described in previous sections.
2435 If a file name is given, it does not listen on RTNETLINK,
2436 but opens the file containing RTNETLINK messages saved in binary format
2437 and dumps them. Such a history file can be generated with the
2439 utility. This utility has a command line syntax similar to
2443 should be started before the first network configuration command
2444 is issued. F.e. if you insert:
2447 rtmon file /var/log/rtmon.log
2450 in a startup script, you will be able to view the full history
2454 Certainly, it is possible to start
2457 It prepends the history with the state snapshot dumped at the moment
2460 .SH ip xfrm - setting xfrm
2461 xfrm is an IP framework, which can transform format of the datagrams,
2463 i.e. encrypt the packets with some algorithm. xfrm policy and xfrm state
2464 are associated through templates
2466 This framework is used as a part of IPsec protocol.
2468 .SS ip xfrm state add - add new state into xfrm
2470 .SS ip xfrm state update - update existing xfrm state
2472 .SS ip xfrm state allocspi - allocate SPI value
2476 is set as default to
2478 but it could be set to
2479 .BR tunnel "," ro " or " beet "."
2483 contains one or more flags.
2488 .BR noecn ", " decap-dscp " or " wildrecv "."
2492 encapsulation is set to encapsulation type
2493 .IR ENCAP-TYPE ", source port " SPORT ", destination port " DPORT " and " OADDR "."
2498 .BR espinudp " or " espinudp-nonike "."
2502 contains one or more algorithms
2504 which depend on the type of algorithm set by
2506 Valid algorithms are:
2507 .BR enc ", " auth " or " comp "."
2509 .SS ip xfrm policy add - add a new policy
2511 .SS ip xfrm policy update - update an existing policy
2513 .SS ip xfrm policy delete - delete existing policy
2515 .SS ip xfrm policy get - get existing policy
2517 .SS ip xfrm policy deleteall - delete all existing xfrm policy
2519 .SS ip xfrm policy list - print out the list of xfrm policy
2521 .SS ip xfrm policy flush - flush policies
2524 policies or only those specified with
2529 directory could be one of these:
2530 .BR "inp", " out " or " fwd".
2534 selects for which addresses will be set up the policy. The selector
2535 is defined by source and destination address.
2539 is defined by source port
2547 as dotted-quad or number.
2551 specify network device.
2555 the number of indexed policy.
2559 type is set as default on
2565 .BI action " ACTION "
2566 is set as default on
2568 It could be switch on
2572 .BI priority " PRIORITY "
2573 priority is a number. Default priority is set on zero.
2577 limits are set in seconds, bytes or numbers of packets.
2581 template list is based on
2583 .BR mode ", " reqid " and " level ". "
2587 is specified by source address, destination address,
2595 .BR esp ", " ah ", " comp ", " route2 " or " hao "."
2599 is set as default on
2601 but it could be set on
2602 .BR tunnel " or " beet "."
2606 is set as default on
2608 and the other choice is
2614 .BR sport " and " dport " (for UDP/TCP), "
2615 .BR type " and " code " (for ICMP; as number) or "
2616 .BR key " (for GRE; as dotted-quad or number)."
2619 .SS ip xfrm monitor - is used for listing all objects or defined group of them.
2622 can monitor the policies for all objects or defined group of them.
2626 was written by Alexey N. Kuznetsov and added in Linux 2.2.
2630 .RB "IP Command reference " ip-cref.ps
2632 .RB "IP tunnels " ip-cref.ps
2634 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
2637 Original Manpage by Michail Litvak <mci@owl.openwall.com>