1 .TH IP 8 "17 January 2002" "iproute2" "Linux"
3 ip \- show / manipulate routing, devices, policy routing and tunnels
10 .RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
16 .BR link " | " addr " | " addrlabel " | " route " | " rule " | " neigh " | "\
17 tunnel " | " maddr " | " mroute " | " monitor " }"
22 \fB\-V\fR[\fIersion\fR] |
23 \fB\-s\fR[\fItatistics\fR] |
24 \fB\-r\fR[\fIesolve\fR] |
25 \fB\-f\fR[\fIamily\fR] {
26 .BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | "
27 \fB\-o\fR[\fIneline\fR] }
30 .BI "ip link set " DEVICE
31 .RB "{ " up " | " down " | " arp " { " on " | " off " } |"
33 .BR promisc " { " on " | " off " } |"
35 .BR allmulticast " { " on " | " off " } |"
37 .BR dynamic " { " on " | " off " } |"
39 .BR multicast " { " on " | " off " } |"
63 .BR "ip addr" " { " add " | " del " } "
64 .IB IFADDR " dev " STRING
67 .BR "ip addr" " { " show " | " flush " } [ " dev
72 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
77 .IR IFADDR " := " PREFIX " | " ADDR
91 .RB "[ " host " | " link " | " global " | "
95 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
99 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
100 tentative " | " deprecated " | " dadfailed " ]"
103 .BR "ip addrlabel" " { " add " | " del " } " prefix
111 .BR "ip addrlabel" " { " list " | " flush " }"
115 .BR list " | " flush " } "
121 .BI from " ADDRESS " iif " STRING"
128 .BR "ip route" " { " add " | " del " | " change " | " append " | "\
129 replace " | " monitor " } "
150 .IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]"
153 .IR NODE_SPEC " := [ " TYPE " ] " PREFIX " ["
166 .IR INFO_SPEC " := " "NH OPTIONS FLAGS" " ["
177 .IR NUMBER " ] " NHFLAGS
180 .IR OPTIONS " := " FLAGS " [ "
202 .BR unicast " | " local " | " broadcast " | " multicast " | "\
203 throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]"
206 .IR TABLE_ID " := [ "
207 .BR local "| " main " | " default " | " all " |"
212 .BR host " | " link " | " global " |"
217 .BR onlink " | " pervasive " ]"
221 .BR kernel " | " boot " | " static " |"
226 .RB " [ " list " | " add " | " del " | " flush " ]"
230 .IR SELECTOR " := [ "
238 .IR FWMARK[/MASK] " ] [ "
252 .BR prohibit " | " reject " | " unreachable " ] [ " realms
253 .RI "[" SRCREALM "/]" DSTREALM " ]"
256 .IR TABLE_ID " := [ "
257 .BR local " | " main " | " default " |"
261 .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
265 .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
271 .BR "ip neigh" " { " show " | " flush " } [ " to
279 .BR "ip tunnel" " { " add " | " change " | " del " | " show " | " prl " }"
289 .RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
291 .RB "[" i "|" o "]" csum " ] ]"
310 .RB "[ [" no "]" pmtudisc " ]"
313 .RB "[ " "dscp inherit" " ]"
317 .RB " { " ipip " | " gre " | " sit " | " isatap " | " ip6ip6 " | " ipip6 " | " any " }"
320 .IR ADDR " := { " IP_ADDRESS " |"
324 .IR TOS " := { " NUMBER " |"
334 .IR TTL " := { " 1 ".." 255 " | "
338 .IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"
341 .IR TIME " := " NUMBER "[s|ms|us|ns|j]"
344 .BR "ip maddr" " [ " add " | " del " ]"
345 .IB MULTIADDR " dev " STRING
348 .BR "ip maddr show" " [ " dev
352 .BR "ip mroute show" " ["
360 .BR "ip monitor" " [ " all " |"
361 .IR LISTofOBJECTS " ]"
365 .IR XFRM_OBJECT " { " COMMAND " }"
368 .IR XFRM_OBJECT " := { " state " | " policy " | " monitor " } "
371 .BR "ip xfrm state " { " add " | " update " } "
381 .RB " [ " replay-window
395 .BR "ip xfrm state allocspi "
409 .BR "ip xfrm state" " { " delete " | " get " } "
413 .BR "ip xfrm state" " { " deleteall " | " list " } [ "
424 .BR "ip xfrm state flush" " [ " proto
428 .BR "ip xfrm state count"
442 .IR XFRM_PROTO " := "
443 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
447 .RB " [ " transport " | " tunnel " | " ro " | " beet " ] "
448 .B (default=transport)
452 .RI " [ " FLAG-LIST " ] " FLAG
456 .RB " [ " noecn " | " decap-dscp " | " wildrecv " ] "
459 .IR ENCAP " := " ENCAP-TYPE " " SPORT " " DPORT " " OADDR
462 .IR ENCAP-TYPE " := "
468 .IR ALGO-LIST " := [ "
469 .IR ALGO-LIST " ] | [ "
480 .RB " [ " enc " | " auth " | " comp " ] "
485 .IR ADDR "[/" PLEN "]"
487 .IR ADDR "[/" PLEN "]"
488 .RI " [ " UPSPEC " ] "
507 .IR LIMIT-LIST " := [ " LIMIT-LIST " ] |"
513 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
515 .RB "[ ["byte-soft "|" byte-hard "]"
518 .RB " [ ["packet-soft "|" packet-hard "]"
522 .BR "ip xfrm policy" " { " add " | " update " } " " dir "
535 .RI " [ " LIMIT-LIST " ] [ "
539 .BR "ip xfrm policy" " { " delete " | " get " } " " dir "
540 .IR DIR " [ " SELECTOR " | "
549 .BR "ip xfrm policy" " { " deleteall " | " list " } "
562 .B "ip xfrm policy flush"
571 .RB " [ " main " | " sub " ] "
576 .RB " [ " in " | " out " | " fwd " ] "
581 .IR ADDR "[/" PLEN "]"
583 .IR ADDR "[/" PLEN] " [ " UPSPEC
603 .RB " [ " allow " | " block " ]"
607 .IR LIMIT-LIST " := "
609 .IR LIMIT-LIST " ] | "
615 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
617 .RB " [ [" byte-soft "|" byte-hard "]"
620 .RB "[" packet-soft "|" packet-hard "]"
626 .IR TMPL-LIST " ] | "
652 .IR XFRM_PROTO " := "
653 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
657 .RB " [ " transport " | " tunnel " | " beet " ] "
658 .B (default=transport)
662 .RB " [ " required " | " use " ] "
663 .B (default=required)
666 .BR "ip xfrm monitor" " [ " all " | "
667 .IR LISTofOBJECTS " ] "
675 .BR "\-V" , " -Version"
676 print the version of the
681 .BR "\-s" , " \-stats", " \-statistics"
682 output more information. If the option
683 appears twice or more, the amount of information increases.
684 As a rule, the information is statistics or some time values.
687 .BR "\-f" , " \-family"
688 followed by protocol family identifier:
689 .BR "inet" , " inet6"
692 ,enforce the protocol family to use. If the option is not present,
693 the protocol family is guessed from other arguments. If the rest
694 of the command line does not give enough information to guess the
697 falls back to the default one, usually
702 is a special family identifier meaning that no networking protocol
713 .BR "\-family inet6" .
718 .BR "\-family link" .
721 .BR "\-o" , " \-oneline"
722 output each record on a single line, replacing line feeds
725 character. This is convenient when you want to count records
733 .BR "\-r" , " \-resolve"
734 use the system's name resolver to print DNS names instead of
737 .SH IP - COMMAND SYNTAX
748 - protocol (IP or IPv6) address on a device.
752 - label configuration for protocol address selection.
756 - ARP or NDISC cache entry.
760 - routing table entry.
764 - rule in routing policy database.
772 - multicast routing cache entry.
780 - framework for IPsec protocol.
783 The names of all objects may be written in full or
784 abbreviated form, f.e.
794 Specifies the action to perform on the object.
795 The set of possible actions depends on the object type.
796 As a rule, it is possible to
797 .BR "add" , " delete"
802 ) objects, but some objects do not allow all of these operations
803 or have some additional commands. The
805 command is available for all objects. It prints
806 out a list of available commands and argument syntax conventions.
808 If no command is given, some default command is assumed.
811 or, if the objects of this class cannot be listed,
814 .SH ip link - network device configuration
817 is a network device and the corresponding commands
818 display and change the state of devices.
820 .SS ip link set - change device attributes
823 .BI dev " NAME " (default)
825 specifies network device to operate on.
829 change the state of the device to
835 .BR "arp on " or " arp off"
841 .BR "multicast on " or " multicast off"
847 .BR "dynamic on " or " dynamic off"
854 change the name of the device. This operation is not
855 recommended if the device is running or has some addresses
859 .BI txqueuelen " NUMBER"
862 change the transmit queue length of the device.
871 .BI address " LLADDRESS"
872 change the station address of the interface.
875 .BI broadcast " LLADDRESS"
879 .BI peer " LLADDRESS"
880 change the link layer broadcast address or the peer address when
886 move the device to the network namespace associated with the process
891 If multiple parameter changes are requested,
893 aborts immediately after any of the changes have failed.
894 This is the only case when
896 can move the system to an unpredictable state. The solution
897 is to avoid changing several parameters with one
901 .SS ip link show - display device attributes
904 .BI dev " NAME " (default)
906 specifies the network device to show.
907 If this argument is omitted all devices are listed.
911 only display running interfaces.
913 .SH ip address - protocol address management.
917 is a protocol (IP or IPv6) address attached
918 to a network device. Each device must have at least one address
919 to use the corresponding protocol. It is possible to have several
920 different addresses attached to one device. These addresses are not
921 discriminated, so that the term
923 is not quite appropriate for them and we do not use it in this document.
927 command displays addresses and their properties, adds new addresses
928 and deletes old ones.
930 .SS ip address add - add new protocol address.
934 the name of the device to add the address to.
937 .BI local " ADDRESS " (default)
938 the address of the interface. The format of the address depends
939 on the protocol. It is a dotted quad for IP and a sequence of
940 hexadecimal halfwords separated by colons for IPv6. The
942 may be followed by a slash and a decimal number which encodes
943 the network prefix length.
947 the address of the remote endpoint for pointopoint interfaces.
950 may be followed by a slash and a decimal number, encoding the network
951 prefix length. If a peer address is specified, the local address
952 cannot have a prefix length. The network prefix is associated
953 with the peer rather than with the local address.
956 .BI broadcast " ADDRESS"
957 the broadcast address on the interface.
959 It is possible to use the special symbols
963 instead of the broadcast address. In this case, the broadcast address
964 is derived by setting/resetting the host bits of the interface prefix.
968 Each address may be tagged with a label string.
969 In order to preserve compatibility with Linux-2.0 net aliases,
970 this string must coincide with the name of the device or must be prefixed
971 with the device name followed by colon.
974 .BI scope " SCOPE_VALUE"
975 the scope of the area where this address is valid.
976 The available scopes are listed in file
977 .BR "/etc/iproute2/rt_scopes" .
978 Predefined scope values are:
982 - the address is globally valid.
985 - (IPv6 only) the address is site local, i.e. it is
986 valid inside this site.
989 - the address is link local, i.e. it is valid only on this device.
992 - the address is valid only inside this host.
995 .SS ip address delete - delete protocol address
997 coincide with the arguments of
999 The device name is a required argument. The rest are optional.
1000 If no arguments are given, the first address is deleted.
1002 .SS ip address show - look at protocol addresses
1005 .BI dev " NAME " (default)
1009 .BI scope " SCOPE_VAL"
1010 only list addresses with this scope.
1014 only list addresses matching this prefix.
1017 .BI label " PATTERN"
1018 only list addresses with labels matching the
1021 is a usual shell style pattern.
1024 .BR dynamic " and " permanent
1025 (IPv6 only) only list addresses installed due to stateless
1026 address configuration or only list permanent (not dynamic)
1031 (IPv6 only) only list addresses which have not yet passed duplicate
1036 (IPv6 only) only list deprecated addresses.
1040 (IPv6 only) only list addresses which have failed duplicate
1044 .BR primary " and " secondary
1045 only list primary (or secondary) addresses.
1047 .SS ip address flush - flush protocol addresses
1048 This command flushes the protocol addresses selected by some criteria.
1051 This command has the same arguments as
1053 The difference is that it does not run when no arguments are given.
1057 This command (and other
1059 commands described below) is pretty dangerous. If you make a mistake,
1060 it will not forgive it, but will cruelly purge all the addresses.
1065 option, the command becomes verbose. It prints out the number of deleted
1066 addresses and the number of rounds made to flush the address list. If
1067 this option is given twice,
1069 also dumps all the deleted addresses in the format described in the
1070 previous subsection.
1072 .SH ip addrlabel - protocol address label management.
1074 IPv6 address label is used for address selection
1075 described in RFC 3484. Precedence is managed by userspace,
1076 and only label is stored in kernel.
1078 .SS ip addrlabel add - add an address label
1079 the command adds an address label entry to the kernel.
1081 .BI prefix " PREFIX"
1084 the outgoing interface.
1087 the label for the prefix.
1088 0xffffffff is reserved.
1089 .SS ip addrlabel del - delete an address label
1090 the command deletes an address label entry in the kernel.
1092 coincide with the arguments of
1094 but label is not required.
1095 .SS ip addrlabel list - list address labels
1096 the command show contents of address labels.
1097 .SS ip addrlabel flush - flush address labels
1098 the command flushes the contents of address labels and it does not restore default settings.
1099 .SH ip neighbour - neighbour/arp tables management.
1102 objects establish bindings between protocol addresses and
1103 link layer addresses for hosts sharing the same link.
1104 Neighbour entries are organized into tables. The IPv4 neighbour table
1105 is known by another name - the ARP table.
1108 The corresponding commands display neighbour bindings
1109 and their properties, add new neighbour entries and delete old ones.
1111 .SS ip neighbour add - add a new neighbour entry
1112 .SS ip neighbour change - change an existing entry
1113 .SS ip neighbour replace - add a new entry or change an existing one
1115 These commands create new neighbour records or update existing ones.
1118 .BI to " ADDRESS " (default)
1119 the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
1123 the interface to which this neighbour is attached.
1126 .BI lladdr " LLADDRESS"
1127 the link layer address of the neighbour.
1133 .BI nud " NUD_STATE"
1134 the state of the neighbour entry.
1136 is an abbreviation for 'Neigh bour Unreachability Detection'.
1137 The state can take one of the following values:
1141 - the neighbour entry is valid forever and can be only
1142 be removed administratively.
1146 - the neighbour entry is valid. No attempts to validate
1147 this entry will be made but it can be removed when its lifetime expires.
1151 - the neighbour entry is valid until the reachability
1156 - the neighbour entry is valid but suspicious.
1159 does not change the neighbour state if it was valid and the address
1160 is not changed by this command.
1163 .SS ip neighbour delete - delete a neighbour entry
1164 This command invalidates a neighbour entry.
1167 The arguments are the same as with
1168 .BR "ip neigh add" ,
1177 Attempts to delete or manually change a
1179 entry created by the kernel may result in unpredictable behaviour.
1180 Particularly, the kernel may try to resolve this address even
1183 interface or if the address is multicast or broadcast.
1185 .SS ip neighbour show - list neighbour entries
1187 This commands displays neighbour tables.
1190 .BI to " ADDRESS " (default)
1191 the prefix selecting the neighbours to list.
1195 only list the neighbours attached to this device.
1199 only list neighbours which are not currently in use.
1202 .BI nud " NUD_STATE"
1203 only list neighbour entries in this state.
1205 takes values listed below or the special value
1207 which means all states. This option may occur more than once.
1208 If this option is absent,
1210 lists all entries except for
1215 .SS ip neighbour flush - flush neighbour entries
1216 This command flushes neighbour tables, selecting
1217 entries to flush by some criteria.
1220 This command has the same arguments as
1222 The differences are that it does not run when no arguments are given,
1223 and that the default neighbour states to be flushed do not include
1231 option, the command becomes verbose. It prints out the number of
1232 deleted neighbours and the number of rounds made to flush the
1233 neighbour table. If the option is given
1236 also dumps all the deleted neighbours.
1238 .SH ip route - routing table management
1239 Manipulate route entries in the kernel routing tables keep
1240 information about paths to other networked nodes.
1246 - the route entry describes real paths to the destinations covered
1247 by the route prefix.
1251 - these destinations are unreachable. Packets are discarded and the
1255 The local senders get an
1261 - these destinations are unreachable. Packets are discarded silently.
1262 The local senders get an
1268 - these destinations are unreachable. Packets are discarded and the
1270 .I communication administratively prohibited
1271 is generated. The local senders get an
1277 - the destinations are assigned to this host. The packets are looped
1278 back and delivered locally.
1282 - the destinations are broadcast addresses. The packets are sent as
1287 - a special control route used together with policy rules. If such a
1288 route is selected, lookup in this table is terminated pretending that
1289 no route was found. Without policy routing it is equivalent to the
1290 absence of the route in the routing table. The packets are dropped
1291 and the ICMP message
1293 is generated. The local senders get an
1299 - a special NAT route. Destinations covered by the prefix
1300 are considered to be dummy (or external) addresses which require translation
1301 to real (or internal) ones before forwarding. The addresses to translate to
1302 are selected with the attribute
1304 Route NAT is no longer supported in Linux 2.6.
1310 .RI "- " "not implemented"
1311 the destinations are
1313 addresses assigned to this host. They are mainly equivalent
1316 with one difference: such addresses are invalid when used
1317 as the source address of any packet.
1321 - a special type used for multicast routing. It is not present in
1322 normal routing tables.
1327 Linux-2.x can pack routes into several routing
1328 tables identified by a number in the range from 1 to 255 or by
1330 .B /etc/iproute2/rt_tables
1331 By default all normal routes are inserted into the
1333 table (ID 254) and the kernel only uses this table when calculating routes.
1336 Actually, one other table always exists, which is invisible but
1337 even more important. It is the
1339 table (ID 255). This table
1340 consists of routes for local and broadcast addresses. The kernel maintains
1341 this table automatically and the administrator usually need not modify it
1344 The multiple routing tables enter the game when
1348 .SS ip route add - add new route
1349 .SS ip route change - change route
1350 .SS ip route replace - change or add new one
1353 .BI to " TYPE PREFIX " (default)
1354 the destination prefix of the route. If
1364 is an IP or IPv6 address optionally followed by a slash and the
1365 prefix length. If the length of the prefix is missing,
1367 assumes a full-length host route. There is also a special
1370 - which is equivalent to IP
1379 the Type Of Service (TOS) key. This key has no associated mask and
1380 the longest match is understood as: First, compare the TOS
1381 of the route and of the packet. If they are not equal, then the packet
1382 may still match a route with a zero TOS.
1384 is either an 8 bit hexadecimal number or an identifier
1386 .BR "/etc/iproute2/rt_dsfield" .
1389 .BI metric " NUMBER"
1391 .BI preference " NUMBER"
1392 the preference value of the route.
1394 is an arbitrary 32bit number.
1397 .BI table " TABLEID"
1398 the table to add this route to.
1400 may be a number or a string from the file
1401 .BR "/etc/iproute2/rt_tables" .
1402 If this parameter is omitted,
1406 table, with the exception of
1407 .BR local " , " broadcast " and " nat
1408 routes, which are put into the
1414 the output device name.
1418 the address of the nexthop router. Actually, the sense of this field
1419 depends on the route type. For normal
1421 routes it is either the true next hop router or, if it is a direct
1422 route installed in BSD compatibility mode, it can be a local address
1423 of the interface. For NAT routes it is the first address of the block
1424 of translated IP destinations.
1428 the source address to prefer when sending to the destinations
1429 covered by the route prefix.
1432 .BI realm " REALMID"
1433 the realm to which this route is assigned.
1435 may be a number or a string from the file
1436 .BR "/etc/iproute2/rt_realms" .
1441 .BI "mtu lock" " MTU"
1442 the MTU along the path to the destination. If the modifier
1444 is not used, the MTU may be updated by the kernel due to
1445 Path MTU Discovery. If the modifier
1447 is used, no path MTU discovery will be tried, all packets
1448 will be sent without the DF bit in IPv4 case or fragmented
1452 .BI window " NUMBER"
1453 the maximal window for TCP to advertise to these destinations,
1454 measured in bytes. It limits maximal data bursts that our TCP
1455 peers are allowed to send to us.
1459 the initial RTT ('Round Trip Time') estimate. If no suffix is
1460 specified the units are raw values passed directly to the
1461 routing code to maintain compatability with previous releases.
1462 Otherwise if a suffix of s, sec or secs is used to specify
1463 seconds; ms, msec or msecs to specify milliseconds; us, usec
1464 or usecs to specify microseconds; ns, nsec or nsecs to specify
1465 nanoseconds; j, hz or jiffies to specify jiffies, the value is
1466 converted to what the routing code expects.
1470 .BI rttvar " TIME " "(2.3.15+ only)"
1471 the initial RTT variance estimate. Values are specified as with
1476 .BI rto_min " TIME " "(2.6.23+ only)"
1477 the minimum TCP Retransmission TimeOut to use when communicating with this
1478 destination. Values are specified as with
1483 .BI ssthresh " NUMBER " "(2.3.15+ only)"
1484 an estimate for the initial slow start threshold.
1487 .BI cwnd " NUMBER " "(2.3.15+ only)"
1488 the clamp for congestion window. It is ignored if the
1493 .BI advmss " NUMBER " "(2.3.15+ only)"
1494 the MSS ('Maximal Segment Size') to advertise to these
1495 destinations when establishing TCP connections. If it is not given,
1496 Linux uses a default value calculated from the first hop device MTU.
1497 (If the path to these destination is asymmetric, this guess may be wrong.)
1500 .BI reordering " NUMBER " "(2.3.15+ only)"
1501 Maximal reordering on the path to this destination.
1502 If it is not given, Linux uses the value selected with
1505 .BR "net/ipv4/tcp_reordering" .
1508 .BI nexthop " NEXTHOP"
1509 the nexthop of a multipath route.
1511 is a complex value with its own syntax similar to the top level
1516 - is the nexthop router.
1520 - is the output device.
1523 .BI weight " NUMBER"
1524 - is a weight for this element of a multipath
1525 route reflecting its relative bandwidth or quality.
1529 .BI scope " SCOPE_VAL"
1530 the scope of the destinations covered by the route prefix.
1532 may be a number or a string from the file
1533 .BR "/etc/iproute2/rt_scopes" .
1534 If this parameter is omitted,
1543 .BR unicast " and " broadcast
1545 .BR host " for " local
1549 .BI protocol " RTPROTO"
1550 the routing protocol identifier of this route.
1552 may be a number or a string from the file
1553 .BR "/etc/iproute2/rt_protos" .
1554 If the routing protocol ID is not given,
1555 .B ip assumes protocol
1557 (i.e. it assumes the route was added by someone who doesn't
1558 understand what they are doing). Several protocol values have
1559 a fixed interpretation.
1564 - the route was installed due to an ICMP redirect.
1568 - the route was installed by the kernel during autoconfiguration.
1572 - the route was installed during the bootup sequence.
1573 If a routing daemon starts, it will purge all of them.
1577 - the route was installed by the administrator
1578 to override dynamic routing. Routing daemon will respect them
1579 and, probably, even advertise them to its peers.
1583 - the route was installed by Router Discovery protocol.
1587 The rest of the values are not reserved and the administrator is free
1588 to assign (or not to assign) protocol tags.
1592 pretend that the nexthop is directly attached to this link,
1593 even if it does not match any interface prefix.
1595 .SS ip route delete - delete route
1598 has the same arguments as
1599 .BR "ip route add" ,
1600 but their semantics are a bit different.
1603 .RB "(" to ", " tos ", " preference " and " table ")"
1604 select the route to delete. If optional attributes are present,
1606 verifies that they coincide with the attributes of the route to delete.
1607 If no route with the given key and attributes was found,
1611 .SS ip route show - list routes
1612 the command displays the contents of the routing tables or the route(s)
1613 selected by some criteria.
1616 .BI to " SELECTOR " (default)
1617 only select routes from the given range of destinations.
1619 consists of an optional modifier
1620 .RB "(" root ", " match " or " exact ")"
1623 selects routes with prefixes not shorter than
1627 selects the entire routing table.
1629 selects routes with prefixes not longer than
1632 .BI match " 10.0/16"
1635 .IR 10/8 " and " 0/0 ,
1636 but it does not select
1637 .IR 10.1/16 " and " 10.0.0/24 .
1642 selects routes with this exact prefix. If neither of these options
1647 i.e. it lists the entire table.
1652 only select routes with the given TOS.
1655 .BI table " TABLEID"
1656 show the routes from this table(s). The default setting is to show
1659 may either be the ID of a real table or one of the special values:
1663 - list all of the tables.
1666 - dump the routing cache.
1673 list cloned routes i.e. routes which were dynamically forked from
1674 other routes because some route attribute (f.e. MTU) was updated.
1675 Actually, it is equivalent to
1676 .BR "table cache" "."
1679 .BI from " SELECTOR"
1680 the same syntax as for
1682 but it binds the source address range rather than destinations.
1685 option only works with cloned routes.
1688 .BI protocol " RTPROTO"
1689 only list routes of this protocol.
1692 .BI scope " SCOPE_VAL"
1693 only list routes with this scope.
1697 only list routes of this type.
1701 only list routes going via this device.
1705 only list routes going via the nexthop routers selected by
1710 only list routes with preferred source addresses selected
1715 .BI realm " REALMID"
1717 .BI realms " FROMREALM/TOREALM"
1718 only list routes with these realms.
1720 .SS ip route flush - flush routing tables
1721 this command flushes routes selected by some criteria.
1724 The arguments have the same syntax and semantics as the arguments of
1725 .BR "ip route show" ,
1726 but routing tables are not listed but purged. The only difference is
1729 dumps all the IP main routing table but
1731 prints the helper page.
1736 option, the command becomes verbose. It prints out the number of
1737 deleted routes and the number of rounds made to flush the routing
1738 table. If the option is given
1741 also dumps all the deleted routes in the format described in the
1742 previous subsection.
1744 .SS ip route get - get a single route
1745 this command gets a single route to a destination and prints its
1746 contents exactly as the kernel sees it.
1749 .BI to " ADDRESS " (default)
1750 the destination address.
1760 the Type Of Service.
1764 the device from which this packet is expected to arrive.
1768 force the output device on which this packet will be routed.
1772 if no source address
1773 .RB "(option " from ")"
1774 was given, relookup the route with the source set to the preferred
1775 address received from the first lookup.
1776 If policy routing is used, it may be a different route.
1779 Note that this operation is not equivalent to
1780 .BR "ip route show" .
1782 shows existing routes.
1784 resolves them and creates new clones if necessary. Essentially,
1786 is equivalent to sending a packet along this path.
1789 argument is not given, the kernel creates a route
1790 to output packets towards the requested destination.
1791 This is equivalent to pinging the destination
1793 .BR "ip route ls cache" ,
1794 however, no packets are actually sent. With the
1796 argument, the kernel pretends that a packet arrived from this interface
1797 and searches for a path to forward the packet.
1799 .SH ip rule - routing policy database management
1802 in the routing policy database control the route selection algorithm.
1805 Classic routing algorithms used in the Internet make routing decisions
1806 based only on the destination address of packets (and in theory,
1807 but not in practice, on the TOS field).
1810 In some circumstances we want to route packets differently depending not only
1811 on destination addresses, but also on other packet fields: source address,
1812 IP protocol, transport protocol ports or even packet payload.
1813 This task is called 'policy routing'.
1816 To solve this task, the conventional destination based routing table, ordered
1817 according to the longest match rule, is replaced with a 'routing policy
1818 database' (or RPDB), which selects routes by executing some set of rules.
1821 Each policy routing rule consists of a
1824 .B action predicate.
1825 The RPDB is scanned in the order of increasing priority. The selector
1826 of each rule is applied to {source address, destination address, incoming
1827 interface, tos, fwmark} and, if the selector matches the packet,
1828 the action is performed. The action predicate may return with success.
1829 In this case, it will either give a route or failure indication
1830 and the RPDB lookup is terminated. Otherwise, the RPDB program
1831 continues on the next rule.
1834 Semantically, natural action is to select the nexthop and the output device.
1837 At startup time the kernel configures the default RPDB consisting of three
1842 Priority: 0, Selector: match anything, Action: lookup routing
1848 table is a special routing table containing
1849 high priority control routes for local and broadcast addresses.
1851 Rule 0 is special. It cannot be deleted or overridden.
1855 Priority: 32766, Selector: match anything, Action: lookup routing
1861 table is the normal routing table containing all non-policy
1862 routes. This rule may be deleted and/or overridden with other
1863 ones by the administrator.
1867 Priority: 32767, Selector: match anything, Action: lookup routing
1873 table is empty. It is reserved for some post-processing if no previous
1874 default rules selected the packet.
1875 This rule may also be deleted.
1878 Each RPDB entry has additional
1879 attributes. F.e. each rule has a pointer to some routing
1880 table. NAT and masquerading rules have an attribute to select new IP
1881 address to translate/masquerade. Besides that, rules have some
1882 optional attributes, which routes have, namely
1884 These values do not override those contained in the routing tables. They
1885 are only used if the route did not select any attributes.
1888 The RPDB may contain rules of the following types:
1892 - the rule prescribes to return the route found
1893 in the routing table referenced by the rule.
1896 - the rule prescribes to silently drop the packet.
1899 - the rule prescribes to generate a 'Network is unreachable' error.
1902 - the rule prescribes to generate 'Communication is administratively
1906 - the rule prescribes to translate the source address
1907 of the IP packet into some other value.
1910 .SS ip rule add - insert a new rule
1911 .SS ip rule delete - delete a rule
1914 .BI type " TYPE " (default)
1915 the type of this rule. The list of valid types was given in the previous
1920 select the source prefix to match.
1924 select the destination prefix to match.
1928 select the incoming device to match. If the interface is loopback,
1929 the rule only matches packets originating from this host. This means
1930 that you may create separate routing tables for forwarded and local
1931 packets and, hence, completely segregate them.
1935 select the outgoing device to match. The outgoing interface is only
1936 available for packets originating from local sockets that are bound to
1943 select the TOS value to match.
1952 .BI priority " PREFERENCE"
1953 the priority of this rule. Each rule should have an explicitly
1957 The options preference and order are synonyms with priority.
1960 .BI table " TABLEID"
1961 the routing table identifier to lookup if the rule selector matches.
1962 It is also possible to use lookup instead of table.
1965 .BI realms " FROM/TO"
1966 Realms to select if the rule matched and the routing table lookup
1969 is only used if the route did not select any realm.
1973 The base of the IP address block to translate (for source addresses).
1976 may be either the start of the block of NAT addresses (selected by NAT
1977 routes) or a local host address (or even zero).
1978 In the last case the router does not translate the packets, but
1979 masquerades them to this address.
1980 Using map-to instead of nat means the same thing.
1983 Changes to the RPDB made with these commands do not become active
1984 immediately. It is assumed that after a script finishes a batch of
1985 updates, it flushes the routing cache with
1986 .BR "ip route flush cache" .
1988 .SS ip rule flush - also dumps all the deleted rules.
1989 This command has no arguments.
1991 .SS ip rule show - list rules
1992 This command has no arguments.
1993 The options list or lst are synonyms with show.
1995 .SH ip maddress - multicast addresses management
1998 objects are multicast addresses.
2000 .SS ip maddress show - list multicast addresses
2003 .BI dev " NAME " (default)
2006 .SS ip maddress add - add a multicast address
2007 .SS ip maddress delete - delete a multicast address
2008 these commands attach/detach a static link layer multicast address
2009 to listen on the interface.
2010 Note that it is impossible to join protocol multicast groups
2011 statically. This command only manages link layer addresses.
2014 .BI address " LLADDRESS " (default)
2015 the link layer multicast address.
2019 the device to join/leave this multicast address.
2021 .SH ip mroute - multicast routing cache management
2023 objects are multicast routing cache entries created by a user level
2024 mrouting daemon (f.e.
2030 Due to the limitations of the current interface to the multicast routing
2031 engine, it is impossible to change
2033 objects administratively, so we may only display them. This limitation
2034 will be removed in the future.
2036 .SS ip mroute show - list mroute cache entries
2039 .BI to " PREFIX " (default)
2040 the prefix selecting the destination multicast addresses to list.
2044 the interface on which multicast packets are received.
2048 the prefix selecting the IP source addresses of the multicast route.
2050 .SH ip tunnel - tunnel configuration
2052 objects are tunnels, encapsulating packets in IP packets and then
2053 sending them over the IP infrastructure.
2054 The encapulating (or outer) address family is specified by the
2056 option. The default is IPv4.
2058 .SS ip tunnel add - add a new tunnel
2059 .SS ip tunnel change - change an existing tunnel
2060 .SS ip tunnel delete - destroy a tunnel
2063 .BI name " NAME " (default)
2064 select the tunnel device name.
2068 set the tunnel mode. Available modes depend on the encapsulating address family.
2070 Modes for IPv4 encapsulation available:
2071 .BR ipip ", " sit ", " isatap " and " gre "."
2073 Modes for IPv6 encapsulation available:
2074 .BR ip6ip6 ", " ipip6 " and " any "."
2077 .BI remote " ADDRESS"
2078 set the remote endpoint of the tunnel.
2081 .BI local " ADDRESS"
2082 set the fixed local address for tunneled packets.
2083 It must be an address on another interface of this host.
2089 on tunneled packets.
2091 is a number in the range 1--255. 0 is a special value
2092 meaning that packets inherit the TTL value.
2093 The default value for IPv4 tunnels is:
2095 The default value for IPv6 tunnels is:
2105 set a fixed TOS (or traffic class in IPv6)
2107 on tunneled packets.
2108 The default value is:
2113 bind the tunnel to the device
2115 so that tunneled packets will only be routed via this device and will
2116 not be able to escape to another device when the route to endpoint
2121 disable Path MTU Discovery on this tunnel.
2122 It is enabled by default. Note that a fixed ttl is incompatible
2123 with this option: tunnelling with a fixed ttl always makes pmtu
2132 .RB ( " only GRE tunnels " )
2133 use keyed GRE with key
2135 is either a number or an IP address-like dotted quad.
2138 parameter sets the key to use in both directions.
2140 .BR ikey " and " okey
2141 parameters set different keys for input and output.
2144 .BR csum ", " icsum ", " ocsum
2145 .RB ( " only GRE tunnels " )
2146 generate/require checksums for tunneled packets.
2149 flag calculates checksums for outgoing packets.
2152 flag requires that all input packets have the correct
2155 flag is equivalent to the combination
2159 .BR seq ", " iseq ", " oseq
2160 .RB ( " only GRE tunnels " )
2164 flag enables sequencing of outgoing packets.
2167 flag requires that all input packets are serialized.
2170 flag is equivalent to the combination
2172 .B It isn't work. Don't use it.
2176 .RB ( " only IPv6 tunnels " )
2177 Inherit DS field between inner and outer header.
2180 .BI encaplim " ELIM"
2181 .RB ( " only IPv6 tunnels " )
2182 set a fixed encapsulation limit. Default is 4.
2185 .BI flowlabel " FLOWLABEL"
2186 .RB ( " only IPv6 tunnels " )
2187 set a fixed flowlabel.
2189 .SS ip tunnel prl - potential router list (ISATAP only)
2193 mandatory device name.
2196 .BI prl-default " ADDR"
2198 .BI prl-nodefault " ADDR"
2200 .BI prl-delete " ADDR"
2201 .RB "Add or delete " ADDR
2202 as a potential router or default router.
2204 .SS ip tunnel show - list tunnels
2205 This command has no arguments.
2207 .SH ip monitor and rtmon - state monitoring
2211 utility can monitor the state of devices, addresses
2212 and routes continuously. This option has a slightly different format.
2215 command is the first in the command line and then the object list follows:
2217 .BR "ip monitor" " [ " all " |"
2218 .IR LISTofOBJECTS " ]"
2221 is the list of object types that we want to monitor.
2223 .BR link ", " address " and " route "."
2228 opens RTNETLINK, listens on it and dumps state changes in the format
2229 described in previous sections.
2232 If a file name is given, it does not listen on RTNETLINK,
2233 but opens the file containing RTNETLINK messages saved in binary format
2234 and dumps them. Such a history file can be generated with the
2236 utility. This utility has a command line syntax similar to
2240 should be started before the first network configuration command
2241 is issued. F.e. if you insert:
2244 rtmon file /var/log/rtmon.log
2247 in a startup script, you will be able to view the full history
2251 Certainly, it is possible to start
2254 It prepends the history with the state snapshot dumped at the moment
2257 .SH ip xfrm - setting xfrm
2258 xfrm is an IP framework, which can transform format of the datagrams,
2260 i.e. encrypt the packets with some algorithm. xfrm policy and xfrm state
2261 are associated through templates
2263 This framework is used as a part of IPsec protocol.
2265 .SS ip xfrm state add - add new state into xfrm
2267 .SS ip xfrm state update - update existing xfrm state
2269 .SS ip xfrm state allocspi - allocate SPI value
2273 is set as default to
2275 but it could be set to
2276 .BR tunnel "," ro " or " beet "."
2280 contains one or more flags.
2285 .BR noecn ", " decap-dscp " or " wildrecv "."
2289 encapsulation is set to encapsulation type
2290 .IR ENCAP-TYPE ", source port " SPORT ", destination port " DPORT " and " OADDR "."
2295 .BR espinudp " or " espinudp-nonike "."
2299 contains one or more algorithms
2301 which depend on the type of algorithm set by
2303 It can be used these algoritms
2304 .BR enc ", " auth " or " comp "."
2306 .SS ip xfrm policy add - add a new policy
2308 .SS ip xfrm policy update - update an existing policy
2310 .SS ip xfrm policy delete - delete existing policy
2312 .SS ip xfrm policy get - get existing policy
2314 .SS ip xfrm policy deleteall - delete all existing xfrm policy
2316 .SS ip xfrm policy list - print out the list of xfrm policy
2318 .SS ip xfrm policy flush - flush policies
2321 policies or only those specified with
2326 directory could be one of these:
2327 .BR "inp", " out " or " fwd".
2331 selects for which addresses will be set up the policy. The selector
2332 is defined by source and destination address.
2336 is defined by source port
2346 specify network device.
2350 the number of indexed policy.
2354 type is set as default on
2360 .BI action " ACTION "
2361 is set as default on
2363 It could be switch on
2367 .BI priority " PRIORITY "
2368 priority is a number. Default priority is set on zero.
2372 limits are set in seconds, bytes or numbers of packets.
2376 template list is based on
2378 .BR mode ", " reqid " and " level ". "
2382 is specified by source address, destination address,
2390 .BR esp ", " ah ", " comp ", " route2 " or " hao "."
2394 is set as default on
2396 but it could be set on
2397 .BR tunnel " or " beet "."
2401 is set as default on
2403 and the other choice is
2415 .SS ip xfrm monitor - is used for listing all objects or defined group of them.
2418 can monitor the policies for all objects or defined group of them.
2422 was written by Alexey N. Kuznetsov and added in Linux 2.2.
2426 .RB "IP Command reference " ip-cref.ps
2428 .RB "IP tunnels " ip-cref.ps
2430 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
2433 Original Manpage by Michail Litvak <mci@owl.openwall.com>