xref: /onnv-gate/usr/src/cmd/svc/milestone/net-init (revision 10616:3be00c4a6835)
10Sstevel@tonic-gate#!/sbin/sh
20Sstevel@tonic-gate#
30Sstevel@tonic-gate# CDDL HEADER START
40Sstevel@tonic-gate#
50Sstevel@tonic-gate# The contents of this file are subject to the terms of the
61573Sdp# Common Development and Distribution License (the "License").
71573Sdp# You may not use this file except in compliance with the License.
80Sstevel@tonic-gate#
90Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate# See the License for the specific language governing permissions
120Sstevel@tonic-gate# and limitations under the License.
130Sstevel@tonic-gate#
140Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate#
200Sstevel@tonic-gate# CDDL HEADER END
210Sstevel@tonic-gate#
220Sstevel@tonic-gate#
238485SPeter.Memishian@Sun.COM# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate# Use is subject to license terms.
250Sstevel@tonic-gate#
260Sstevel@tonic-gate# This is the second phase of TCP/IP configuration.  The first part is
273048Samaguire# run by the svc:/network/physical service and includes configuring the
283048Samaguire# interfaces and setting the machine's hostname.  The svc:/network/initial
293048Samaguire# service does all configuration that can be done before name services are
303048Samaguire# started, bar configuring IP routing (this is carried out by the
313048Samaguire# svc:/network/routing-setup service).  The final part, run by the
323048Samaguire# svc:/network/service service,  does all configuration that may require
333048Samaguire# name services.  This includes a final re-configuration of the
343048Samaguire# interfaces.
350Sstevel@tonic-gate#
360Sstevel@tonic-gate
370Sstevel@tonic-gate. /lib/svc/share/smf_include.sh
380Sstevel@tonic-gate
393048Samaguire#
403448Sdh155122# In a shared-IP zone we need this service to be up, but all of the work
413448Sdh155122# it tries to do is irrelevant (and will actually lead to the service
423448Sdh155122# failing if we try to do it), so just bail out.
433448Sdh155122# In the global zone and exclusive-IP zones we proceed.
443048Samaguire#
453448Sdh155122smf_configure_ip || exit $SMF_EXIT_OK
460Sstevel@tonic-gate
470Sstevel@tonic-gate# Configure IPv6 Default Address Selection.
480Sstevel@tonic-gateif [ -f /etc/inet/ipaddrsel.conf ]; then
490Sstevel@tonic-gate	/usr/sbin/ipaddrsel -f /etc/inet/ipaddrsel.conf
500Sstevel@tonic-gatefi
510Sstevel@tonic-gate
520Sstevel@tonic-gate#
538485SPeter.Memishian@Sun.COM# If explicit IPMP groups are being used, in.mpathd will already be started.
548485SPeter.Memishian@Sun.COM# However, if TRACK_INTERFACES_ONLY_WITH_GROUPS=no and no explicit IPMP
558485SPeter.Memishian@Sun.COM# groups have been configured, then it still needs to be started.  So, fire
568485SPeter.Memishian@Sun.COM# it up in "adopt" mode; if there are no interfaces it needs to manage, it
578485SPeter.Memishian@Sun.COM# will automatically exit.
580Sstevel@tonic-gate#
593448Sdh155122/usr/bin/pgrep -x -u 0 -z `smf_zonename` in.mpathd >/dev/null 2>&1 || \
603448Sdh155122    /usr/lib/inet/in.mpathd -a
610Sstevel@tonic-gate
620Sstevel@tonic-gate#
630Sstevel@tonic-gate# Set the RFC 1948 entropy, regardless of if I'm using it or not.  If present,
640Sstevel@tonic-gate# use the encrypted root password as a source of entropy.  Otherwise,
650Sstevel@tonic-gate# just use the pre-set (and hopefully difficult to guess) entropy that
660Sstevel@tonic-gate# tcp used when it loaded.
670Sstevel@tonic-gate#
680Sstevel@tonic-gateencr=`/usr/bin/awk -F: '/^root:/ {print $2}' /etc/shadow`
690Sstevel@tonic-gate[ -z "$encr" ] || /usr/sbin/ndd -set /dev/tcp tcp_1948_phrase $encr
700Sstevel@tonic-gateunset encr
710Sstevel@tonic-gate
724190Ssangeeta# Set the SDP system Policy.  This needs to happen after basic
734190Ssangeeta# networking is up but before any networking services that might
744190Ssangeeta# want to use SDP are enabled
754190Ssangeetaif [ -f /usr/sbin/sdpadm -a -f /etc/sdp.conf ]; then
764190Ssangeeta	. /etc/sdp.conf
774190Ssangeeta	if [ "$sysenable" = "1" ]; then
784190Ssangeeta		/usr/sbin/sdpadm enable
794190Ssangeeta	fi
804190Ssangeetafi
814190Ssangeeta
820Sstevel@tonic-gate#
830Sstevel@tonic-gate# Set TCP ISS generation.  By default the ISS generation is
840Sstevel@tonic-gate# time + random()-delta.  This might not be strong enough for some users.
850Sstevel@tonic-gate# See /etc/default/inetinit for settings and further info on TCP_STRONG_ISS.
860Sstevel@tonic-gate# If not set, use TCP's internal default setting.
870Sstevel@tonic-gate#
88*10616SSebastien.Roy@Sun.COM[ -f /etc/default/inetinit ] && . /etc/default/inetinit
890Sstevel@tonic-gateif [ $TCP_STRONG_ISS ]; then
900Sstevel@tonic-gate	/usr/sbin/ndd -set /dev/tcp tcp_strong_iss $TCP_STRONG_ISS
910Sstevel@tonic-gatefi
920Sstevel@tonic-gate
930Sstevel@tonic-gate# Clear exit status.
941573Sdpexit $SMF_EXIT_OK
95