net-routing-setup revision 032ae3d9dc781b45931a4e8b7c4c527ff1419ddc
943N/A# The contents of this file are subject to the terms of the 287N/A# Common Development and Distribution License (the "License"). 287N/A# You may not use this file except in compliance with the License. 919N/A# See the License for the specific language governing permissions 919N/A# and limitations under the License. 919N/A# When distributing Covered Code, include this CDDL HEADER in each 919N/A# If applicable, add the following below this CDDL HEADER, with the 919N/A# fields enclosed by brackets "[]" replaced with your own identifying 919N/A# information: Portions Copyright [yyyy] [name of copyright owner] 919N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved. 919N/A# Use is subject to license terms. 287N/A# ident "%Z%%M% %I% %E% SMI" 287N/A# This script configures IP routing. 911N/A# In a shared-IP zone we need this service to be up, but all of the work 911N/A# it tries to do is irrelevant (and will actually lead to the service 911N/A# failing if we try to do it), so just bail out. 911N/A# In the global zone and exclusive-IP zones we proceed. 287N/A# by previous invokation of routeadm, legacy configuration is upgraded 287N/A# by this call to "routeadm -u". This call is also needed when 287N/A# which need to be applied. Finally, routeadm starts in.ndpd by 970N/A# enabling the ndp service (in.ndpd), which is required for IPv6 address 970N/A# autoconfiguration. It would be nice if we could do this in 970N/A# point in boot, we cannot. 287N/A# Are we routing dynamically? routeadm(1M) reports this in the 493N/A# "current" values of ipv4/6-routing - if either are true, we are running 287N/A# routing daemons (or at least they are enabled to run). # Add a static route for IPv6 multicast packets. # configuration file. The file can contain the hostnames or IP # addresses of one or more default routers. If hostnames are used, # each hostname must also be listed in the local "/etc/hosts" file # because NIS and NIS+ are not running at the time that this script is # run. Each router name or address is listed on a single line by # itself in the file. Anything else on that line after the router's # name or address is ignored. Lines that begin with "#" are # considered comments and ignored. # replace those added by the kernel during diskless booting. An # added by the kernel to be deleted. # Note that the default router file is ignored if we received routes # from a DHCP server. Our policy is to always trust DHCP over local # We want the default router(s) listed in # BOOTPARAMS WHOAMI response but we must avoid flushing # the last route between the running system and its # First, remember the original route. # this, if one of the routes we add is for the route # previously added as a result of the BOOTPARAMS # response, we will see a message of the form: # "add net default: gateway a.b.c.d: entry exists" # Finally, delete the original default route unless it # was also listed in the defaultrouter file. # Use routeadm(1M) to configure forwarding and launch routing daemons # for IPv4 and IPv6 based on preset values. These settings only apply # to the global zone. For IPv4 dynamic routing, the system will default # to disabled if a default route was previously added via BOOTP, DHCP, # No default routes were setup by "route" command above. # Check the kernel routing table for any other default # has run "routeadm -e/-d ipv4-routing". If not, we revert to the # appropriate defaults. We no longer run "routeadm -u" on every boot # however, as persistent daemon state is now controlled by SMF. # Set default value for ipv4-routing to enabled. If routeadm -e/-d # has not yet been run by the administrator, we apply this default. # The -b option is project-private and informs routeadm not # to treat the enable as administrator-driven. # Default router(s) have been found, so ipv4-routing default value # should be disabled. If routaedm -e/d has not yet been run by # the administrator, we apply this default. The -b option is # project-private and informs routeadm not to treat the disable as # Set 6to4 Relay Router communication support policy and, if applicable, # setting and further info on ACCEPT6TO4RELAY and RELAY6TO4ADDR. # If ACCEPT6TO4RELAY=NO, the default value in the kernel will echo "Adding persistent routes:"