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 " | " route " | " rule " | " neigh " | " tunnel " | "\
17 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 allmulti " { " on " | " off " } |"
37 .BR dynamic " { " on " | " off " } |"
39 .BR multicast " { " on " | " off " } |"
60 .BR "ip addr" " { " add " | " del " } "
61 .IB IFADDR " dev " STRING
64 .BR "ip addr" " { " show " | " flush " } [ " dev
69 .IR PREFIX " ] [ " FLAG-LIST " ] [ "
74 .IR IFADDR " := " PREFIX " | " ADDR
88 .RB "[ " host " | " link " | " global " | "
92 .IR FLAG-LIST " := [ " FLAG-LIST " ] " FLAG
96 .RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
97 tentative " | " deprecated " ]"
101 .BR list " | " flush " } "
107 .BI from " ADDRESS " iif " STRING"
114 .BR "ip route" " { " add " | " del " | " change " | " append " | "\
115 replace " | " monitor " } "
136 .IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]"
139 .IR NODE_SPEC " := [ " TYPE " ] " PREFIX " ["
152 .IR INFO_SPEC " := " "NH OPTIONS FLAGS" " ["
163 .IR NUMBER " ] " NHFLAGS
166 .IR OPTIONS " := " FLAGS " [ "
186 .BR unicast " | " local " | " broadcast " | " multicast " | "\
187 throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]"
190 .IR TABLE_ID " := [ "
191 .BR local "| " main " | " default " | " all " |"
196 .BR host " | " link " | " global " |"
205 .BR onlink " | " pervasive " ]"
209 .BR kernel " | " boot " | " static " |"
214 .RB " [ " list " | " add " | " del " | " flush " ]"
218 .IR SELECTOR " := [ "
238 .BR prohibit " | " reject " | " unreachable " ] [ " realms
239 .RI "[" SRCREALM "/]" DSTREALM " ]"
242 .IR TABLE_ID " := [ "
243 .BR local " | " main " | " default " |"
247 .BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
251 .BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
257 .BR "ip neigh" " { " show " | " flush " } [ " to
265 .BR "ip tunnel" " { " add " | " change " | " del " | " show " }"
268 .RB "[ " mode " { " ipip " | " gre " | " sit " } ]"
275 .RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
277 .RB "[" i "|" o "]" csum " ] ]"
283 .RB "[" no "]" pmtudisc " ]"
289 .IR ADDR " := { " IP_ADDRESS " |"
293 .IR TOS " := { " NUMBER " |"
297 .IR TTL " := { " 1 ".." 255 " | "
301 .IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"
304 .BR "ip maddr" " [ " add " | " del " ]"
305 .IB MULTIADDR " dev " STRING
308 .BR "ip maddr show" " [ " dev
312 .BR "ip mroute show" " ["
320 .BR "ip monitor" " [ " all " |"
321 .IR LISTofOBJECTS " ]"
328 .BR "\-V" , " -Version"
329 print the version of the
334 .BR "\-s" , " \-stats", " \-statistics"
335 output more information. If the option
336 appears twice or more, the amount of information increases.
337 As a rule, the information is statistics or some time values.
340 .BR "\-f" , " \-family"
341 followed by protocol family identifier:
342 .BR "inet" , " inet6"
345 ,enforce the protocol family to use. If the option is not present,
346 the protocol family is guessed from other arguments. If the rest
347 of the command line does not give enough information to guess the
350 falls back to the default one, usually
355 is a special family identifier meaning that no networking protocol
366 .BR "\-family inet6" .
371 .BR "\-family link" .
374 .BR "\-o" , " \-oneline"
375 output each record on a single line, replacing line feeds
378 character. This is convenient when you want to count records
386 .BR "\-r" , " \-resolve"
387 use the system's name resolver to print DNS names instead of
390 .SH IP - COMMAND SYNTAX
401 - protocol (IP or IPv6) address on a device.
404 - ARP or NDISC cache entry.
408 - routing table entry.
412 - rule in routing policy database.
420 - multicast routing cache entry.
427 The names of all objects may be written in full or
428 abbreviated form, f.e.
438 Specifies the action to perform on the object.
439 The set of possible actions depends on the object type.
440 As a rule, it is possible to
441 .BR "add" , " delete"
446 ) objects, but some objects do not allow all of these operations
447 or have some additional commands. The
449 command is available for all objects. It prints
450 out a list of available commands and argument syntax conventions.
452 If no command is given, some default command is assumed.
455 or, if the objects of this class cannot be listed,
458 .SH ip link - network device configuration
461 is a network device and the corresponding commands
462 display and change the state of devices.
464 .SS ip link set - change device attributes
467 .BI dev " NAME " (default)
469 specifies network device to operate on.
473 change the state of the device to
479 .BR "arp on " or " arp off"
485 .BR "multicast on " or " multicast off"
491 .BR "dynamic on " or " dynamic off"
498 change the name of the device. This operation is not
499 recommended if the device is running or has some addresses
503 .BI txqueuelen " NUMBER"
506 change the transmit queue length of the device.
515 .BI address " LLADDRESS"
516 change the station address of the interface.
519 .BI broadcast " LLADDRESS"
523 .BI peer " LLADDRESS"
524 change the link layer broadcast address or the peer address when
530 If multiple parameter changes are requested,
532 aborts immediately after any of the changes have failed.
533 This is the only case when
535 can move the system to an unpredictable state. The solution
536 is to avoid changing several parameters with one
540 .SS ip link show - display device attributes
543 .BI dev " NAME " (default)
545 specifies the network device to show.
546 If this argument is omitted all devices are listed.
550 only display running interfaces.
552 .SH ip address - protocol address management.
556 is a protocol (IP or IPv6) address attached
557 to a network device. Each device must have at least one address
558 to use the corresponding protocol. It is possible to have several
559 different addresses attached to one device. These addresses are not
560 discriminated, so that the term
562 is not quite appropriate for them and we do not use it in this document.
566 command displays addresses and their properties, adds new addresses
567 and deletes old ones.
569 .SS ip address add - add new protocol address.
573 the name of the device to add the address to.
576 .BI local " ADDRESS " (default)
577 the address of the interface. The format of the address depends
578 on the protocol. It is a dotted quad for IP and a sequence of
579 hexadecimal halfwords separated by colons for IPv6. The
581 may be followed by a slash and a decimal number which encodes
582 the network prefix length.
586 the address of the remote endpoint for pointopoint interfaces.
589 may be followed by a slash and a decimal number, encoding the network
590 prefix length. If a peer address is specified, the local address
591 cannot have a prefix length. The network prefix is associated
592 with the peer rather than with the local address.
595 .BI broadcast " ADDRESS"
596 the broadcast address on the interface.
598 It is possible to use the special symbols
602 instead of the broadcast address. In this case, the broadcast address
603 is derived by setting/resetting the host bits of the interface prefix.
607 Each address may be tagged with a label string.
608 In order to preserve compatibility with Linux-2.0 net aliases,
609 this string must coincide with the name of the device or must be prefixed
610 with the device name followed by colon.
613 .BI scope " SCOPE_VALUE"
614 the scope of the area where this address is valid.
615 The available scopes are listed in file
616 .BR "/etc/iproute2/rt_scopes" .
617 Predefined scope values are:
621 - the address is globally valid.
624 - (IPv6 only) the address is site local, i.e. it is
625 valid inside this site.
628 - the address is link local, i.e. it is valid only on this device.
631 - the address is valid only inside this host.
634 .SS ip address delete - delete protocol address
636 coincide with the arguments of
638 The device name is a required argument. The rest are optional.
639 If no arguments are given, the first address is deleted.
641 .SS ip address show - look at protocol addresses
644 .BI dev " NAME " (default)
648 .BI scope " SCOPE_VAL"
649 only list addresses with this scope.
653 only list addresses matching this prefix.
657 only list addresses with labels matching the
660 is a usual shell style pattern.
663 .BR dynamic " and " permanent
664 (IPv6 only) only list addresses installed due to stateless
665 address configuration or only list permanent (not dynamic)
670 (IPv6 only) only list addresses which did not pass duplicate
675 (IPv6 only) only list deprecated addresses.
678 .BR primary " and " secondary
679 only list primary (or secondary) addresses.
681 .SS ip address flush - flush protocol addresses
682 This command flushes the protocol addresses selected by some criteria.
685 This command has the same arguments as
687 The difference is that it does not run when no arguments are given.
691 This command (and other
693 commands described below) is pretty dangerous. If you make a mistake,
694 it will not forgive it, but will cruelly purge all the addresses.
699 option, the command becomes verbose. It prints out the number of deleted
700 addresses and the number of rounds made to flush the address list. If
701 this option is given twice,
703 also dumps all the deleted addresses in the format described in the
706 .SH ip neighbour - neighbour/arp tables management.
709 objects establish bindings between protocol addresses and
710 link layer addresses for hosts sharing the same link.
711 Neighbour entries are organized into tables. The IPv4 neighbour table
712 is known by another name - the ARP table.
715 The corresponding commands display neighbour bindings
716 and their properties, add new neighbour entries and delete old ones.
718 .SS ip neighbour add - add a new neighbour entry
719 .SS ip neighbour change - change an existing entry
720 .SS ip neighbour replace - add a new entry or change an existing one
722 These commands create new neighbour records or update existing ones.
725 .BI to " ADDRESS " (default)
726 the protocol address of the neighbour. It is either an IPv4 or IPv6 address.
730 the interface to which this neighbour is attached.
733 .BI lladdr " LLADDRESS"
734 the link layer address of the neighbour.
741 the state of the neighbour entry.
743 is an abbreviation for 'Neigh bour Unreachability Detection'.
744 The state can take one of the following values:
748 - the neighbour entry is valid forever and can be only
749 be removed administratively.
753 - the neighbour entry is valid. No attempts to validate
754 this entry will be made but it can be removed when its lifetime expires.
758 - the neighbour entry is valid until the reachability
763 - the neighbour entry is valid but suspicious.
766 does not change the neighbour state if it was valid and the address
767 is not changed by this command.
770 .SS ip neighbour delete - delete a neighbour entry
771 This command invalidates a neighbour entry.
774 The arguments are the same as with
784 Attempts to delete or manually change a
786 entry created by the kernel may result in unpredictable behaviour.
787 Particularly, the kernel may try to resolve this address even
790 interface or if the address is multicast or broadcast.
792 .SS ip neighbour show - list neighbour entries
794 This commands displays neighbour tables.
797 .BI to " ADDRESS " (default)
798 the prefix selecting the neighbours to list.
802 only list the neighbours attached to this device.
806 only list neighbours which are not currently in use.
810 only list neighbour entries in this state.
812 takes values listed below or the special value
814 which means all states. This option may occur more than once.
815 If this option is absent,
817 lists all entries except for
822 .SS ip neighbour flush - flush neighbour entries
823 This command flushes neighbour tables, selecting
824 entries to flush by some criteria.
827 This command has the same arguments as
829 The differences are that it does not run when no arguments are given,
830 and that the default neighbour states to be flushed do not include
838 option, the command becomes verbose. It prints out the number of
839 deleted neighbours and the number of rounds made to flush the
840 neighbour table. If the option is given
843 also dumps all the deleted neighbours.
845 .SH ip route - routing table management
846 Manipulate route entries in the kernel routing tables keep
847 information about paths to other networked nodes.
853 - the route entry describes real paths to the destinations covered
858 - these destinations are unreachable. Packets are discarded and the
862 The local senders get an
868 - these destinations are unreachable. Packets are discarded silently.
869 The local senders get an
875 - these destinations are unreachable. Packets are discarded and the
877 .I communication administratively prohibited
878 is generated. The local senders get an
884 - the destinations are assigned to this host. The packets are looped
885 back and delivered locally.
889 - the destinations are broadcast addresses. The packets are sent as
894 - a special control route used together with policy rules. If such a
895 route is selected, lookup in this table is terminated pretending that
896 no route was found. Without policy routing it is equivalent to the
897 absence of the route in the routing table. The packets are dropped
900 is generated. The local senders get an
906 - a special NAT route. Destinations covered by the prefix
907 are considered to be dummy (or external) addresses which require translation
908 to real (or internal) ones before forwarding. The addresses to translate to
909 are selected with the attribute
911 Route NAT is no longer supported in Linux 2.6.
917 .RI "- " "not implemented"
920 addresses assigned to this host. They are mainly equivalent
923 with one difference: such addresses are invalid when used
924 as the source address of any packet.
928 - a special type used for multicast routing. It is not present in
929 normal routing tables.
934 Linux-2.x can pack routes into several routing
935 tables identified by a number in the range from 1 to 255 or by
937 .B /etc/iproute2/rt_tables
938 . By default all normal routes are inserted into the
940 table (ID 254) and the kernel only uses this table when calculating routes.
943 Actually, one other table always exists, which is invisible but
944 even more important. It is the
946 table (ID 255). This table
947 consists of routes for local and broadcast addresses. The kernel maintains
948 this table automatically and the administrator usually need not modify it
951 The multiple routing tables enter the game when
955 .SS ip route add - add new route
956 .SS ip route change - change route
957 .SS ip route replace - change or add new one
960 .BI to " TYPE PREFIX " (default)
961 the destination prefix of the route. If
971 is an IP or IPv6 address optionally followed by a slash and the
972 prefix length. If the length of the prefix is missing,
974 assumes a full-length host route. There is also a special
977 - which is equivalent to IP
986 the Type Of Service (TOS) key. This key has no associated mask and
987 the longest match is understood as: First, compare the TOS
988 of the route and of the packet. If they are not equal, then the packet
989 may still match a route with a zero TOS.
991 is either an 8 bit hexadecimal number or an identifier
993 .BR "/etc/iproute2/rt_dsfield" .
998 .BI preference " NUMBER"
999 the preference value of the route.
1001 is an arbitrary 32bit number.
1004 .BI table " TABLEID"
1005 the table to add this route to.
1007 may be a number or a string from the file
1008 .BR "/etc/iproute2/rt_tables" .
1009 If this parameter is omitted,
1013 table, with the exception of
1014 .BR local " , " broadcast " and " nat
1015 routes, which are put into the
1021 the output device name.
1025 the address of the nexthop router. Actually, the sense of this field
1026 depends on the route type. For normal
1028 routes it is either the true next hop router or, if it is a direct
1029 route installed in BSD compatibility mode, it can be a local address
1030 of the interface. For NAT routes it is the first address of the block
1031 of translated IP destinations.
1035 the source address to prefer when sending to the destinations
1036 covered by the route prefix.
1039 .BI realm " REALMID"
1040 the realm to which this route is assigned.
1042 may be a number or a string from the file
1043 .BR "/etc/iproute2/rt_realms" .
1048 .BI "mtu lock" " MTU"
1049 the MTU along the path to the destination. If the modifier
1051 is not used, the MTU may be updated by the kernel due to
1052 Path MTU Discovery. If the modifier
1054 is used, no path MTU discovery will be tried, all packets
1055 will be sent without the DF bit in IPv4 case or fragmented
1059 .BI window " NUMBER"
1060 the maximal window for TCP to advertise to these destinations,
1061 measured in bytes. It limits maximal data bursts that our TCP
1062 peers are allowed to send to us.
1066 the initial RTT ('Round Trip Time') estimate.
1069 .BI rttvar " NUMBER " "(2.3.15+ only)"
1070 the initial RTT variance estimate.
1073 .BI ssthresh " NUMBER " "(2.3.15+ only)"
1074 an estimate for the initial slow start threshold.
1077 .BI cwnd " NUMBER " "(2.3.15+ only)"
1078 the clamp for congestion window. It is ignored if the
1083 .BI advmss " NUMBER " "(2.3.15+ only)"
1084 the MSS ('Maximal Segment Size') to advertise to these
1085 destinations when establishing TCP connections. If it is not given,
1086 Linux uses a default value calculated from the first hop device MTU.
1087 (If the path to these destination is asymmetric, this guess may be wrong.)
1090 .BI reordering " NUMBER " "(2.3.15+ only)"
1091 Maximal reordering on the path to this destination.
1092 If it is not given, Linux uses the value selected with
1095 .BR "net/ipv4/tcp_reordering" .
1098 .BI nexthop " NEXTHOP"
1099 the nexthop of a multipath route.
1101 is a complex value with its own syntax similar to the top level
1106 - is the nexthop router.
1110 - is the output device.
1113 .BI weight " NUMBER"
1114 - is a weight for this element of a multipath
1115 route reflecting its relative bandwidth or quality.
1119 .BI scope " SCOPE_VAL"
1120 the scope of the destinations covered by the route prefix.
1122 may be a number or a string from the file
1123 .BR "/etc/iproute2/rt_scopes" .
1124 If this parameter is omitted,
1133 .BR unicast " and " broadcast
1135 .BR host " for " local
1139 .BI protocol " RTPROTO"
1140 the routing protocol identifier of this route.
1142 may be a number or a string from the file
1143 .BR "/etc/iproute2/rt_protos" .
1144 If the routing protocol ID is not given,
1145 .B ip assumes protocol
1147 (i.e. it assumes the route was added by someone who doesn't
1148 understand what they are doing). Several protocol values have
1149 a fixed interpretation.
1154 - the route was installed due to an ICMP redirect.
1158 - the route was installed by the kernel during autoconfiguration.
1162 - the route was installed during the bootup sequence.
1163 If a routing daemon starts, it will purge all of them.
1167 - the route was installed by the administrator
1168 to override dynamic routing. Routing daemon will respect them
1169 and, probably, even advertise them to its peers.
1173 - the route was installed by Router Discovery protocol.
1177 The rest of the values are not reserved and the administrator is free
1178 to assign (or not to assign) protocol tags.
1182 pretend that the nexthop is directly attached to this link,
1183 even if it does not match any interface prefix.
1187 allow packet by packet randomization on multipath routes.
1188 Without this modifier, the route will be frozen to one selected
1189 nexthop, so that load splitting will only occur on per-flow base.
1191 only works if the kernel is patched.
1193 .SS ip route delete - delete route
1196 has the same arguments as
1197 .BR "ip route add" ,
1198 but their semantics are a bit different.
1201 .RB "(" to ", " tos ", " preference " and " table ")"
1202 select the route to delete. If optional attributes are present,
1204 verifies that they coincide with the attributes of the route to delete.
1205 If no route with the given key and attributes was found,
1209 .SS ip route show - list routes
1210 the command displays the contents of the routing tables or the route(s)
1211 selected by some criteria.
1214 .BI to " SELECTOR " (default)
1215 only select routes from the given range of destinations.
1217 consists of an optional modifier
1218 .RB "(" root ", " match " or " exact ")"
1221 selects routes with prefixes not shorter than
1225 selects the entire routing table.
1227 selects routes with prefixes not longer than
1230 .BI match " 10.0/16"
1233 .IR 10/8 " and " 0/0 ,
1234 but it does not select
1235 .IR 10.1/16 " and " 10.0.0/24 .
1240 selects routes with this exact prefix. If neither of these options
1245 i.e. it lists the entire table.
1250 only select routes with the given TOS.
1253 .BI table " TABLEID"
1254 show the routes from this table(s). The default setting is to show
1257 may either be the ID of a real table or one of the special values:
1261 - list all of the tables.
1264 - dump the routing cache.
1271 list cloned routes i.e. routes which were dynamically forked from
1272 other routes because some route attribute (f.e. MTU) was updated.
1273 Actually, it is equivalent to
1274 .BR "table cache" "."
1277 .BI from " SELECTOR"
1278 the same syntax as for
1280 but it binds the source address range rather than destinations.
1283 option only works with cloned routes.
1286 .BI protocol " RTPROTO"
1287 only list routes of this protocol.
1290 .BI scope " SCOPE_VAL"
1291 only list routes with this scope.
1295 only list routes of this type.
1299 only list routes going via this device.
1303 only list routes going via the nexthop routers selected by
1308 only list routes with preferred source addresses selected
1313 .BI realm " REALMID"
1315 .BI realms " FROMREALM/TOREALM"
1316 only list routes with these realms.
1318 .SS ip route flush - flush routing tables
1319 this command flushes routes selected by some criteria.
1322 The arguments have the same syntax and semantics as the arguments of
1323 .BR "ip route show" ,
1324 but routing tables are not listed but purged. The only difference is
1327 dumps all the IP main routing table but
1329 prints the helper page.
1334 option, the command becomes verbose. It prints out the number of
1335 deleted routes and the number of rounds made to flush the routing
1336 table. If the option is given
1339 also dumps all the deleted routes in the format described in the
1340 previous subsection.
1342 .SS ip route get - get a single route
1343 this command gets a single route to a destination and prints its
1344 contents exactly as the kernel sees it.
1347 .BI to " ADDRESS " (default)
1348 the destination address.
1358 the Type Of Service.
1362 the device from which this packet is expected to arrive.
1366 force the output device on which this packet will be routed.
1370 if no source address
1371 .RB "(option " from ")"
1372 was given, relookup the route with the source set to the preferred
1373 address received from the first lookup.
1374 If policy routing is used, it may be a different route.
1377 Note that this operation is not equivalent to
1378 .BR "ip route show" .
1380 shows existing routes.
1382 resolves them and creates new clones if necessary. Essentially,
1384 is equivalent to sending a packet along this path.
1387 argument is not given, the kernel creates a route
1388 to output packets towards the requested destination.
1389 This is equivalent to pinging the destination
1391 .BR "ip route ls cache" ,
1392 however, no packets are actually sent. With the
1394 argument, the kernel pretends that a packet arrived from this interface
1395 and searches for a path to forward the packet.
1397 .SH ip rule - routing policy database management
1400 in the routing policy database control the route selection algorithm.
1403 Classic routing algorithms used in the Internet make routing decisions
1404 based only on the destination address of packets (and in theory,
1405 but not in practice, on the TOS field).
1408 In some circumstances we want to route packets differently depending not only
1409 on destination addresses, but also on other packet fields: source address,
1410 IP protocol, transport protocol ports or even packet payload.
1411 This task is called 'policy routing'.
1414 To solve this task, the conventional destination based routing table, ordered
1415 according to the longest match rule, is replaced with a 'routing policy
1416 database' (or RPDB), which selects routes by executing some set of rules.
1419 Each policy routing rule consists of a
1422 .B action predicate.
1423 The RPDB is scanned in the order of increasing priority. The selector
1424 of each rule is applied to {source address, destination address, incoming
1425 interface, tos, fwmark} and, if the selector matches the packet,
1426 the action is performed. The action predicate may return with success.
1427 In this case, it will either give a route or failure indication
1428 and the RPDB lookup is terminated. Otherwise, the RPDB program
1429 continues on the next rule.
1432 Semantically, natural action is to select the nexthop and the output device.
1435 At startup time the kernel configures the default RPDB consisting of three
1440 Priority: 0, Selector: match anything, Action: lookup routing
1446 table is a special routing table containing
1447 high priority control routes for local and broadcast addresses.
1449 Rule 0 is special. It cannot be deleted or overridden.
1453 Priority: 32766, Selector: match anything, Action: lookup routing
1459 table is the normal routing table containing all non-policy
1460 routes. This rule may be deleted and/or overridden with other
1461 ones by the administrator.
1465 Priority: 32767, Selector: match anything, Action: lookup routing
1471 table is empty. It is reserved for some post-processing if no previous
1472 default rules selected the packet.
1473 This rule may also be deleted.
1476 Each RPDB entry has additional
1477 attributes. F.e. each rule has a pointer to some routing
1478 table. NAT and masquerading rules have an attribute to select new IP
1479 address to translate/masquerade. Besides that, rules have some
1480 optional attributes, which routes have, namely
1482 These values do not override those contained in the routing tables. They
1483 are only used if the route did not select any attributes.
1486 The RPDB may contain rules of the following types:
1490 - the rule prescribes to return the route found
1491 in the routing table referenced by the rule.
1494 - the rule prescribes to silently drop the packet.
1497 - the rule prescribes to generate a 'Network is unreachable' error.
1500 - the rule prescribes to generate 'Communication is administratively
1504 - the rule prescribes to translate the source address
1505 of the IP packet into some other value.
1508 .SS ip rule add - insert a new rule
1509 .SS ip rule delete - delete a rule
1512 .BI type " TYPE " (default)
1513 the type of this rule. The list of valid types was given in the previous
1518 select the source prefix to match.
1522 select the destination prefix to match.
1526 select the incoming device to match. If the interface is loopback,
1527 the rule only matches packets originating from this host. This means
1528 that you may create separate routing tables for forwarded and local
1529 packets and, hence, completely segregate them.
1535 select the TOS value to match.
1544 .BI priority " PREFERENCE"
1545 the priority of this rule. Each rule should have an explicitly
1551 .BI table " TABLEID"
1552 the routing table identifier to lookup if the rule selector matches.
1555 .BI realms " FROM/TO"
1556 Realms to select if the rule matched and the routing table lookup
1559 is only used if the route did not select any realm.
1563 The base of the IP address block to translate (for source addresses).
1566 may be either the start of the block of NAT addresses (selected by NAT
1567 routes) or a local host address (or even zero).
1568 In the last case the router does not translate the packets, but
1569 masquerades them to this address.
1572 Changes to the RPDB made with these commands do not become active
1573 immediately. It is assumed that after a script finishes a batch of
1574 updates, it flushes the routing cache with
1575 .BR "ip route flush cache" .
1577 .SS ip rule flush - also dumps all the deleted rules.
1578 This command has no arguments.
1580 .SS ip rule show - list rules
1581 This command has no arguments.
1583 .SH ip maddress - multicast addresses management
1586 objects are multicast addresses.
1588 .SS ip maddress show - list multicast addresses
1591 .BI dev " NAME " (default)
1594 .SS ip maddress add - add a multicast address
1595 .SS ip maddress delete - delete a multicast address
1596 these commands attach/detach a static link layer multicast address
1597 to listen on the interface.
1598 Note that it is impossible to join protocol multicast groups
1599 statically. This command only manages link layer addresses.
1602 .BI address " LLADDRESS " (default)
1603 the link layer multicast address.
1607 the device to join/leave this multicast address.
1609 .SH ip mroute - multicast routing cache management
1611 objects are multicast routing cache entries created by a user level
1612 mrouting daemon (f.e.
1618 Due to the limitations of the current interface to the multicast routing
1619 engine, it is impossible to change
1621 objects administratively, so we may only display them. This limitation
1622 will be removed in the future.
1624 .SS ip mroute show - list mroute cache entries
1627 .BI to " PREFIX " (default)
1628 the prefix selecting the destination multicast addresses to list.
1632 the interface on which multicast packets are received.
1636 the prefix selecting the IP source addresses of the multicast route.
1638 .SH ip tunnel - tunnel configuration
1640 objects are tunnels, encapsulating packets in IPv4 packets and then
1641 sending them over the IP infrastructure.
1643 .SS ip tunnel add - add a new tunnel
1644 .SS ip tunnel change - change an existing tunnel
1645 .SS ip tunnel delete - destroy a tunnel
1648 .BI name " NAME " (default)
1649 select the tunnel device name.
1653 set the tunnel mode. Three modes are currently available:
1654 .BR ipip ", " sit " and " gre "."
1657 .BI remote " ADDRESS"
1658 set the remote endpoint of the tunnel.
1661 .BI local " ADDRESS"
1662 set the fixed local address for tunneled packets.
1663 It must be an address on another interface of this host.
1669 on tunneled packets.
1671 is a number in the range 1--255. 0 is a special value
1672 meaning that packets inherit the TTL value.
1673 The default value is:
1682 on tunneled packets.
1683 The default value is:
1688 bind the tunnel to the device
1690 so that tunneled packets will only be routed via this device and will
1691 not be able to escape to another device when the route to endpoint
1696 disable Path MTU Discovery on this tunnel.
1697 It is enabled by default. Note that a fixed ttl is incompatible
1698 with this option: tunnelling with a fixed ttl always makes pmtu
1707 .RB ( " only GRE tunnels " )
1708 use keyed GRE with key
1710 is either a number or an IP address-like dotted quad.
1713 parameter sets the key to use in both directions.
1715 .BR ikey " and " okey
1716 parameters set different keys for input and output.
1719 .BR csum ", " icsum ", " ocsum
1720 .RB ( " only GRE tunnels " )
1721 generate/require checksums for tunneled packets.
1724 flag calculates checksums for outgoing packets.
1727 flag requires that all input packets have the correct
1730 flag is equivalent to the combination
1734 .BR seq ", " iseq ", " oseq
1735 .RB ( " only GRE tunnels " )
1739 flag enables sequencing of outgoing packets.
1742 flag requires that all input packets are serialized.
1745 flag is equivalent to the combination
1747 .B It isn't work. Don't use it.
1749 .SS ip tunnel show - list tunnels
1750 This command has no arguments.
1752 .SH ip monitor and rtmon - state monitoring
1756 utility can monitor the state of devices, addresses
1757 and routes continuously. This option has a slightly different format.
1760 command is the first in the command line and then the object list follows:
1762 .BR "ip monitor" " [ " all " |"
1763 .IR LISTofOBJECTS " ]"
1766 is the list of object types that we want to monitor.
1768 .BR link ", " address " and " route "."
1773 opens RTNETLINK, listens on it and dumps state changes in the format
1774 described in previous sections.
1777 If a file name is given, it does not listen on RTNETLINK,
1778 but opens the file containing RTNETLINK messages saved in binary format
1779 and dumps them. Such a history file can be generated with the
1781 utility. This utility has a command line syntax similar to
1785 should be started before the first network configuration command
1786 is issued. F.e. if you insert:
1789 rtmon file /var/log/rtmon.log
1792 in a startup script, you will be able to view the full history
1796 Certainly, it is possible to start
1799 It prepends the history with the state snapshot dumped at the moment
1804 was written by Alexey N. Kuznetsov and added in Linux 2.2.
1808 .RB "IP Command reference " ip-cref.ps
1810 .RB "IP tunnels " ip-cref.ps
1813 Original Manpage by Michail Litvak <mci@owl.openwall.com>