summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/svc/milestone/net-routing-setup55
-rw-r--r--usr/src/man/man1m/route.1m22
2 files changed, 42 insertions, 35 deletions
diff --git a/usr/src/cmd/svc/milestone/net-routing-setup b/usr/src/cmd/svc/milestone/net-routing-setup
index 6ab1a6c7f0..23644ebd45 100644
--- a/usr/src/cmd/svc/milestone/net-routing-setup
+++ b/usr/src/cmd/svc/milestone/net-routing-setup
@@ -21,6 +21,7 @@
#
#
# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2021 H. William Welliver
# This script configures IP routing.
@@ -28,8 +29,8 @@
#
# In a shared-IP zone we need this service to be up, but all of the work
-# it tries to do is irrelevant (and will actually lead to the service
-# failing if we try to do it), so just bail out.
+# it tries to do is irrelevant (and will actually lead to the service
+# failing if we try to do it), so just bail out.
# In the global zone and exclusive-IP zones we proceed.
#
smf_configure_ip || exit $SMF_EXIT_OK
@@ -80,6 +81,34 @@ fi
#
smf_netstrategy
+#
+# See if static routes were created by install. If so, they were created
+# under /etc/svc/volatile. Copy them into their proper place.
+#
+if [ -f /etc/svc/volatile/etc/inet/static_routes ]; then
+ echo "Installing persistent routes"
+ if [ -f /etc/inet/static_routes ]; then
+ cat /etc/svc/volatile/etc/inet/static_routes | grep -v '^#' \
+ >> /etc/inet/static_routes
+ else
+ cp /etc/svc/volatile/etc/inet/static_routes \
+ /etc/inet/static_routes
+ fi
+ /usr/bin/rm /etc/svc/volatile/etc/inet/static_routes
+
+fi
+
+#
+# Read /etc/inet/static_routes and add each link-local route.
+#
+if [ -f /etc/inet/static_routes ]; then
+ echo "Adding persistent link-local routes:"
+ /usr/bin/egrep -v "^(#|$)" /etc/inet/static_routes \
+ | /usr/bin/grep -E -- "-interface |-iface " | while read line; do
+ /usr/sbin/route add $line
+ done
+fi
+
if [ "$_INIT_NET_STRATEGY" = "dhcp" ] && \
[ -n "`/sbin/dhcpinfo Router`" ]; then
defrouters=`/sbin/dhcpinfo Router`
@@ -184,28 +213,12 @@ else
fi
#
-# See if static routes were created by install. If so, they were created
-# under /etc/svc/volatile. Copy them into their proper place.
-#
-if [ -f /etc/svc/volatile/etc/inet/static_routes ]; then
- echo "Installing persistent routes"
- if [ -f /etc/inet/static_routes ]; then
- cat /etc/svc/volatile/etc/inet/static_routes | grep -v '^#' \
- >> /etc/inet/static_routes
- else
- cp /etc/svc/volatile/etc/inet/static_routes \
- /etc/inet/static_routes
- fi
- /usr/bin/rm /etc/svc/volatile/etc/inet/static_routes
-
-fi
-
-#
-# Read /etc/inet/static_routes and add each route.
+# Read /etc/inet/static_routes and add each non-link-local route.
#
if [ -f /etc/inet/static_routes ]; then
echo "Adding persistent routes:"
- /usr/bin/egrep -v "^(#|$)" /etc/inet/static_routes | while read line; do
+ /usr/bin/egrep -v "^(#|$)" /etc/inet/static_routes \
+ | /usr/bin/grep -v -E -- "-interface |-iface " | while read line; do
/usr/sbin/route add $line
done
fi
diff --git a/usr/src/man/man1m/route.1m b/usr/src/man/man1m/route.1m
index 6cd5a20cd1..adcdba6210 100644
--- a/usr/src/man/man1m/route.1m
+++ b/usr/src/man/man1m/route.1m
@@ -1,5 +1,6 @@
'\" te
-.\" Copyright (C) 2009, Sun Microsystems, Inc. All Rights Reserved
+.\" Copyright (C) 2009, Sun Microsystems, Inc. All Rights Reserved.
+.\" Copyright (C) 2021 H. William Welliver
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
@@ -7,7 +8,6 @@
.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
@@ -40,7 +40,6 @@ route \- manually manipulate the routing tables
.fi
.SH DESCRIPTION
-.LP
\fBroute\fR manually manipulates the network routing tables. These tables are
normally maintained by the system routing daemon, such as \fBin.routed\fR(1M)
and \fBin.ripngd\fR(1M).
@@ -88,10 +87,12 @@ 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.
-Particular care should be taken when using host or network names in persistent
-routes, as network-based name resolution services are not available at the time
-routes are added at startup.
+exists or to delete a route that is not in the routing table is ignored. At
+startup, any directly reachable routes (those specified with the
+\fB-interface\fR or \fB-iface\fR options) will be created first, followed by
+any remaining routes. Particular care should be taken when using host or network
+names in persistent routes, as network-based name resolution services are not
+available at the time routes are added at startup.
.RE
.sp
@@ -127,7 +128,6 @@ Print additional details in verbose mode.
.RE
.SS "Subcommands"
-.LP
The following subcommands are supported:
.sp
.ne 2
@@ -240,11 +240,9 @@ route monitor [ -inet | -inet6 ]
.sp
.SH OPERANDS
-.LP
\fBroute\fR executes its subcommands on routes to destinations by way of
gateways.
.SS "Destinations and Gateways"
-.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(3SOCKET). If this lookup fails in the AF_INET case,
@@ -441,7 +439,6 @@ 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.
.SS "Routing Flags"
-.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
@@ -595,7 +592,6 @@ sensitivity label.
.RE
.SS "Compatibility"
-.LP
The modifiers \fBhost\fR and \fBnet\fR are taken to be equivalent to
\fB-\fR\fBhost\fR and \fB-net\fR\fB\fR. To specify a symbolic address that
matches one of these names, use the \fBdst\fR or \fBgateway\fR keyword to
@@ -648,7 +644,6 @@ List of network names and addresses
.RE
.SH SEE ALSO
-.LP
\fBuname\fR(1), \fBin.ripngd\fR(1M), \fBin.routed\fR(1M), \fBnetstat\fR(1M),
\fBrouted\fR(1M), \fBioctl\fR(2), \fBgetipnodebyname\fR(3SOCKET),
\fBgetnetbyname\fR(3SOCKET), \fBinet_addr\fR(3C), \fBdefaultrouter\fR(4),
@@ -751,7 +746,6 @@ process does not have appropriate privileges.
.RE
.SH NOTES
-.LP
Specifying that destinations are local (with the \fB-interface\fRmodifier)
assumes that the routers implement \fBproxy ARP\fR, meaning that they respond
to ARP queries for all reachable destinations. Normally, using either router