xref: /titanic_50/usr/src/cmd/svc/milestone/net-loopback (revision 8883f1c270cc8e33c18dd088e744840092b47bbb)
1#!/sbin/sh
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27. /lib/svc/share/smf_include.sh
28
29#
30# In a shared-IP zone we need this service to be up, but all of the work
31# it tries to do is irrelevant (and will actually lead to the service
32# failing if we try to do it), so just bail out.
33# In the global zone and exclusive-IP zones we proceed.
34#
35smf_configure_ip || exit $SMF_EXIT_OK
36
37#
38# Before any interfaces are configured, we need to set the system
39# default IP forwarding behavior.  This will be the setting for
40# interfaces that don't modify the per-interface setting with the
41# router or -router ifconfig command in their /etc/hostname.<intf>
42# files.  Due to their dependency on this service, the IP forwarding services
43# will run at this point (though routing daemons will not run until later
44# in the boot process) and set forwarding flags.
45#
46
47# IPv4 loopback
48/sbin/ifconfig lo0 plumb 127.0.0.1 up
49
50# IPv6 loopback
51/sbin/ifconfig lo0 inet6 plumb ::1 up
52
53# Trusted Extensions shares the loopback interface with all zones
54if (smf_is_system_labeled); then
55	if smf_is_globalzone; then
56		 /sbin/ifconfig lo0 all-zones
57		 /sbin/ifconfig lo0 inet6 all-zones
58	fi
59fi
60