net-routing-setup revision ceb97a6a3232437e1f0b4c6b8604bc1b4245ccc5
1378N/A# The contents of this file are subject to the terms of the 1378N/A# Common Development and Distribution License (the "License"). 1378N/A# You may not use this file except in compliance with the License. 1378N/A# See the License for the specific language governing permissions 1378N/A# and limitations under the License. 1378N/A# When distributing Covered Code, include this CDDL HEADER in each 1378N/A# If applicable, add the following below this CDDL HEADER, with the 1378N/A# fields enclosed by brackets "[]" replaced with your own identifying 1378N/A# information: Portions Copyright [yyyy] [name of copyright owner] 3477N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 1378N/A# Use is subject to license terms. 1378N/A# ident "%Z%%M% %I% %E% SMI" 1378N/A# This script configures IP routing. 1378N/A# In a zone we need this service to be up, but all of the work 1586N/A# it tries to do is irrelevant (and will actually lead to the service 1378N/A# failing if we try to do it), so just bail out. 1378N/A# by previous invokation of routeadm, legacy configuration is upgraded 1378N/A# by this call to "routeadm -u". This call is also needed when 1378N/A# which need to be applied. Finally, routeadm starts in.ndpd by 1378N/A# enabling the ndp service (in.ndpd), which is required for IPv6 address 1378N/A# autoconfiguration. It would be nice if we could do this in 1378N/A# Are we routing dynamically? routeadm(1M) reports this in the 1378N/A# "current" values of ipv4/6-routing - if either are true, we are running 1378N/A# routing daemons (or at least they are enabled to run). 1378N/A # Add a static route for multicast packets out of a link-local 1520N/A # interface, although would like to specify multicast interface using 1378N/A print substr($2, 1, index($2, "/") - 1) 1378N/A echo "Setting default IPv6 interface for multicast:" \
1378N/A "add net ff00::/8: gateway $1" # 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. # 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. # 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:"