Hallo, dies ist ein Test.
PWD: /www/data-lst1/unixsoft/unixsoft/kaempfer/.public_html
Running in File Mode
Relative path: ./../../../../.././../usr/man/man8/route.8
Real path: /usr/share/man/man8/route.8
Zurück
'\" te .\" Copyright (c) 2009, 2023, Oracle and/or its affiliates. .TH route 8 "1 Jun 2023" "Oracle Solaris 11.4" "System Administration Commands" .SH NAME route \- manually manipulate the routing tables .SH SYNOPSIS .LP .nf \fBroute\fR [\fB-fnvq\fR] \fIsub-command\fR [ [\fImodifiers\fR] \fIargs\fR] .fi .LP .nf \fBroute\fR [\fB-fnvq\fR] [-p [-R \fIroot-dir\fR]] \fBadd\fR [modifiers] \fIdestination gateway\fR [-name \fIroute-name\fR] [args] .fi .LP .nf \fBroute\fR [\fB-fnvq\fR] [-p [-R \fIroot-dir\fR]] \fBdelete\fR [modifiers] {\fIdestination gateway\fR | -name \fIroute-name\fR} [args] .fi .LP .nf \fBroute\fR [\fB-fnvq\fR] \fBchange\fR | \fBget\fR [modifiers] {destination | -name \fIroute-name\fR} [gateway [args]] .fi .LP .nf \fBroute\fR [\fB-fn\fR] \fBmonitor\fR [\fImodifiers\fR] .fi .LP .nf \fBroute\fR [\fB-fnvq\fR] \fBflush\fR [\fImodifiers\fR] .fi .LP .nf \fBroute\fR \fB-p\fR [\fB-R\fR \fIroot-dir\fR] \fBshow\fR .fi .SH DESCRIPTION .sp .LP \fBroute\fR manually manipulates the network routing tables. These tables are normally maintained by the system routing daemon, such as \fBin.routed\fR(8) and \fBin.ripngd\fR(8). .sp .LP \fBroute\fR supports a limited number of general options, but a rich command language. Users can specify an arbitrary request that can be delivered by means of the programmatic interface discussed in \fBroute\fR(4P). .sp .LP \fBroute\fR uses a routing socket and the message types \fBRTM_ADD\fR, \fBRTM_DELETE\fR, \fBRTM_GET\fR, and \fBRTM_CHANGE\fR. While the {\fBPRIV_SYS_IP_CONFIG\fR} privilege is required to modify routing tables, the \fBRTM_GET\fR operation is allowed for non-privileged users. The \fBNetwork Management\fR rights profile allows running \fBroute\fR with the {\fBPRIV_SYS_IP_CONFIG\fR} privilege. .sp .LP Persistent static route configuration can also be specified at install time through the System Configuration profiles. For more information on System Configuration profiles, see the \fBip-interface-management\fR(5) manual page. .SH OPTIONS .sp .ne 2 .mk .na \fB\fB-f\fR\fR .ad .RS 15n .rt Flush the routing tables of all gateway entries. If you use the \fB-f\fR option in conjunction with any of the \fBroute\fR sub-commands, \fBroute\fR flushes the gateways before performing the sub-command. Specify the table to flush by placing the \fBinet\fR or \fBinet6\fR modifier immediately after the \fB-f\fR option. If unspecified, flushing IPv4 (\fBinet\fR) routes is the default. .RE .sp .ne 2 .mk .na \fB\fB-n\fR\fR .ad .RS 15n .rt Prevent attempts to print host and network names symbolically when reporting actions. This option is useful when name servers are unavailable. .RE .sp .ne 2 .mk .na \fB\fB-p\fR\fR .ad .RS 15n .rt Make changes to the network route tables persistent across system restarts. The operation is applied to the network routing tables first and, if successful, is then applied to the list of saved routes used at system startup. In determining whether an operation was successful, a failure to add a route that already exists or to delete a route that is not in the routing table is ignored. To update an existing persistent route, the persistent route must be deleted and then re-added. Particular care should be taken when using host. .RE .sp .ne 2 .mk .na \fB\fB-q\fR\fR .ad .RS 15n .rt Suppress all output. .RE .sp .ne 2 .mk .na \fB\fB-R\fR \fIroot-dir\fR\fR .ad .RS 15n .rt Specify an alternate root directory where \fBroute\fR applies changes. This option is ignored unless used in conjunction with the \fB-p\fR option. When \fB-R\fR is specified, route changes are applied only to the list of saved routes to be used at startup, \fBnot\fR to the network routing tables. In addition, certain checks, such as the existence of network interfaces used with \fB-ifp\fR, are skipped. .RE .sp .ne 2 .mk .na \fB\fB-v\fR\fR .ad .RS 15n .rt Print additional details in verbose mode. .RE .SS "Subcommands" .sp .LP The following subcommands are supported: .sp .ne 2 .mk .na \fB\fBadd\fR\fR .ad .RS 11n .rt Add a route. .RE .sp .ne 2 .mk .na \fB\fBchange\fR\fR .ad .RS 11n .rt Change aspects of a route (such as its gateway). .RE .sp .ne 2 .mk .na \fB\fBdelete\fR\fR .ad .RS 11n .rt Delete a specific route. .RE .sp .ne 2 .mk .na \fB\fBflush\fR\fR .ad .RS 11n .rt Remove all gateway entries from the routing table. .RE .sp .ne 2 .mk .na \fB\fBget\fR\fR .ad .RS 11n .rt Look up and display the route for a destination. .RE .sp .ne 2 .mk .na \fB\fBmonitor\fR\fR .ad .RS 11n .rt Continuously report any changes to the routing information base, routing lookup misses, or suspected network partitionings. .RE .sp .ne 2 .mk .na \fB\fBshow\fR\fR .ad .RS 11n .rt Display the list of routes to be applied at system startup. Can be used only in conjunction with the \fB-p\fR option. .RE .sp .LP The \fBadd\fR and \fBdelete\fR sub-commands have the following syntax: .sp .in +2 .nf route [ -fnvq ] cmd \fIdestination\fR \fIgateway\fR [metric/netmask] .fi .in -2 .sp .sp .LP where \fIcmd\fR is \fBadd\fR or \fBdelete\fR, \fIdestination\fR is the destination host or network, and \fIgateway\fR is the next-hop intermediary through which packets should be routed. Modifiers described in \fBOPERANDS\fR can be placed anywhere on the command line. .sp .LP The \fBget\fR and \fBchange\fR sub-commands have the following syntax: .sp .in +2 .nf route [ -fnvq ] \fIcmd\fR \fIdestination\fR [\fIgateway\fR [metric/netmask]] .fi .in -2 .sp .sp .LP where \fIcmd\fR is \fBget\fR or \fBchange\fR, \fIdestination\fR is the destination host or network, and \fIgateway\fR is the next-hop intermediary through which packets should be routed. Modifiers described in \fBOPERANDS\fR can be placed anywhere on the command line. .sp .LP The \fBmonitor\fR sub-command has the following syntax: .sp .in +2 .nf route monitor [ -inet | -inet6 ] .fi .in -2 .sp .SH OPERANDS .sp .LP \fBroute\fR executes its sub-commands on routes to destinations by way of gateways. A name can also be specified for the route with the \fB-name\fR modifier, when the route is created persistently. The name is ignored for non-persistent routes. Subsequent operations on the route can use this name with the \fB-name\fR modifier instead of the destination and gateway. Note that the default route is not named "default". It can be named anything (other than "default") when it is created, and that name can be used to refer to that default route. .SS "Destinations and Gateways" .sp .LP By default, destination and gateway addresses are interpreted as IPv4 addresses. All symbolic names are tried first as a host name, using \fBgetipnodebyname\fR(3C). If this lookup fails in the AF_INET case, \fBgetnetbyname\fR(3C) interprets the name as that of a network. .sp .LP Including an optional modifier on the command line before the address changes how the \fBroute\fR sub-command interprets it. .sp .LP The following modifiers are supported: .sp .ne 2 .mk .na \fB\fB-inet\fR\fR .ad .RS 10n .rt Force the address to be interpreted as an IPv4 address, that is, under the \fBAF_INET\fR address family. .RE .sp .ne 2 .mk .na \fB\fB-inet6\fR\fR .ad .RS 10n .rt Force the address to be interpreted as an IPv6 address, that is, under the \fBAF_INET6\fR address family. .RE .sp .LP For IPv4 addresses, routes to a particular host are by default distinguished from those to a network by interpreting the Internet address specified as the destination. If the destination has a \fBlocal address part\fR (that is, the portion not covered by the \fBnetmask\fR) of \fB0\fR, or if the destination is resolved as the symbolic name of a network, then the route is assumed to be to a network; otherwise, it is presumed to be a route to a host. .sp .LP You can force this selection by using one of the following modifiers: .sp .ne 2 .mk .na \fB\fB-host\fR\fR .ad .RS 9n .rt Force the destination to be interpreted as a host. .RE .sp .ne 2 .mk .na \fB\fB-net\fR\fR .ad .RS 9n .rt Force the destination to be interpreted as a network. .RE .sp .LP For example: .sp .TS tab( ); lw(2.75i) lw(2.75i) lw(2.75i) lw(2.75i) . Destination Destination Equivalent _ \fB128.32\fR \fB-host\fR \fB128.0.0.32\fR \fB128.32.130\fR \fB-host\fR \fB128.32.0.130\fR \fB-net\fR \fB128.32\fR \fB128.32.0.0\fR \fB-net\fR \fB128.32.130\fR \fB128.32.130.0\fR .TE .sp .sp .LP Two modifiers avoid confusion between addresses and keywords (for example, \fBhost\fR used as a symbolic host name). You can distinguish a destination by preceding it with the \fB-dst\fR modifier. You can distinguish a gateway address by using the \fB-gateway\fR modifier. If the destination is directly reachable by way of an interface requiring no intermediary IP router to act as a gateway, this can be indicated by using the \fB-interface\fR or \fB-iface\fR modifier. .sp .LP In the following example, the route does not refer to an external gateway (router), but rather to one of the machine's interfaces. Packets with IP destination addresses matching the destination and mask on such a route are sent out on the interface identified by the gateway address. For interfaces using the ARP protocol, this type of route is used to specify that all matching destinations are local to the physical link. That is, a host could be configured to ARP for all addresses, without regard to the configured interface \fBnetmask\fR, by adding a default route using this command. For example: .sp .in +2 .nf example# route add default \fIhostname\fR -interface .fi .in -2 .sp .sp .LP where gateway address \fIhostname\fR is the name or IP address associated with the network interface over which all matching packets should be sent. On a host with a single network interface, \fIhostname\fR is usually the same as the \fInodename\fR returned by the \fBuname -n\fR command. See \fBuname\fR(1). .sp .LP For backward compatibility with older systems, directly reachable routes can also be specified by placing a \fB0\fR after the gateway address: .sp .in +2 .nf example# route add default \fIhostname\fR 0 .fi .in -2 .sp .sp .LP This value was once a route metric, but this metric is no longer used. If the value is specified as \fB0\fR, then the destination is directly reachable (equivalent to specifying \fB-\fR\fBinterface\fR). If it is non-zero but cannot be interpreted as a subnet mask, then a gateway is used (default). .sp .LP With the \fBAF_INET\fR address family or an IPv4 address, a separate subnet mask can be specified. This can be specified in one of the following ways: .RS +4 .TP .ie t \(bu .el o IP address following the gateway address . This is typically specified in \fIdecimal dot\fR notation as for \fBinet_addr\fR(3C) rather than in symbolic form. .RE .RS +4 .TP .ie t \(bu .el o IP address following the \fBnetmask\fR qualifier. .RE .RS +4 .TP .ie t \(bu .el o Slash character and a decimal length appended to the destination address. .RE .sp .LP If a subnet mask is not specified, the mask used is the subnet mask of the output interface selected by the gateway address, if the classful network of the destination is the same as the classful network of the interface. Otherwise, the classful network mask for the destination address is used. .sp .LP Each of the following examples creates an IPv4 route to the destination \fB192.0.2.32\fR subnet with a subnet mask of \fB255.255.255.224\fR: .sp .in +2 .nf example# route add 192.0.2.32/27 somegateway example# route add 192.0.2.32 -netmask 255.255.255.224 somegateway example# route add 192.0.2.32 somegateway 255.255.255.224 .fi .in -2 .sp .sp .LP For IPv6, only the slash format is accepted. The following example creates an IPv6 route to the destination \fB33fe::\fR with a netmask of \fB16\fR one-bits followed by 112 zero-bits. .sp .in +2 .nf example# route add -inet6 3ffe::/16 somegateway .fi .in -2 .sp .sp .LP In cases where the gateway does not uniquely identify the output interface (for example, when several interfaces have the same address), you can use the \fB-ifp\fR \fIifname\fR modifier to specify the interface by name. For example, \fB-ifp\fR \fBlo0\fR associates the route with the \fBlo0\fR interface. If the named interface is an underlying interface in an IPMP (IP multipathing) group, then requests to add a route will automatically be translated to the corresponding IPMP IP interface, and requests to delete or change a route on an underlying interface will fail. Note that if the interface associated with a route through the \fB-ifp\fR modifier is removed (unplumbed) from the kernel, then that route will be removed from the routing table. If the interface is subsequently added back (plumbed) into the kernel, then the user will have to re-add the route to the routing tables unless the route exists in the persistent routing configuration. .sp .LP When the routing table contains several equal routes, that is, routes for the same destination and mask, then IP attempts to spread the traffic over those routes. The spreading is such that an individual transport connection uses the same route to avoid packet reordering as seen by, for example, TCP. The details of the spreading algorithm is not documented and is likely to evolve over time. .SS "Routing Flags" .sp .LP Routes have associated flags that influence operation of the protocols when sending to destinations matched by the routes. These flags can be set (and in some cases cleared, indicated by \fB~\fR) by including the following modifiers on the command line: .sp .TS tab( ); lw(1.32i) cw(1.24i) cw(2.94i) lw(1.32i) lw(1.24i) lw(2.94i) . Modifier Flag Description _ \fB-interface\fR \fB~RTF_GATEWAY\fR Destination is directly reachable \fB-iface\fR \fB~RTF_GATEWAY\fR Alias for interface modifier \fB-static\fR \fBRTF_STATIC\fR Manually added route \fB-nostatic\fR \fB~RTF_STATIC\fR T{ Pretend route was added by kernel or routing daemon T} \fB-reject\fR \fBRTF_REJECT\fR Emit an ICMP unreachable when matched \fB-blackhole\fR \fBRTF_BLACKHOLE\fR Silently discard packets \fB-proto1\fR \fBRTF_PROTO1\fR Set protocol specific routing flag #1 \fB-proto2\fR \fBRTF_PROTO2\fR Set protocol specific routing flag #2 \fB-private\fR \fBRTF_PRIVATE\fR Do not advertise this route \fB-multirt\fR \fBRTF_MULTIRT\fR Creates the specified redundant route \fB-setsrc\fR \fBRTF_SETSRC\fR Assigns the default source address \fB-indirect\fR \fBRTF_INDIRECT\fR T{ Allows adding routes where gateway is not on-link T} .TE .sp .sp .LP Note that source address selection through the \fB-setsrc\fR option takes precedence over \fBipadm\fR(8) \fBusesrc\fR-based source address selection. In other words, source address selection is done for routes before it is done for interfaces, as the former is more fine-grained. .sp .LP The optional \fB-indirect\fR modifier allows adding routes where the gateway is not directly reachable. When an indirect route is the best match for a packet to be sent or forwarded, then IP proceeds to look up that gateway to find a route that is directly reachable. The \fB-indirect\fR modifier can be used even if the gateway is directly reachable. .sp .LP The optional modifiers \fB-rtt\fR, \fB-rttvar\fR, \fB-sendpipe\fR, \fB-recvpipe\fR, \fB-mtu\fR, \fB-hopcount\fR, \fB-expire\fR, and \fB-ssthresh\fR provide initial values to quantities maintained in the routing entry by transport level protocols, such as \fBTCP\fR. These can be individually locked either by preceding each modifier to be locked by the \fB-lock\fR meta-modifier, or by specifying that all ensuing metrics can be locked by the \fB-lockrest\fR meta-modifier. .sp .LP Some transport layer protocols can support only some of these metrics. The following optional modifiers are supported: .sp .ne 2 .mk .na \fB\fB-expire\fR\fR .ad .RS 13n .rt Lifetime for the entry. This optional modifier is not currently supported. .RE .sp .ne 2 .mk .na \fB\fB-hopcount\fR\fR .ad .RS 13n .rt Maximum hop count. This optional modifier is not currently supported. .RE .sp .ne 2 .mk .na \fB\fB-mtu\fR\fR .ad .RS 13n .rt Maximum MTU in bytes. .RE .sp .ne 2 .mk .na \fB\fB-recvpipe\fR\fR .ad .RS 13n .rt Receive pipe size in bytes. .RE .sp .ne 2 .mk .na \fB\fB-rtt\fR\fR .ad .RS 13n .rt Round trip time in microseconds. .RE .sp .ne 2 .mk .na \fB\fB-rttvar\fR\fR .ad .RS 13n .rt Round trip time variance in microseconds. .RE .sp .ne 2 .mk .na \fB\fB-sendpipe\fR\fR .ad .RS 13n .rt Send pipe size in bytes. .RE .sp .ne 2 .mk .na \fB\fB-ssthresh\fR\fR .ad .RS 13n .rt Send pipe size threshold in bytes. .RE .sp .ne 2 .mk .na \fB\fB-secattr\fR\fR .ad .RS 13n .rt Security attributes of the route. This modifier is available only if the system is configured with the Oracle Solaris Trusted Extensions feature. .sp The \fB-secattr\fR modifier has the following format: .sp .sp .in +2 .nf min_sl=\fIval\fR,max_sl=\fIval\fR,doi=\fIval\fR,cipso .fi .in -2 .sp or: .sp .sp .in +2 .nf sl=VAL,doi=VAL,cipso .fi .in -2 .sp In the first form, above, the \fIval\fR for \fBmin_sl\fR and \fBmax_sl\fR is a sensitivity label in either hex or string form. The \fIval\fR for \fBdoi\fR is a non-negative integer. The route will apply only for packets with the same domain of interpretation as defined by the \fBdoi\fR value and within the accreditation range defined by the \fBmin_sl\fR and \fBmax_sl\fR values. The \fBcipso\fR keyword is optional and set by default. Valid \fBmin_sl\fR, \fBmax_sl\fR and \fBdoi\fR keyword/value pairs are mandatory. Note that if \fIval\fR contains a space, it must be protected by double quotes. .sp The second form, above, is equivalent to specifying the first form with the same \fBVAL\fR for \fBmin_sl\fR and \fBmax_sl\fR. The second form should be used for the \fBget\fR command, because \fBget\fR uses only a single sensitivity label. .RE .SS "Compatibility" .sp .LP The modifiers \fBhost\fR and \fBnet\fR are taken to be equivalent to \fB-\fR\fBhost\fR and \fB-net\fR. To specify a symbolic address that matches one of these names, use the \fBdst\fR or \fBgateway\fR keyword to distinguish it. For example: \fB-dst\fR \fBhost\fR .sp .LP The following two flags are also accepted for compatibility with older systems, but have no effect. .sp .TS tab( ); lw(2.84i) cw(2.66i) lw(2.84i) lw(2.66i) . Modifier Flag _ \fB-cloning\fR RTF_CLONING \fB-xresolve\fR RTF_XRESOLVE .TE .sp .sp .LP The \fB-ifa\fR \fBhostname\fR modifier is also accepted, but has no effect. .SH EXAMPLES .sp .LP The following example illustrates how to set the systems default route. .sp .in +2 .nf # \fBroute -p add default hostname\fR .fi .in -2 .sp .SH ATTRIBUTES .sp .LP See \fBattributes\fR(7) for descriptions of the following attributes: .sp .TS tab( ) box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . ATTRIBUTE TYPE ATTRIBUTE VALUE _ Availability system/network .TE .sp .SH SEE ALSO .sp .LP \fBuname\fR(1), \fBioctl\fR(2), \fBgetipnodebyname\fR(3C), \fBgetnetbyname\fR(3C), \fBinet_addr\fR(3C), \fBarp\fR(4P), \fBip\fR(4P), \fBroute\fR(4P), \fBrouting\fR(4P), \fBdefaultrouter\fR(5), \fBip-interface-management\fR(5), \fBhosts\fR(5), \fBnetworks\fR(5), \fBattributes\fR(7), \fBprivileges\fR(7), \fBin.ripngd\fR(8), \fBin.routed\fR(8), \fBnetstat\fR(8), \fBrouted\fR(8) .SH DIAGNOSTICS .sp .ne 2 .mk .na \fB\fBadd\fR [ \fBhost\fR\||\ \fBnetwork\|]\fR \fIdestination\fR:\fIgateway\fR \fIflags\fR\fR .ad .br .sp .6 .RS 4n The specified route is being added to the tables. The values printed are from the routing table entry supplied in the \fBioctl\fR(2) call. If the gateway address used was not the primary address of the gateway (the first one returned by \fBgetipnodebyname\fR(3C)) the gateway address is printed numerically as well as symbolically. .RE .sp .ne 2 .mk .na \fB\fBdelete\fR [ \fBhost\fR\||\ \fBnetwork\fR\|] \fIdestination\fR:\fIgateway\fR \fIflags\fR\fR .ad .br .na \fB\fBchange\fR [ \fBhost\fR\||\ \fBnetwork\fR\|] \fIdestination\fR:\fIgateway\fR \fIflags\fR\fR .ad .br .sp .6 .RS 4n As \fBadd\fR, but when deleting or changing an entry. .RE .sp .ne 2 .mk .na \fB\fIdestination\fR \fBdone\fR\fR .ad .br .sp .6 .RS 4n When the \fB-f\fR flag is specified, or the \fBflush\fR sub-command is used, each routing table entry deleted is indicated with a message of this form. .RE .sp .ne 2 .mk .na \fB\fBNetwork is unreachable\fR\fR .ad .br .sp .6 .RS 4n An attempt to add a route failed because the gateway listed was not on a directly-connected network. Give the next-hop gateway instead. .RE .sp .ne 2 .mk .na \fB\fBnot in table\fR\fR .ad .br .sp .6 .RS 4n A \fBdelete\fR operation was attempted for an entry that is not in the table. .RE .sp .ne 2 .mk .na \fB\fBentry exists\fR\fR .ad .br .sp .6 .RS 4n An \fBadd\fR operation was attempted for a route that already exists in the kernel. .RE .sp .ne 2 .mk .na \fB\fBrouting table overflow\fR\fR .ad .br .sp .6 .RS 4n An operation was attempted, but the system was unable to allocate memory to create the new entry. .RE .sp .ne 2 .mk .na \fB\fBinsufficient privileges\fR\fR .ad .br .sp .6 .RS 4n An attempt to add, delete, change, or flush a route failed because the calling process does not have appropriate privileges. .RE .SH NOTES .sp .LP Specifying that destinations are local (with the \fB-interface\fR modifier) assumes that the routers implement \fBproxy ARP\fR, meaning that they respond to ARP queries for all reachable destinations. Normally, using either router discovery or RIP is more reliable and scalable than using proxy ARP. See \fBin.routed\fR(8) man page for information related to RIP. .sp .LP Combining the all destinations are local route with subnet or network routes can lead to unpredictable results. The search order as it relates to the all destinations are local route are undefined and can vary from release to release.