xref: /illumos-gate/usr/src/cmd/svc/milestone/net-loopback (revision fdb7141f0274bca1975db87dfb070b4e3c89b6f5)
17c478bd9Sstevel@tonic-gate#!/sbin/sh
27c478bd9Sstevel@tonic-gate#
37c478bd9Sstevel@tonic-gate# CDDL HEADER START
47c478bd9Sstevel@tonic-gate#
57c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
66927f468Sdp# Common Development and Distribution License (the "License").
76927f468Sdp# You may not use this file except in compliance with the License.
87c478bd9Sstevel@tonic-gate#
97c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate# and limitations under the License.
137c478bd9Sstevel@tonic-gate#
147c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate#
207c478bd9Sstevel@tonic-gate# CDDL HEADER END
217c478bd9Sstevel@tonic-gate#
227c478bd9Sstevel@tonic-gate#
23*fdb7141fSgfaden# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate# Use is subject to license terms.
257c478bd9Sstevel@tonic-gate#
267c478bd9Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gate. /lib/svc/share/smf_include.sh
297c478bd9Sstevel@tonic-gate
307c478bd9Sstevel@tonic-gate#
31f4b3ec61Sdh155122# In a shared-IP zone we need this service to be up, but all of the work
327c478bd9Sstevel@tonic-gate# it tries to do is irrelevant (and will actually lead to the service
337c478bd9Sstevel@tonic-gate# failing if we try to do it), so just bail out.
34f4b3ec61Sdh155122# In the global zone and exclusive-IP zones we proceed.
357c478bd9Sstevel@tonic-gate#
36f4b3ec61Sdh155122smf_configure_ip || exit $SMF_EXIT_OK
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gate#
397c478bd9Sstevel@tonic-gate# Cause ifconfig to not automatically start in.mpathd when IPMP groups are
407c478bd9Sstevel@tonic-gate# configured.  This is not strictly necessary but makes it so that in.mpathd
417c478bd9Sstevel@tonic-gate# will always be started explicitly from /lib/svc/method/net-init (the
427c478bd9Sstevel@tonic-gate# svc:/network/initial service), when we're sure that /usr is mounted.
437c478bd9Sstevel@tonic-gate#
447c478bd9Sstevel@tonic-gateSUNW_NO_MPATHD=; export SUNW_NO_MPATHD
457c478bd9Sstevel@tonic-gate
467c478bd9Sstevel@tonic-gate#
477c478bd9Sstevel@tonic-gate# Before any interfaces are configured, we need to set the system
487c478bd9Sstevel@tonic-gate# default IP forwarding behavior.  This will be the setting for
497c478bd9Sstevel@tonic-gate# interfaces that don't modify the per-interface setting with the
507c478bd9Sstevel@tonic-gate# router or -router ifconfig command in their /etc/hostname.<intf>
51a192e900Samaguire# files.  Due to their dependency on this service, the IP forwarding services
52a192e900Samaguire# will run at this point (though routing daemons will not run until later
53a192e900Samaguire# in the boot process) and set forwarding flags.
547c478bd9Sstevel@tonic-gate#
557c478bd9Sstevel@tonic-gate
56d71dbb73Sjbeck# IPv4 loopback
577c478bd9Sstevel@tonic-gate/sbin/ifconfig lo0 plumb 127.0.0.1 up
587c478bd9Sstevel@tonic-gate
59d71dbb73Sjbeck# IPv6 loopback
607c478bd9Sstevel@tonic-gate/sbin/ifconfig lo0 inet6 plumb ::1 up
61*fdb7141fSgfaden
62*fdb7141fSgfaden# Trusted Extensions shares the loopback interface with all zones
63*fdb7141fSgfadenif (smf_is_system_labeled); then
64*fdb7141fSgfaden	if smf_is_globalzone; then
65*fdb7141fSgfaden		 /sbin/ifconfig lo0 all-zones
66*fdb7141fSgfaden		 /sbin/ifconfig lo0 inet6 all-zones
67*fdb7141fSgfaden	fi
68*fdb7141fSgfadenfi
69