2N/A# The contents of this file are subject to the terms of the 2N/A# Common Development and Distribution License (the "License"). 2N/A# You may not use this file except in compliance with the License. 2N/A# See the License for the specific language governing permissions 2N/A# and limitations under the License. 2N/A# When distributing Covered Code, include this CDDL HEADER in each 2N/A# If applicable, add the following below this CDDL HEADER, with the 2N/A# fields enclosed by brackets "[]" replaced with your own identifying 2N/A# information: Portions Copyright [yyyy] [name of copyright owner] 2N/A# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T. 2N/A# All rights reserved. 2N/A# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T 2N/A# The copyright notice above does not evidence any 2N/A# actual or intended publication of such source code. 2N/A# This file replaces the Solaris 10 net-physical script in S10C at 2N/A# boot time. Any S10C specific changes to net-physical script needs 2N/A# to be made in this file. 2N/A# In a shared-IP zone we need this service to be up, but all of the work 2N/A# it tries to do is irrelevant (and will actually lead to the service 2N/A# failing if we try to do it), so just bail out. 2N/A# In exclusive-IP zones we proceed. 2N/A# Print warnings to console 2N/A# Cause ifconfig to not automatically start in.mpathd when IPMP groups are 2N/A# configured. This is not strictly necessary but makes it so that in.mpathd 2N/A# sure that /usr is mounted. 2N/A# If the system was net booted by DHCP, hand DHCP management off to the 2N/A# DHCP agent (ifconfig communicates to the DHCP agent through the 2N/A# loopback interface). 2N/A# For IPv4 interfaces that were configured by the kernel and not 2N/A# configured by DHCP, reset the netmask using the local "/etc/netmasks" 2N/A# file if one exists, and then reset the broadcast address based on 2N/A# All the IPv4 and IPv6 interfaces are plumbed before doing any 2N/A# interface configuration. This prevents errors from plumb failures 2N/A# getting mixed in with the configured interface lists that the script 2N/A# Moreover in S10C, we process IPMP interfaces before non-IPMP 2N/A# interfaces to avoid accidental implicit IPMP group creation. 2N/A# Therefore we keep track of IPMP and non-IPMP interfaces in two 2N/A# different lists i.e. ipmp[6]_list vs inet[6]_list. 2N/A# Get the list of IPv4 interfaces to configure by breaking 2N/A if [
"$1" =
"xx0" ];
then 2N/A # For some unknown historical reason the xx0 2N/A # ifname is ignored. 2N/A# Get the list of IPv6 interfaces to configure by breaking 2N/A# Create all of the IPv4 IPMP interfaces. 2N/A# Step through the IPv4 interface list and try to plumb every interface. 2N/A# Generate list of plumbed and failed IPv4 interfaces. 2N/A# Step through the IPv6 interface list and plumb every interface. 2N/A# Generate list of plumbed and failed IPv6 interfaces. Each plumbed 2N/A# interface will be brought up later, after processing any contents of 2N/A# Create all of the IPv6 IPMP interfaces. 2N/A# Process IPMP interfaces before non-IPMP interfaces 2N/A# to avoid accidental implicit IPMP group creation. 2N/A echo "configuring IPv4 IPMP interfaces:\c" 2N/A echo "configuring IPv6 IPMP interfaces:\c" 2N/A# /etc/hostname file is not present or is empty, the ifconfig auto-dhcp 2N/A# / auto-revarp command will attempt to set the address, later. 2N/A# configuration of lo0. 2N/A echo "configuring IPv4 interfaces:\c" 2N/A# processing the hostname6 file, bring the interface up. If 2N/A# configuration of lo0. 2N/A echo "configuring IPv6 interfaces:\c" 2N/A# Run DHCP if requested. Skip boot-configured interface. 2N/A # First find the primary interface. Default to the first 2N/A # interface if not specified. First primary interface found 2N/A # "wins". Use care not to "reconfigure" a net-booted interface 2N/A # configured using DHCP. Run through the list of interfaces 2N/A # again, this time trying DHCP. 2N/A # Exit code 4 means ifconfig timed out waiting for dhcpagent 2N/A echo "starting DHCP on interface $1" 2N/A # Exit code can't be timeout when wait is 0 2N/A# In order to avoid bringing up the interfaces that have 2N/A# intentionally been left down, perform RARP only if the system 2N/A# Process IPv4 and IPv6 interfaces that failed to plumb. Find an 2N/A# alternative interface to host the addresses. 2N/A# stage of booting will have access to NFS. 2N/A '#'* |
'') ;;
# Ignore comments, empty lines 2N/A# We tell smf this service is online if any of the following is true: 2N/A# - no interfaces were configured for plumbing and no DHCP failures 2N/A# - there are any DHCP interfaces started 2N/A# - any non-loopback, non-DHCP IPv4 interfaces are up and have a non-zero 2N/A# - any non-loopback IPv6 interfaces are up 2N/A# If we weren't asked to configure any interfaces, exit 2N/A # Config error if DHCP was attempted without plumbed interfaces 2N/A# Any DHCP interfaces? 2N/A# Any non-loopback, non-DHCP IPv4 interfaces with usable addresses up? 2N/A# Any non-loopback IPv6 interfaces up? 2N/A# This service was supposed to configure something yet didn't. Exit