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 " |"
221 .BR onlink " | " pervasive " ]"
225 .BR kernel " | " boot " | " static " |"
230 .RB " [ " list " | " add " | " del " | " flush " ]"
234 .IR SELECTOR " := [ "
242 .IR FWMARK[/MASK] " ] [ "
256 .BR prohibit " | " reject " | " unreachable " ] [ " realms
257 .RI "[" SRCREALM "/]" DSTREALM " ]"
260 .IR TABLE_ID " := [ "
261 .BR local " | " main " | " default " |"
265 .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
269 .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
275 .BR "ip neigh" " { " show " | " flush " } [ " to
283 .BR "ip tunnel" " { " add " | " change " | " del " | " show " | " prl " }"
293 .RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
295 .RB "[" i "|" o "]" csum " ] ]"
314 .RB "[ [" no "]" pmtudisc " ]"
317 .RB "[ " "dscp inherit" " ]"
321 .RB " { " ipip " | " gre " | " sit " | " isatap " | " ip6ip6 " | " ipip6 " | " any " }"
324 .IR ADDR " := { " IP_ADDRESS " |"
328 .IR TOS " := { " NUMBER " |"
338 .IR TTL " := { " 1 ".." 255 " | "
342 .IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"
345 .IR TIME " := " NUMBER "[s|ms|us|ns|j]"
348 .BR "ip maddr" " [ " add " | " del " ]"
349 .IB MULTIADDR " dev " STRING
352 .BR "ip maddr show" " [ " dev
356 .BR "ip mroute show" " ["
364 .BR "ip monitor" " [ " all " |"
365 .IR LISTofOBJECTS " ]"
369 .IR XFRM_OBJECT " { " COMMAND " }"
372 .IR XFRM_OBJECT " := { " state " | " policy " | " monitor " } "
375 .BR "ip xfrm state " { " add " | " update " } "
385 .RB " [ " replay-window
399 .BR "ip xfrm state allocspi "
413 .BR "ip xfrm state" " { " delete " | " get " } "
417 .BR "ip xfrm state" " { " deleteall " | " list " } [ "
428 .BR "ip xfrm state flush" " [ " proto
432 .BR "ip xfrm state count"
446 .IR XFRM_PROTO " := "
447 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
451 .RB " [ " transport " | " tunnel " | " ro " | " beet " ] "
452 .B (default=transport)
456 .RI " [ " FLAG-LIST " ] " FLAG
460 .RB " [ " noecn " | " decap-dscp " | " wildrecv " ] "
463 .IR ENCAP " := " ENCAP-TYPE " " SPORT " " DPORT " " OADDR
466 .IR ENCAP-TYPE " := "
472 .IR ALGO-LIST " := [ "
473 .IR ALGO-LIST " ] | [ "
484 .RB " [ " enc " | " auth " | " comp " ] "
489 .IR ADDR "[/" PLEN "]"
491 .IR ADDR "[/" PLEN "]"
492 .RI " [ " UPSPEC " ] "
511 .IR LIMIT-LIST " := [ " LIMIT-LIST " ] |"
517 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
519 .RB "[ ["byte-soft "|" byte-hard "]"
522 .RB " [ ["packet-soft "|" packet-hard "]"
526 .BR "ip xfrm policy" " { " add " | " update " } " " dir "
539 .RI " [ " LIMIT-LIST " ] [ "
543 .BR "ip xfrm policy" " { " delete " | " get " } " " dir "
544 .IR DIR " [ " SELECTOR " | "
553 .BR "ip xfrm policy" " { " deleteall " | " list " } "
566 .B "ip xfrm policy flush"
575 .RB " [ " main " | " sub " ] "
580 .RB " [ " in " | " out " | " fwd " ] "
585 .IR ADDR "[/" PLEN "]"
587 .IR ADDR "[/" PLEN] " [ " UPSPEC
607 .RB " [ " allow " | " block " ]"
611 .IR LIMIT-LIST " := "
613 .IR LIMIT-LIST " ] | "
619 .RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
621 .RB " [ [" byte-soft "|" byte-hard "]"
624 .RB "[" packet-soft "|" packet-hard "]"
630 .IR TMPL-LIST " ] | "
656 .IR XFRM_PROTO " := "
657 .RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "
661 .RB " [ " transport " | " tunnel " | " beet " ] "
662 .B (default=transport)
666 .RB " [ " required " | " use " ] "
667 .B (default=required)
670 .BR "ip xfrm monitor" " [ " all " | "
671 .IR LISTofOBJECTS " ] "
679 .BR "\-V" , " -Version"
680 print the version of the
685 .BR "\-s" , " \-stats", " \-statistics"
686 output more information. If the option
687 appears twice or more, the amount of information increases.
688 As a rule, the information is statistics or some time values.
691 .BR "\-f" , " \-family"
692 followed by protocol family identifier:
693 .BR "inet" , " inet6"
696 ,enforce the protocol family to use. If the option is not present,
697 the protocol family is guessed from other arguments. If the rest
698 of the command line does not give enough information to guess the
701 falls back to the default one, usually
706 is a special family identifier meaning that no networking protocol
717 .BR "\-family inet6" .
722 .BR "\-family link" .
725 .BR "\-o" , " \-oneline"
726 output each record on a single line, replacing line feeds
729 character. This is convenient when you want to count records
737 .BR "\-r" , " \-resolve"
738 use the system's name resolver to print DNS names instead of
741 .SH IP - COMMAND SYNTAX
752 - protocol (IP or IPv6) address on a device.
756 - label configuration for protocol address selection.
760 - ARP or NDISC cache entry.
764 - routing table entry.
768 - rule in routing policy database.
776 - multicast routing cache entry.
784 - framework for IPsec protocol.
787 The names of all objects may be written in full or
788 abbreviated form, f.e.
798 Specifies the action to perform on the object.
799 The set of possible actions depends on the object type.
800 As a rule, it is possible to
801 .BR "add" , " delete"
806 ) objects, but some objects do not allow all of these operations
807 or have some additional commands. The
809 command is available for all objects. It prints
810 out a list of available commands and argument syntax conventions.
812 If no command is given, some default command is assumed.
815 or, if the objects of this class cannot be listed,
818 .SH ip link - network device configuration
821 is a network device and the corresponding commands
822 display and change the state of devices.
824 .SS ip link set - change device attributes
827 .BI dev " NAME " (default)
829 specifies network device to operate on.
833 change the state of the device to
839 .BR "arp on " or " arp off"
845 .BR "multicast on " or " multicast off"
851 .BR "dynamic on " or " dynamic off"
858 change the name of the device. This operation is not
859 recommended if the device is running or has some addresses
863 .BI txqueuelen " NUMBER"
866 change the transmit queue length of the device.
875 .BI address " LLADDRESS"
876 change the station address of the interface.
879 .BI broadcast " LLADDRESS"
883 .BI peer " LLADDRESS"
884 change the link layer broadcast address or the peer address when
890 move the device to the network namespace associated with the process
895 If multiple parameter changes are requested,
897 aborts immediately after any of the changes have failed.
898 This is the only case when
900 can move the system to an unpredictable state. The solution
901 is to avoid changing several parameters with one
905 .SS ip link show - display device attributes
908 .BI dev " NAME " (default)
910 specifies the network device to show.
911 If this argument is omitted all devices are listed.
915 only display running interfaces.
917 .SH ip address - protocol address management.
921 is a protocol (IP or IPv6) address attached
922 to a network device. Each device must have at least one address
923 to use the corresponding protocol. It is possible to have several
924 different addresses attached to one device. These addresses are not
925 discriminated, so that the term
927 is not quite appropriate for them and we do not use it in this document.
931 command displays addresses and their properties, adds new addresses
932 and deletes old ones.
934 .SS ip address add - add new protocol address.
938 the name of the device to add the address to.
941 .BI local " ADDRESS " (default)
942 the address of the interface. The format of the address depends
943 on the protocol. It is a dotted quad for IP and a sequence of
944 hexadecimal halfwords separated by colons for IPv6. The
946 may be followed by a slash and a decimal number which encodes
947 the network prefix length.
951 the address of the remote endpoint for pointopoint interfaces.
954 may be followed by a slash and a decimal number, encoding the network
955 prefix length. If a peer address is specified, the local address
956 cannot have a prefix length. The network prefix is associated
957 with the peer rather than with the local address.
960 .BI broadcast " ADDRESS"
961 the broadcast address on the interface.
963 It is possible to use the special symbols
967 instead of the broadcast address. In this case, the broadcast address
968 is derived by setting/resetting the host bits of the interface prefix.
972 Each address may be tagged with a label string.
973 In order to preserve compatibility with Linux-2.0 net aliases,
974 this string must coincide with the name of the device or must be prefixed
975 with the device name followed by colon.
978 .BI scope " SCOPE_VALUE"
979 the scope of the area where this address is valid.
980 The available scopes are listed in file
981 .BR "/etc/iproute2/rt_scopes" .
982 Predefined scope values are:
986 - the address is globally valid.
989 - (IPv6 only) the address is site local, i.e. it is
990 valid inside this site.
993 - the address is link local, i.e. it is valid only on this device.
996 - the address is valid only inside this host.
999 .SS ip address delete - delete protocol address
1001 coincide with the arguments of
1003 The device name is a required argument. The rest are optional.
1004 If no arguments are given, the first address is deleted.
1006 .SS ip address show - look at protocol addresses
1009 .BI dev " NAME " (default)
1013 .BI scope " SCOPE_VAL"
1014 only list addresses with this scope.
1018 only list addresses matching this prefix.
1021 .BI label " PATTERN"
1022 only list addresses with labels matching the
1025 is a usual shell style pattern.
1028 .BR dynamic " and " permanent
1029 (IPv6 only) only list addresses installed due to stateless
1030 address configuration or only list permanent (not dynamic)
1035 (IPv6 only) only list addresses which have not yet passed duplicate
1040 (IPv6 only) only list deprecated addresses.
1044 (IPv6 only) only list addresses which have failed duplicate
1048 .BR primary " and " secondary
1049 only list primary (or secondary) addresses.
1051 .SS ip address flush - flush protocol addresses
1052 This command flushes the protocol addresses selected by some criteria.
1055 This command has the same arguments as
1057 The difference is that it does not run when no arguments are given.
1061 This command (and other
1063 commands described below) is pretty dangerous. If you make a mistake,
1064 it will not forgive it, but will cruelly purge all the addresses.
1069 option, the command becomes verbose. It prints out the number of deleted
1070 addresses and the number of rounds made to flush the address list. If
1071 this option is given twice,
1073 also dumps all the deleted addresses in the format described in the
1074 previous subsection.
1076 .SH ip addrlabel - protocol address label management.
1078 IPv6 address label is used for address selection
1079 described in RFC 3484. Precedence is managed by userspace,
1080 and only label is stored in kernel.
1082 .SS ip addrlabel add - add an address label
1083 the command adds an address label entry to the kernel.
1085 .BI prefix " PREFIX"
1088 the outgoing interface.
1091 the label for the prefix.
1092 0xffffffff is reserved.
1093 .SS ip addrlabel del - delete an address label
1094 the command deletes an address label entry in the kernel.
1096 coincide with the arguments of
1098 but label is not required.
1099 .SS ip addrlabel list - list address labels
1100 the command show contents of address labels.
1101 .SS ip addrlabel flush - flush address labels
1102 the command flushes the contents of address labels and it does not restore default settings.
1103 .SH ip neighbour - neighbour/arp tables management.
1106 objects establish bindings between protocol addresses and
1107 link layer addresses for hosts sharing the same link.
1108 Neighbour entries are organized into tables. The IPv4 neighbour table
1109 is known by another name - the ARP table.
1112 The corresponding commands display neighbour bindings
1113 and their properties, add new neighbour entries and delete old ones.
1115 .SS ip neighbour add - add a new neighbour entry
1116 .SS ip neighbour change - change an existing entry
1117 .SS ip neighbour replace - add a new entry or change an existing one
1119 These commands create new neighbour records or update existing ones.
1122 .BI to " ADDRESS " (default)
1123 the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
1127 the interface to which this neighbour is attached.
1130 .BI lladdr " LLADDRESS"
1131 the link layer address of the neighbour.
1137 .BI nud " NUD_STATE"
1138 the state of the neighbour entry.
1140 is an abbreviation for 'Neigh bour Unreachability Detection'.
1141 The state can take one of the following values:
1145 - the neighbour entry is valid forever and can be only
1146 be removed administratively.
1150 - the neighbour entry is valid. No attempts to validate
1151 this entry will be made but it can be removed when its lifetime expires.
1155 - the neighbour entry is valid until the reachability
1160 - the neighbour entry is valid but suspicious.
1163 does not change the neighbour state if it was valid and the address
1164 is not changed by this command.
1167 .SS ip neighbour delete - delete a neighbour entry
1168 This command invalidates a neighbour entry.
1171 The arguments are the same as with
1172 .BR "ip neigh add" ,
1181 Attempts to delete or manually change a
1183 entry created by the kernel may result in unpredictable behaviour.
1184 Particularly, the kernel may try to resolve this address even
1187 interface or if the address is multicast or broadcast.
1189 .SS ip neighbour show - list neighbour entries
1191 This commands displays neighbour tables.
1194 .BI to " ADDRESS " (default)
1195 the prefix selecting the neighbours to list.
1199 only list the neighbours attached to this device.
1203 only list neighbours which are not currently in use.
1206 .BI nud " NUD_STATE"
1207 only list neighbour entries in this state.
1209 takes values listed below or the special value
1211 which means all states. This option may occur more than once.
1212 If this option is absent,
1214 lists all entries except for
1219 .SS ip neighbour flush - flush neighbour entries
1220 This command flushes neighbour tables, selecting
1221 entries to flush by some criteria.
1224 This command has the same arguments as
1226 The differences are that it does not run when no arguments are given,
1227 and that the default neighbour states to be flushed do not include
1235 option, the command becomes verbose. It prints out the number of
1236 deleted neighbours and the number of rounds made to flush the
1237 neighbour table. If the option is given
1240 also dumps all the deleted neighbours.
1242 .SH ip route - routing table management
1243 Manipulate route entries in the kernel routing tables keep
1244 information about paths to other networked nodes.
1250 - the route entry describes real paths to the destinations covered
1251 by the route prefix.
1255 - these destinations are unreachable. Packets are discarded and the
1259 The local senders get an
1265 - these destinations are unreachable. Packets are discarded silently.
1266 The local senders get an
1272 - these destinations are unreachable. Packets are discarded and the
1274 .I communication administratively prohibited
1275 is generated. The local senders get an
1281 - the destinations are assigned to this host. The packets are looped
1282 back and delivered locally.
1286 - the destinations are broadcast addresses. The packets are sent as
1291 - a special control route used together with policy rules. If such a
1292 route is selected, lookup in this table is terminated pretending that
1293 no route was found. Without policy routing it is equivalent to the
1294 absence of the route in the routing table. The packets are dropped
1295 and the ICMP message
1297 is generated. The local senders get an
1303 - a special NAT route. Destinations covered by the prefix
1304 are considered to be dummy (or external) addresses which require translation
1305 to real (or internal) ones before forwarding. The addresses to translate to
1306 are selected with the attribute
1308 Route NAT is no longer supported in Linux 2.6.
1314 .RI "- " "not implemented"
1315 the destinations are
1317 addresses assigned to this host. They are mainly equivalent
1320 with one difference: such addresses are invalid when used
1321 as the source address of any packet.
1325 - a special type used for multicast routing. It is not present in
1326 normal routing tables.
1331 Linux-2.x can pack routes into several routing
1332 tables identified by a number in the range from 1 to 255 or by
1334 .B /etc/iproute2/rt_tables
1335 By default all normal routes are inserted into the
1337 table (ID 254) and the kernel only uses this table when calculating routes.
1340 Actually, one other table always exists, which is invisible but
1341 even more important. It is the
1343 table (ID 255). This table
1344 consists of routes for local and broadcast addresses. The kernel maintains
1345 this table automatically and the administrator usually need not modify it
1348 The multiple routing tables enter the game when
1352 .SS ip route add - add new route
1353 .SS ip route change - change route
1354 .SS ip route replace - change or add new one
1357 .BI to " TYPE PREFIX " (default)
1358 the destination prefix of the route. If
1368 is an IP or IPv6 address optionally followed by a slash and the
1369 prefix length. If the length of the prefix is missing,
1371 assumes a full-length host route. There is also a special
1374 - which is equivalent to IP
1383 the Type Of Service (TOS) key. This key has no associated mask and
1384 the longest match is understood as: First, compare the TOS
1385 of the route and of the packet. If they are not equal, then the packet
1386 may still match a route with a zero TOS.
1388 is either an 8 bit hexadecimal number or an identifier
1390 .BR "/etc/iproute2/rt_dsfield" .
1393 .BI metric " NUMBER"
1395 .BI preference " NUMBER"
1396 the preference value of the route.
1398 is an arbitrary 32bit number.
1401 .BI table " TABLEID"
1402 the table to add this route to.
1404 may be a number or a string from the file
1405 .BR "/etc/iproute2/rt_tables" .
1406 If this parameter is omitted,
1410 table, with the exception of
1411 .BR local " , " broadcast " and " nat
1412 routes, which are put into the
1418 the output device name.
1422 the address of the nexthop router. Actually, the sense of this field
1423 depends on the route type. For normal
1425 routes it is either the true next hop router or, if it is a direct
1426 route installed in BSD compatibility mode, it can be a local address
1427 of the interface. For NAT routes it is the first address of the block
1428 of translated IP destinations.
1432 the source address to prefer when sending to the destinations
1433 covered by the route prefix.
1436 .BI realm " REALMID"
1437 the realm to which this route is assigned.
1439 may be a number or a string from the file
1440 .BR "/etc/iproute2/rt_realms" .
1445 .BI "mtu lock" " MTU"
1446 the MTU along the path to the destination. If the modifier
1448 is not used, the MTU may be updated by the kernel due to
1449 Path MTU Discovery. If the modifier
1451 is used, no path MTU discovery will be tried, all packets
1452 will be sent without the DF bit in IPv4 case or fragmented
1456 .BI window " NUMBER"
1457 the maximal window for TCP to advertise to these destinations,
1458 measured in bytes. It limits maximal data bursts that our TCP
1459 peers are allowed to send to us.
1463 the initial RTT ('Round Trip Time') estimate. If no suffix is
1464 specified the units are raw values passed directly to the
1465 routing code to maintain compatability with previous releases.
1466 Otherwise if a suffix of s, sec or secs is used to specify
1467 seconds; ms, msec or msecs to specify milliseconds; us, usec
1468 or usecs to specify microseconds; ns, nsec or nsecs to specify
1469 nanoseconds; j, hz or jiffies to specify jiffies, the value is
1470 converted to what the routing code expects.
1474 .BI rttvar " TIME " "(2.3.15+ only)"
1475 the initial RTT variance estimate. Values are specified as with
1480 .BI rto_min " TIME " "(2.6.23+ only)"
1481 the minimum TCP Retransmission TimeOut to use when communicating with this
1482 destination. Values are specified as with
1487 .BI ssthresh " NUMBER " "(2.3.15+ only)"
1488 an estimate for the initial slow start threshold.
1491 .BI cwnd " NUMBER " "(2.3.15+ only)"
1492 the clamp for congestion window. It is ignored if the
1497 .BI advmss " NUMBER " "(2.3.15+ only)"
1498 the MSS ('Maximal Segment Size') to advertise to these
1499 destinations when establishing TCP connections. If it is not given,
1500 Linux uses a default value calculated from the first hop device MTU.
1501 (If the path to these destination is asymmetric, this guess may be wrong.)
1504 .BI reordering " NUMBER " "(2.3.15+ only)"
1505 Maximal reordering on the path to this destination.
1506 If it is not given, Linux uses the value selected with
1509 .BR "net/ipv4/tcp_reordering" .
1512 .BI nexthop " NEXTHOP"
1513 the nexthop of a multipath route.
1515 is a complex value with its own syntax similar to the top level
1520 - is the nexthop router.
1524 - is the output device.
1527 .BI weight " NUMBER"
1528 - is a weight for this element of a multipath
1529 route reflecting its relative bandwidth or quality.
1533 .BI scope " SCOPE_VAL"
1534 the scope of the destinations covered by the route prefix.
1536 may be a number or a string from the file
1537 .BR "/etc/iproute2/rt_scopes" .
1538 If this parameter is omitted,
1547 .BR unicast " and " broadcast
1549 .BR host " for " local
1553 .BI protocol " RTPROTO"
1554 the routing protocol identifier of this route.
1556 may be a number or a string from the file
1557 .BR "/etc/iproute2/rt_protos" .
1558 If the routing protocol ID is not given,
1559 .B ip assumes protocol
1561 (i.e. it assumes the route was added by someone who doesn't
1562 understand what they are doing). Several protocol values have
1563 a fixed interpretation.
1568 - the route was installed due to an ICMP redirect.
1572 - the route was installed by the kernel during autoconfiguration.
1576 - the route was installed during the bootup sequence.
1577 If a routing daemon starts, it will purge all of them.
1581 - the route was installed by the administrator
1582 to override dynamic routing. Routing daemon will respect them
1583 and, probably, even advertise them to its peers.
1587 - the route was installed by Router Discovery protocol.
1591 The rest of the values are not reserved and the administrator is free
1592 to assign (or not to assign) protocol tags.
1596 pretend that the nexthop is directly attached to this link,
1597 even if it does not match any interface prefix.
1601 allow packet by packet randomization on multipath routes.
1602 Without this modifier, the route will be frozen to one selected
1603 nexthop, so that load splitting will only occur on per-flow base.
1605 only works if the kernel is patched.
1607 .SS ip route delete - delete route
1610 has the same arguments as
1611 .BR "ip route add" ,
1612 but their semantics are a bit different.
1615 .RB "(" to ", " tos ", " preference " and " table ")"
1616 select the route to delete. If optional attributes are present,
1618 verifies that they coincide with the attributes of the route to delete.
1619 If no route with the given key and attributes was found,
1623 .SS ip route show - list routes
1624 the command displays the contents of the routing tables or the route(s)
1625 selected by some criteria.
1628 .BI to " SELECTOR " (default)
1629 only select routes from the given range of destinations.
1631 consists of an optional modifier
1632 .RB "(" root ", " match " or " exact ")"
1635 selects routes with prefixes not shorter than
1639 selects the entire routing table.
1641 selects routes with prefixes not longer than
1644 .BI match " 10.0/16"
1647 .IR 10/8 " and " 0/0 ,
1648 but it does not select
1649 .IR 10.1/16 " and " 10.0.0/24 .
1654 selects routes with this exact prefix. If neither of these options
1659 i.e. it lists the entire table.
1664 only select routes with the given TOS.
1667 .BI table " TABLEID"
1668 show the routes from this table(s). The default setting is to show
1671 may either be the ID of a real table or one of the special values:
1675 - list all of the tables.
1678 - dump the routing cache.
1685 list cloned routes i.e. routes which were dynamically forked from
1686 other routes because some route attribute (f.e. MTU) was updated.
1687 Actually, it is equivalent to
1688 .BR "table cache" "."
1691 .BI from " SELECTOR"
1692 the same syntax as for
1694 but it binds the source address range rather than destinations.
1697 option only works with cloned routes.
1700 .BI protocol " RTPROTO"
1701 only list routes of this protocol.
1704 .BI scope " SCOPE_VAL"
1705 only list routes with this scope.
1709 only list routes of this type.
1713 only list routes going via this device.
1717 only list routes going via the nexthop routers selected by
1722 only list routes with preferred source addresses selected
1727 .BI realm " REALMID"
1729 .BI realms " FROMREALM/TOREALM"
1730 only list routes with these realms.
1732 .SS ip route flush - flush routing tables
1733 this command flushes routes selected by some criteria.
1736 The arguments have the same syntax and semantics as the arguments of
1737 .BR "ip route show" ,
1738 but routing tables are not listed but purged. The only difference is
1741 dumps all the IP main routing table but
1743 prints the helper page.
1748 option, the command becomes verbose. It prints out the number of
1749 deleted routes and the number of rounds made to flush the routing
1750 table. If the option is given
1753 also dumps all the deleted routes in the format described in the
1754 previous subsection.
1756 .SS ip route get - get a single route
1757 this command gets a single route to a destination and prints its
1758 contents exactly as the kernel sees it.
1761 .BI to " ADDRESS " (default)
1762 the destination address.
1772 the Type Of Service.
1776 the device from which this packet is expected to arrive.
1780 force the output device on which this packet will be routed.
1784 if no source address
1785 .RB "(option " from ")"
1786 was given, relookup the route with the source set to the preferred
1787 address received from the first lookup.
1788 If policy routing is used, it may be a different route.
1791 Note that this operation is not equivalent to
1792 .BR "ip route show" .
1794 shows existing routes.
1796 resolves them and creates new clones if necessary. Essentially,
1798 is equivalent to sending a packet along this path.
1801 argument is not given, the kernel creates a route
1802 to output packets towards the requested destination.
1803 This is equivalent to pinging the destination
1805 .BR "ip route ls cache" ,
1806 however, no packets are actually sent. With the
1808 argument, the kernel pretends that a packet arrived from this interface
1809 and searches for a path to forward the packet.
1811 .SH ip rule - routing policy database management
1814 in the routing policy database control the route selection algorithm.
1817 Classic routing algorithms used in the Internet make routing decisions
1818 based only on the destination address of packets (and in theory,
1819 but not in practice, on the TOS field).
1822 In some circumstances we want to route packets differently depending not only
1823 on destination addresses, but also on other packet fields: source address,
1824 IP protocol, transport protocol ports or even packet payload.
1825 This task is called 'policy routing'.
1828 To solve this task, the conventional destination based routing table, ordered
1829 according to the longest match rule, is replaced with a 'routing policy
1830 database' (or RPDB), which selects routes by executing some set of rules.
1833 Each policy routing rule consists of a
1836 .B action predicate.
1837 The RPDB is scanned in the order of increasing priority. The selector
1838 of each rule is applied to {source address, destination address, incoming
1839 interface, tos, fwmark} and, if the selector matches the packet,
1840 the action is performed. The action predicate may return with success.
1841 In this case, it will either give a route or failure indication
1842 and the RPDB lookup is terminated. Otherwise, the RPDB program
1843 continues on the next rule.
1846 Semantically, natural action is to select the nexthop and the output device.
1849 At startup time the kernel configures the default RPDB consisting of three
1854 Priority: 0, Selector: match anything, Action: lookup routing
1860 table is a special routing table containing
1861 high priority control routes for local and broadcast addresses.
1863 Rule 0 is special. It cannot be deleted or overridden.
1867 Priority: 32766, Selector: match anything, Action: lookup routing
1873 table is the normal routing table containing all non-policy
1874 routes. This rule may be deleted and/or overridden with other
1875 ones by the administrator.
1879 Priority: 32767, Selector: match anything, Action: lookup routing
1885 table is empty. It is reserved for some post-processing if no previous
1886 default rules selected the packet.
1887 This rule may also be deleted.
1890 Each RPDB entry has additional
1891 attributes. F.e. each rule has a pointer to some routing
1892 table. NAT and masquerading rules have an attribute to select new IP
1893 address to translate/masquerade. Besides that, rules have some
1894 optional attributes, which routes have, namely
1896 These values do not override those contained in the routing tables. They
1897 are only used if the route did not select any attributes.
1900 The RPDB may contain rules of the following types:
1904 - the rule prescribes to return the route found
1905 in the routing table referenced by the rule.
1908 - the rule prescribes to silently drop the packet.
1911 - the rule prescribes to generate a 'Network is unreachable' error.
1914 - the rule prescribes to generate 'Communication is administratively
1918 - the rule prescribes to translate the source address
1919 of the IP packet into some other value.
1922 .SS ip rule add - insert a new rule
1923 .SS ip rule delete - delete a rule
1926 .BI type " TYPE " (default)
1927 the type of this rule. The list of valid types was given in the previous
1932 select the source prefix to match.
1936 select the destination prefix to match.
1940 select the incoming device to match. If the interface is loopback,
1941 the rule only matches packets originating from this host. This means
1942 that you may create separate routing tables for forwarded and local
1943 packets and, hence, completely segregate them.
1947 select the outgoing device to match. The outgoing interface is only
1948 available for packets originating from local sockets that are bound to
1955 select the TOS value to match.
1964 .BI priority " PREFERENCE"
1965 the priority of this rule. Each rule should have an explicitly
1969 The options preference and order are synonyms with priority.
1972 .BI table " TABLEID"
1973 the routing table identifier to lookup if the rule selector matches.
1974 It is also possible to use lookup instead of table.
1977 .BI realms " FROM/TO"
1978 Realms to select if the rule matched and the routing table lookup
1981 is only used if the route did not select any realm.
1985 The base of the IP address block to translate (for source addresses).
1988 may be either the start of the block of NAT addresses (selected by NAT
1989 routes) or a local host address (or even zero).
1990 In the last case the router does not translate the packets, but
1991 masquerades them to this address.
1992 Using map-to instead of nat means the same thing.
1995 Changes to the RPDB made with these commands do not become active
1996 immediately. It is assumed that after a script finishes a batch of
1997 updates, it flushes the routing cache with
1998 .BR "ip route flush cache" .
2000 .SS ip rule flush - also dumps all the deleted rules.
2001 This command has no arguments.
2003 .SS ip rule show - list rules
2004 This command has no arguments.
2005 The options list or lst are synonyms with show.
2007 .SH ip maddress - multicast addresses management
2010 objects are multicast addresses.
2012 .SS ip maddress show - list multicast addresses
2015 .BI dev " NAME " (default)
2018 .SS ip maddress add - add a multicast address
2019 .SS ip maddress delete - delete a multicast address
2020 these commands attach/detach a static link layer multicast address
2021 to listen on the interface.
2022 Note that it is impossible to join protocol multicast groups
2023 statically. This command only manages link layer addresses.
2026 .BI address " LLADDRESS " (default)
2027 the link layer multicast address.
2031 the device to join/leave this multicast address.
2033 .SH ip mroute - multicast routing cache management
2035 objects are multicast routing cache entries created by a user level
2036 mrouting daemon (f.e.
2042 Due to the limitations of the current interface to the multicast routing
2043 engine, it is impossible to change
2045 objects administratively, so we may only display them. This limitation
2046 will be removed in the future.
2048 .SS ip mroute show - list mroute cache entries
2051 .BI to " PREFIX " (default)
2052 the prefix selecting the destination multicast addresses to list.
2056 the interface on which multicast packets are received.
2060 the prefix selecting the IP source addresses of the multicast route.
2062 .SH ip tunnel - tunnel configuration
2064 objects are tunnels, encapsulating packets in IP packets and then
2065 sending them over the IP infrastructure.
2066 The encapulating (or outer) address family is specified by the
2068 option. The default is IPv4.
2070 .SS ip tunnel add - add a new tunnel
2071 .SS ip tunnel change - change an existing tunnel
2072 .SS ip tunnel delete - destroy a tunnel
2075 .BI name " NAME " (default)
2076 select the tunnel device name.
2080 set the tunnel mode. Available modes depend on the encapsulating address family.
2082 Modes for IPv4 encapsulation available:
2083 .BR ipip ", " sit ", " isatap " and " gre "."
2085 Modes for IPv6 encapsulation available:
2086 .BR ip6ip6 ", " ipip6 " and " any "."
2089 .BI remote " ADDRESS"
2090 set the remote endpoint of the tunnel.
2093 .BI local " ADDRESS"
2094 set the fixed local address for tunneled packets.
2095 It must be an address on another interface of this host.
2101 on tunneled packets.
2103 is a number in the range 1--255. 0 is a special value
2104 meaning that packets inherit the TTL value.
2105 The default value for IPv4 tunnels is:
2107 The default value for IPv6 tunnels is:
2117 set a fixed TOS (or traffic class in IPv6)
2119 on tunneled packets.
2120 The default value is:
2125 bind the tunnel to the device
2127 so that tunneled packets will only be routed via this device and will
2128 not be able to escape to another device when the route to endpoint
2133 disable Path MTU Discovery on this tunnel.
2134 It is enabled by default. Note that a fixed ttl is incompatible
2135 with this option: tunnelling with a fixed ttl always makes pmtu
2144 .RB ( " only GRE tunnels " )
2145 use keyed GRE with key
2147 is either a number or an IP address-like dotted quad.
2150 parameter sets the key to use in both directions.
2152 .BR ikey " and " okey
2153 parameters set different keys for input and output.
2156 .BR csum ", " icsum ", " ocsum
2157 .RB ( " only GRE tunnels " )
2158 generate/require checksums for tunneled packets.
2161 flag calculates checksums for outgoing packets.
2164 flag requires that all input packets have the correct
2167 flag is equivalent to the combination
2171 .BR seq ", " iseq ", " oseq
2172 .RB ( " only GRE tunnels " )
2176 flag enables sequencing of outgoing packets.
2179 flag requires that all input packets are serialized.
2182 flag is equivalent to the combination
2184 .B It isn't work. Don't use it.
2188 .RB ( " only IPv6 tunnels " )
2189 Inherit DS field between inner and outer header.
2192 .BI encaplim " ELIM"
2193 .RB ( " only IPv6 tunnels " )
2194 set a fixed encapsulation limit. Default is 4.
2197 .BI flowlabel " FLOWLABEL"
2198 .RB ( " only IPv6 tunnels " )
2199 set a fixed flowlabel.
2201 .SS ip tunnel prl - potential router list (ISATAP only)
2205 mandatory device name.
2208 .BI prl-default " ADDR"
2210 .BI prl-nodefault " ADDR"
2212 .BI prl-delete " ADDR"
2213 .RB "Add or delete " ADDR
2214 as a potential router or default router.
2216 .SS ip tunnel show - list tunnels
2217 This command has no arguments.
2219 .SH ip monitor and rtmon - state monitoring
2223 utility can monitor the state of devices, addresses
2224 and routes continuously. This option has a slightly different format.
2227 command is the first in the command line and then the object list follows:
2229 .BR "ip monitor" " [ " all " |"
2230 .IR LISTofOBJECTS " ]"
2233 is the list of object types that we want to monitor.
2235 .BR link ", " address " and " route "."
2240 opens RTNETLINK, listens on it and dumps state changes in the format
2241 described in previous sections.
2244 If a file name is given, it does not listen on RTNETLINK,
2245 but opens the file containing RTNETLINK messages saved in binary format
2246 and dumps them. Such a history file can be generated with the
2248 utility. This utility has a command line syntax similar to
2252 should be started before the first network configuration command
2253 is issued. F.e. if you insert:
2256 rtmon file /var/log/rtmon.log
2259 in a startup script, you will be able to view the full history
2263 Certainly, it is possible to start
2266 It prepends the history with the state snapshot dumped at the moment
2269 .SH ip xfrm - setting xfrm
2270 xfrm is an IP framework, which can transform format of the datagrams,
2272 i.e. encrypt the packets with some algorithm. xfrm policy and xfrm state
2273 are associated through templates
2275 This framework is used as a part of IPsec protocol.
2277 .SS ip xfrm state add - add new state into xfrm
2279 .SS ip xfrm state update - update existing xfrm state
2281 .SS ip xfrm state allocspi - allocate SPI value
2285 is set as default to
2287 but it could be set to
2288 .BR tunnel "," ro " or " beet "."
2292 contains one or more flags.
2297 .BR noecn ", " decap-dscp " or " wildrecv "."
2301 encapsulation is set to encapsulation type
2302 .IR ENCAP-TYPE ", source port " SPORT ", destination port " DPORT " and " OADDR "."
2307 .BR espinudp " or " espinudp-nonike "."
2311 contains one or more algorithms
2313 which depend on the type of algorithm set by
2315 It can be used these algoritms
2316 .BR enc ", " auth " or " comp "."
2318 .SS ip xfrm policy add - add a new policy
2320 .SS ip xfrm policy update - update an existing policy
2322 .SS ip xfrm policy delete - delete existing policy
2324 .SS ip xfrm policy get - get existing policy
2326 .SS ip xfrm policy deleteall - delete all existing xfrm policy
2328 .SS ip xfrm policy list - print out the list of xfrm policy
2330 .SS ip xfrm policy flush - flush policies
2333 policies or only those specified with
2338 directory could be one of these:
2339 .BR "inp", " out " or " fwd".
2343 selects for which addresses will be set up the policy. The selector
2344 is defined by source and destination address.
2348 is defined by source port
2358 specify network device.
2362 the number of indexed policy.
2366 type is set as default on
2372 .BI action " ACTION "
2373 is set as default on
2375 It could be switch on
2379 .BI priority " PRIORITY "
2380 priority is a number. Default priority is set on zero.
2384 limits are set in seconds, bytes or numbers of packets.
2388 template list is based on
2390 .BR mode ", " reqid " and " level ". "
2394 is specified by source address, destination address,
2402 .BR esp ", " ah ", " comp ", " route2 " or " hao "."
2406 is set as default on
2408 but it could be set on
2409 .BR tunnel " or " beet "."
2413 is set as default on
2415 and the other choice is
2427 .SS ip xfrm monitor - is used for listing all objects or defined group of them.
2430 can monitor the policies for all objects or defined group of them.
2434 was written by Alexey N. Kuznetsov and added in Linux 2.2.
2438 .RB "IP Command reference " ip-cref.ps
2440 .RB "IP tunnels " ip-cref.ps
2442 .RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>
2445 Original Manpage by Michail Litvak <mci@owl.openwall.com>