head	1.39;
access;
symbols
	RELENG_8_4:1.39.0.2
	RELENG_8_3_0_RELEASE:1.38.2.4.2.1
	RELENG_8_3:1.38.2.4.0.2
	RELENG_8_3_BP:1.38.2.4
	RELENG_7_4_0_RELEASE:1.37.24.1
	RELENG_8_2_0_RELEASE:1.38.2.2.2.1
	RELENG_7_4:1.37.0.24
	RELENG_7_4_BP:1.37
	RELENG_8_2:1.38.2.2.0.2
	RELENG_8_2_BP:1.38.2.2
	RELENG_8_1_0_RELEASE:1.38.2.1.4.1
	RELENG_8_1:1.38.2.1.0.4
	RELENG_8_1_BP:1.38.2.1
	RELENG_7_3_0_RELEASE:1.37.22.1
	RELENG_7_3:1.37.0.22
	RELENG_7_3_BP:1.37
	RELENG_8_0_0_RELEASE:1.38.2.1.2.1
	RELENG_8_0:1.38.2.1.0.2
	RELENG_8_0_BP:1.38.2.1
	RELENG_8:1.38.0.2
	RELENG_8_BP:1.38
	RELENG_7_2_0_RELEASE:1.37.20.1
	RELENG_7_2:1.37.0.20
	RELENG_7_2_BP:1.37
	RELENG_7_1_0_RELEASE:1.37.18.1
	RELENG_6_4_0_RELEASE:1.37.16.1
	RELENG_7_1:1.37.0.18
	RELENG_7_1_BP:1.37
	RELENG_6_4:1.37.0.16
	RELENG_6_4_BP:1.37
	RELENG_7_0_0_RELEASE:1.37
	RELENG_6_3_0_RELEASE:1.37
	RELENG_7_0:1.37.0.14
	RELENG_7_0_BP:1.37
	RELENG_6_3:1.37.0.12
	RELENG_6_3_BP:1.37
	RELENG_7:1.37.0.10
	RELENG_7_BP:1.37
	RELENG_6_2_0_RELEASE:1.37
	RELENG_6_2:1.37.0.8
	RELENG_6_2_BP:1.37
	RELENG_5_5_0_RELEASE:1.36.2.1
	RELENG_5_5:1.36.2.1.0.6
	RELENG_5_5_BP:1.36.2.1
	RELENG_6_1_0_RELEASE:1.37
	RELENG_6_1:1.37.0.6
	RELENG_6_1_BP:1.37
	RELENG_6_0_0_RELEASE:1.37
	RELENG_6_0:1.37.0.4
	RELENG_6_0_BP:1.37
	RELENG_6:1.37.0.2
	RELENG_6_BP:1.37
	RELENG_5_4_0_RELEASE:1.36.2.1
	RELENG_5_4:1.36.2.1.0.4
	RELENG_5_4_BP:1.36.2.1
	RELENG_5_3_0_RELEASE:1.36.2.1
	RELENG_5_3:1.36.2.1.0.2
	RELENG_5_3_BP:1.36.2.1
	RELENG_5:1.36.0.2
	RELENG_5_BP:1.36
	RELENG_5_2_1_RELEASE:1.35
	RELENG_5_2_0_RELEASE:1.35
	RELENG_5_2:1.35.0.2
	RELENG_5_2_BP:1.35
	RELENG_5_1_0_RELEASE:1.34
	RELENG_5_1:1.34.0.2
	RELENG_5_1_BP:1.34
	RELENG_5_0_0_RELEASE:1.32
	RELENG_5_0:1.32.0.2
	RELENG_5_0_BP:1.32
	old_RELENG_4_6_1_RELEASE:1.5.2.22
	old_RELENG_4_6_0_RELEASE:1.5.2.22
	old_RELENG_4_6:1.5.2.22.0.2
	old_RELENG_4_6_BP:1.5.2.22
	old_RELENG_4_5_0_RELEASE:1.5.2.21
	old_RELENG_4_5:1.5.2.21.0.2
	old_RELENG_4_5_BP:1.5.2.21
	old_RELENG_4_4_0_RELEASE:1.5.2.18
	old_RELENG_4_4:1.5.2.18.0.2
	old_RELENG_4_4_BP:1.5.2.18
	old_RELENG_4_3_0_RELEASE:1.5.2.13
	old_RELENG_4_3:1.5.2.13.0.2
	old_RELENG_4_3_BP:1.5.2.13
	old_RELENG_4_2_0_RELEASE:1.5.2.9
	old_RELENG_4_1_1_RELEASE:1.5.2.6
	old_PRE_SMPNG:1.11
	old_RELENG_4_1_0_RELEASE:1.5.2.4
	old_RELENG_4_0_0_RELEASE:1.5
	old_RELENG_4:1.5.0.2
	old_RELENG_4_BP:1.5;
locks; strict;
comment	@# @;


1.39
date	2009.09.12.22.13.41;	author hrs;	state dead;
branches
	1.39.2.1;
next	1.38;

1.38
date	2009.06.01.05.35.03;	author dougb;	state Exp;
branches
	1.38.2.1;
next	1.37;

1.37
date	2004.10.07.13.55.26;	author mtm;	state Exp;
branches
	1.37.2.1
	1.37.10.1
	1.37.16.1
	1.37.18.1
	1.37.20.1
	1.37.22.1
	1.37.24.1;
next	1.36;

1.36
date	2004.03.08.12.25.05;	author pjd;	state Exp;
branches
	1.36.2.1;
next	1.35;

1.35
date	2003.06.29.05.15.57;	author mtm;	state Exp;
branches;
next	1.34;

1.34
date	2003.05.12.11.36.50;	author ume;	state Exp;
branches;
next	1.33;

1.33
date	2003.04.29.12.08.43;	author jwd;	state Exp;
branches;
next	1.32;

1.32
date	2002.10.12.10.31.31;	author schweikh;	state Exp;
branches;
next	1.31;

1.31
date	2002.06.13.22.14.36;	author gordon;	state Exp;
branches;
next	1.30;

1.30
date	2002.07.18.05.00.16;	author ume;	state Exp;
branches;
next	1.29;

1.29
date	2002.04.06.15.15.43;	author ume;	state Exp;
branches;
next	1.28;

1.28
date	2001.12.15.03.59.47;	author ume;	state Exp;
branches;
next	1.27;

1.27
date	2001.12.11.08.21.45;	author ru;	state Exp;
branches;
next	1.26;

1.26
date	2001.11.20.17.38.31;	author sheldonh;	state Exp;
branches;
next	1.25;

1.25
date	2001.11.20.12.51.12;	author ume;	state Exp;
branches;
next	1.24;

1.24
date	2001.11.19.11.41.51;	author sheldonh;	state Exp;
branches;
next	1.23;

1.23
date	2001.07.20.18.08.17;	author ume;	state Exp;
branches;
next	1.22;

1.22
date	2001.07.19.12.37.22;	author ume;	state Exp;
branches;
next	1.21;

1.21
date	2001.06.19.19.27.51;	author ume;	state Exp;
branches;
next	1.20;

1.20
date	2001.06.11.12.38.41;	author ume;	state Exp;
branches;
next	1.19;

1.19
date	2001.06.03.12.26.56;	author brian;	state Exp;
branches;
next	1.18;

1.18
date	2001.04.26.17.33.37;	author ume;	state Exp;
branches;
next	1.17;

1.17
date	2001.03.18.16.07.21;	author ume;	state Exp;
branches;
next	1.16;

1.16
date	2001.01.25.13.18.26;	author ume;	state Exp;
branches;
next	1.15;

1.15
date	2000.11.14.15.49.31;	author ume;	state Exp;
branches;
next	1.14;

1.14
date	2000.10.29.19.59.05;	author ume;	state Exp;
branches;
next	1.13;

1.13
date	2000.10.08.19.18.24;	author obrien;	state Exp;
branches;
next	1.12;

1.12
date	2000.09.10.18.18.10;	author ume;	state Exp;
branches;
next	1.11;

1.11
date	2000.09.06.07.39.55;	author ume;	state Exp;
branches;
next	1.10;

1.10
date	2000.07.18.08.44.17;	author ume;	state Exp;
branches;
next	1.9;

1.9
date	2000.07.09.20.12.50;	author ume;	state Exp;
branches;
next	1.8;

1.8
date	2000.04.06.00.24.52;	author shin;	state Exp;
branches;
next	1.7;

1.7
date	2000.03.28.17.46.02;	author shin;	state Exp;
branches;
next	1.6;

1.6
date	2000.03.28.17.39.53;	author shin;	state Exp;
branches;
next	1.5;

1.5
date	2000.03.12.20.35.52;	author shin;	state Exp;
branches
	1.5.2.1;
next	1.4;

1.4
date	2000.03.11.20.10.39;	author shin;	state Exp;
branches;
next	1.3;

1.3
date	2000.02.24.18.52.58;	author shin;	state Exp;
branches;
next	1.2;

1.2
date	2000.02.24.06.51.03;	author shin;	state Exp;
branches;
next	1.1;

1.1
date	2000.02.23.18.05.57;	author shin;	state Exp;
branches;
next	;

1.39.2.1
date	2009.09.12.22.13.41;	author svnexp;	state dead;
branches;
next	1.39.2.2;

1.39.2.2
date	2013.03.28.13.02.44;	author svnexp;	state Exp;
branches;
next	;

1.38.2.1
date	2009.08.03.08.13.06;	author kensmith;	state Exp;
branches
	1.38.2.1.2.1
	1.38.2.1.4.1;
next	1.38.2.2;

1.38.2.2
date	2010.09.02.06.49.27;	author ume;	state Exp;
branches
	1.38.2.2.2.1;
next	1.38.2.3;

1.38.2.3
date	2012.02.14.10.17.14;	author dougb;	state Exp;
branches;
next	1.38.2.4;

1.38.2.4
date	2012.02.16.01.41.34;	author hrs;	state Exp;
branches
	1.38.2.4.2.1;
next	1.38.2.5;

1.38.2.5
date	2012.03.05.17.33.01;	author bz;	state Exp;
branches;
next	1.38.2.6;

1.38.2.6
date	2012.11.17.10.35.57;	author svnexp;	state Exp;
branches;
next	;

1.38.2.1.2.1
date	2009.10.25.01.10.29;	author kensmith;	state Exp;
branches;
next	;

1.38.2.1.4.1
date	2010.06.14.02.09.06;	author kensmith;	state Exp;
branches;
next	;

1.38.2.2.2.1
date	2010.12.21.17.09.25;	author kensmith;	state Exp;
branches;
next	;

1.38.2.4.2.1
date	2012.03.03.06.15.13;	author kensmith;	state Exp;
branches;
next	1.38.2.4.2.2;

1.38.2.4.2.2
date	2012.11.17.08.24.38;	author svnexp;	state Exp;
branches;
next	;

1.37.2.1
date	2012.11.17.07.39.08;	author svnexp;	state Exp;
branches;
next	;

1.37.10.1
date	2012.02.14.10.17.30;	author dougb;	state Exp;
branches;
next	1.37.10.2;

1.37.10.2
date	2012.11.17.08.01.22;	author svnexp;	state Exp;
branches;
next	;

1.37.16.1
date	2008.10.02.02.57.24;	author kensmith;	state Exp;
branches;
next	;

1.37.18.1
date	2008.11.25.02.59.29;	author kensmith;	state Exp;
branches;
next	;

1.37.20.1
date	2009.04.15.03.14.26;	author kensmith;	state Exp;
branches;
next	;

1.37.22.1
date	2010.02.10.00.26.20;	author kensmith;	state Exp;
branches;
next	;

1.37.24.1
date	2010.12.21.17.10.29;	author kensmith;	state Exp;
branches;
next	1.37.24.2;

1.37.24.2
date	2012.11.17.08.16.37;	author svnexp;	state Exp;
branches;
next	;

1.36.2.1
date	2004.10.10.09.50.54;	author mtm;	state Exp;
branches;
next	;

1.5.2.1
date	2000.04.02.16.37.59;	author shin;	state Exp;
branches;
next	1.5.2.2;

1.5.2.2
date	2000.05.17.03.26.15;	author shin;	state Exp;
branches;
next	1.5.2.3;

1.5.2.3
date	2000.07.15.07.49.29;	author kris;	state Exp;
branches;
next	1.5.2.4;

1.5.2.4
date	2000.07.18.08.47.37;	author ume;	state Exp;
branches;
next	1.5.2.5;

1.5.2.5
date	2000.08.16.23.17.33;	author jhb;	state Exp;
branches;
next	1.5.2.6;

1.5.2.6
date	2000.09.15.16.41.54;	author ume;	state Exp;
branches;
next	1.5.2.7;

1.5.2.7
date	2000.10.30.10.40.11;	author obrien;	state Exp;
branches;
next	1.5.2.8;

1.5.2.8
date	2000.11.01.07.21.45;	author ume;	state Exp;
branches;
next	1.5.2.9;

1.5.2.9
date	2000.11.15.07.47.51;	author ume;	state Exp;
branches;
next	1.5.2.10;

1.5.2.10
date	2001.02.18.15.21.32;	author ume;	state Exp;
branches;
next	1.5.2.11;

1.5.2.11
date	2001.03.06.01.58.45;	author obrien;	state Exp;
branches;
next	1.5.2.12;

1.5.2.12
date	2001.03.06.02.22.00;	author obrien;	state Exp;
branches;
next	1.5.2.13;

1.5.2.13
date	2001.03.19.09.33.59;	author ume;	state Exp;
branches;
next	1.5.2.14;

1.5.2.14
date	2001.05.06.15.08.52;	author ume;	state Exp;
branches;
next	1.5.2.15;

1.5.2.15
date	2001.06.23.23.33.14;	author brian;	state Exp;
branches;
next	1.5.2.16;

1.5.2.16
date	2001.07.03.11.01.12;	author ume;	state Exp;
branches;
next	1.5.2.17;

1.5.2.17
date	2001.07.10.10.10.04;	author ume;	state Exp;
branches;
next	1.5.2.18;

1.5.2.18
date	2001.07.27.20.37.53;	author ume;	state Exp;
branches;
next	1.5.2.19;

1.5.2.19
date	2001.11.27.19.38.05;	author ume;	state Exp;
branches;
next	1.5.2.20;

1.5.2.20
date	2001.12.17.13.51.43;	author ume;	state Exp;
branches;
next	1.5.2.21;

1.5.2.21
date	2001.12.19.17.52.17;	author ru;	state Exp;
branches;
next	1.5.2.22;

1.5.2.22
date	2002.04.16.18.43.52;	author ume;	state Exp;
branches;
next	;


desc
@@


1.39
log
@SVN rev 197139 on 2009-09-12 22:13:41Z by hrs

Integrate rc.d/network_ipv6 into rc.d/netif:

- Add rc.d/stf and rc.d/faith for stf(4) and faith(4).
- Remove rc.d/auto_linklocal and rc.d/network_ipv6.
- Move rc.d/sysctl to just before FILESYSTEMS because rc.d/netif
  depends on some sysctl variables.

Reviewed by:	brooks
MFC after:	3 days
@
text
@#!/bin/sh
#
# Copyright (c) 2000  The KAME Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: src/etc/rc.d/network_ipv6,v 1.38 2009/06/01 05:35:03 dougb Exp $
# 	From: src/etc/rc.network6,v 1.29 2002/04/06 15:15:43
#

# PROVIDE: network_ipv6
# REQUIRE: routing ip6fw
# KEYWORD: nojail

. /etc/rc.subr
. /etc/network.subr

name="network_ipv6"
rcvar=`set_rcvar ipv6`
start_cmd="network_ipv6_start"

network_ipv6_start()
{
	# disallow "internal" addresses to appear on the wire
	route add -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject
	route add -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject

	case ${ipv6_network_interfaces} in
	[Aa][Uu][Tt][Oo])
		# Get a list of network interfaces
		ipv6_network_interfaces="`ifconfig -l`"
		;;
	[Nn][Oo][Nn][Ee])
		ipv6_network_interfaces=''
		;;
	esac

	if checkyesno ipv6_gateway_enable; then
		# act as a router
		${SYSCTL_W} net.inet6.ip6.forwarding=1
		${SYSCTL_W} net.inet6.ip6.accept_rtadv=0

		# wait for DAD
		for i in $ipv6_network_interfaces; do
			ifconfig $i up
		done
		sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
		sleep 1
	else
		# act as endhost - start with manual configuration
		# Setup of net.inet6.ip6.accept_rtadv is done later by
		# network6_interface_setup.
		${SYSCTL_W} net.inet6.ip6.forwarding=0
	fi

	if [ -n "${ipv6_network_interfaces}" ]; then
		# Setup the interfaces
		network6_interface_setup $ipv6_network_interfaces

		# wait for DAD's completion (for global addrs)
		sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
		sleep 1
	fi

	# Filter out interfaces on which IPv6 initialization failed.
	if checkyesno ipv6_gateway_enable; then
		ipv6_working_interfaces=""
		for i in ${ipv6_network_interfaces}; do
			laddr=`network6_getladdr $i exclude_tentative`
			case ${laddr} in
			'')
				;;
			*)
				ipv6_working_interfaces="$i \
				    ${ipv6_working_interfaces}"
				;;
			esac
		done
		ipv6_network_interfaces=${ipv6_working_interfaces}
	fi

	# Setup IPv6 to IPv4 mapping
	network6_stf_setup

	# Install the "default interface" to kernel, which will be used
	# as the default route when there's no router.
	network6_default_interface_setup

	# Setup static routes
	network6_static_routes_setup

	# Setup faith
	network6_faith_setup

	# Support for IPv4 address tacked onto an IPv6 address
	if checkyesno ipv6_ipv4mapping; then
		echo 'IPv4 mapped IPv6 address support=YES'
		${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
	else
		echo 'IPv4 mapped IPv6 address support=NO'
		${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
	fi
}

load_rc_config $name
run_rc_command "$1"
@


1.39.2.1
log
@file network_ipv6 was added on branch RELENG_8_4 on 2013-03-28 13:02:44 +0000
@
text
@d1 126
@


1.39.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/248810
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 123
#!/bin/sh
#
# Copyright (c) 2000  The KAME Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: releng/8.4/etc/rc.d/network_ipv6 232552 2012-03-05 17:33:01Z bz $
# 	From: src/etc/rc.network6,v 1.29 2002/04/06 15:15:43
#

# PROVIDE: network_ipv6
# REQUIRE: routing
# KEYWORD: nojail

. /etc/rc.subr
. /etc/network.subr

name="network_ipv6"
rcvar="ipv6_enable"
start_cmd="network_ipv6_start"

network_ipv6_start()
{

	case ${ipv6_network_interfaces} in
	[Aa][Uu][Tt][Oo])
		# Get a list of network interfaces
		ipv6_network_interfaces="`ifconfig -l`"
		;;
	[Nn][Oo][Nn][Ee])
		ipv6_network_interfaces=''
		;;
	esac

	if checkyesno ipv6_gateway_enable; then
		# act as a router
		${SYSCTL_W} net.inet6.ip6.forwarding=1
		${SYSCTL_W} net.inet6.ip6.accept_rtadv=0

		# wait for DAD
		for i in $ipv6_network_interfaces; do
			ifconfig $i up
		done
		sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
		sleep 1
	else
		# act as endhost - start with manual configuration
		# Setup of net.inet6.ip6.accept_rtadv is done later by
		# network6_interface_setup.
		${SYSCTL_W} net.inet6.ip6.forwarding=0
	fi

	if [ -n "${ipv6_network_interfaces}" ]; then
		# Setup the interfaces
		network6_interface_setup $ipv6_network_interfaces

		# wait for DAD's completion (for global addrs)
		sleep `${SYSCTL_N} net.inet6.ip6.dad_count`
		sleep 1
	fi

	# Filter out interfaces on which IPv6 initialization failed.
	if checkyesno ipv6_gateway_enable; then
		ipv6_working_interfaces=""
		for i in ${ipv6_network_interfaces}; do
			laddr=`network6_getladdr $i exclude_tentative`
			case ${laddr} in
			'')
				;;
			*)
				ipv6_working_interfaces="$i \
				    ${ipv6_working_interfaces}"
				;;
			esac
		done
		ipv6_network_interfaces=${ipv6_working_interfaces}
	fi

	# Setup IPv6 to IPv4 mapping
	network6_stf_setup

	# Install the "default interface" to kernel, which will be used
	# as the default route when there's no router.
	network6_default_interface_setup

	# Setup static routes
	network6_static_routes_setup

	# Setup faith
	network6_faith_setup

	# Support for IPv4 address tacked onto an IPv6 address
	if checkyesno ipv6_ipv4mapping; then
		echo 'IPv4 mapped IPv6 address support=YES'
		${SYSCTL_W} net.inet6.ip6.v6only=0 >/dev/null
	else
		echo 'IPv4 mapped IPv6 address support=NO'
		${SYSCTL_W} net.inet6.ip6.v6only=1 >/dev/null
	fi
}

load_rc_config $name
run_rc_command "$1"
@


1.38
log
@SVN rev 193198 on 2009-06-01 05:35:03Z by dougb

Make the pf and ipfw firewalls start before netif, just like ipfilter
already does. This eliminates a logical inconsistency, and a small
window where the system is open after the network comes up.
@
text
@d27 1
a27 1
# $FreeBSD$
@


1.38.2.1
log
@SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)
@
text
@@


1.38.2.2
log
@SVN rev 212140 on 2010-09-02 06:49:27Z by ume

We don't have etc/rc.d/ip6fw anymore.
Since HEAD doesn't have etc/rc.d/network_ipv6,
this commit is directly into RELENG_8.

Spotted by:	takachan__at__running-dog.net
@
text
@d32 1
a32 1
# REQUIRE: routing
@


1.38.2.3
log
@SVN rev 231655 on 2012-02-14 10:17:14Z by dougb

MFC r230099:

Change rcvar= assignments to the literal values set_rcvar
would have returned. This will slightly reduce boot time,
and help in diff reduction to HEAD.
@
text
@d39 1
a39 1
rcvar="ipv6_enable"
@


1.38.2.4
log
@SVN rev 231803 on 2012-02-16 01:41:34Z by hrs

Add static routes to ::ffff:0.0.0.0/96 and ::0.0.0.0/96 unconditionally when
the kernel supports PF_INET6.

PR:	kern/161899
@
text
@d44 4
@


1.38.2.5
log
@SVN rev 232552 on 2012-03-05 17:33:01Z by bz

MFC r231852,232127:

  Merge multi-FIB IPv6 support.

  Extend the so far IPv4-only support for multiple routing tables (FIBs)
  introduced in r178888 to IPv6 providing feature parity.

  This includes an extended rtalloc(9) KPI for IPv6, the necessary
  adjustments to the network stack, and user land support as in netstat.

Sponsored by:	Cisco Systems, Inc.
@
text
@a43 1

@


1.38.2.6
log
@## SVN ##
## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/ 242909
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ## r242909 | dim | 2012-11-12 07:47:19 +0000 (Mon, 12 Nov 2012) | 20 lines
## SVN ##
## SVN ## MFC r242625:
## SVN ##
## SVN ## Remove duplicate const specifiers in many drivers (I hope I got all of
## SVN ## them, please let me know if not).  Most of these are of the form:
## SVN ##
## SVN ## static const struct bzzt_type {
## SVN ##       [...list of members...]
## SVN ## } const bzzt_devs[] = {
## SVN ##       [...list of initializers...]
## SVN ## };
## SVN ##
## SVN ## The second const is unnecessary, as arrays cannot be modified anyway,
## SVN ## and if the elements are const, the whole thing is const automatically
## SVN ## (e.g. it is placed in .rodata).
## SVN ##
## SVN ## I have verified this does not change the binary output of a full kernel
## SVN ## build (except for build timestamps embedded in the object files).
## SVN ##
## SVN ## Reviewed by:	yongari, marius
## SVN ##
## SVN ## ------------------------------------------------------------------------
## SVN ##
@
text
@d27 1
a27 1
# $FreeBSD: stable/8/etc/rc.d/network_ipv6 232552 2012-03-05 17:33:01Z bz $
@


1.38.2.4.2.1
log
@SVN rev 232438 on 2012-03-03 06:15:13Z by kensmith

Copy stable/8 to releng/8.3 as part of 8.3-RELEASE release cycle.

Approved by:	re (implicit)
@
text
@@


1.38.2.4.2.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/8.3/etc/rc.d/network_ipv6 231803 2012-02-16 01:41:34Z hrs $
@


1.38.2.2.2.1
log
@SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)
@
text
@@


1.38.2.1.4.1
log
@SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)
@
text
@@


1.38.2.1.2.1
log
@SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)
@
text
@@


1.37
log
@Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
@
text
@d32 1
a32 1
# REQUIRE: routing
@


1.37.2.1
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: stable/6/etc/rc.d/network_ipv6 136224 2004-10-07 13:55:26Z mtm $
@


1.37.10.1
log
@SVN rev 231656 on 2012-02-14 10:17:30Z by dougb

MFC r230099:

Change rcvar= assignments to the literal values set_rcvar
would have returned. This will slightly reduce boot time,
and help in diff reduction to HEAD.
@
text
@d39 1
a39 1
rcvar="ipv6_enable"
@


1.37.10.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: stable/7/etc/rc.d/network_ipv6 231656 2012-02-14 10:17:30Z dougb $
@


1.37.24.1
log
@SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)
@
text
@@


1.37.24.2
log
@Switch importer
@
text
@d27 1
a27 1
# $FreeBSD: releng/7.4/etc/rc.d/network_ipv6 136224 2004-10-07 13:55:26Z mtm $
@


1.37.22.1
log
@SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)
@
text
@@


1.37.20.1
log
@SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)
@
text
@@


1.37.18.1
log
@SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)
@
text
@@


1.37.16.1
log
@SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)
@
text
@@


1.36
log
@Mark scripts as not usable inside a jail by adding keyword 'nojail'.

Some suggestions from:	rwatson, Ruben de Groot <mail25@@bzerk.org>
@
text
@d33 1
a33 1
# KEYWORD: FreeBSD nojail
@


1.36.2.1
log
@RCS file: /home/ncvs/src/etc/rc,v
----------------------------
revision 1.335
date: 2004/10/08 14:23:49;  author: mtm;  state: Exp;  lines: +0 -1
Remove an unused variable.

Submitted by: Pawel Worach <pawel.worach@@telia.com>
----------------------------
revision 1.334
date: 2004/10/07 13:55:25;  author: mtm;  state: Exp;  lines: +1 -1
Remove the requirement for the FreeBSD keyword as it no longer
makes any sense.

Discussed with: dougb, brooks
MFC after: 3 days
=============================================================================
RCS file: /home/ncvs/src/etc/rc.d/nsswitch,v
----------------------------
revision 1.4
date: 2004/09/16 17:03:12;  author: keramida;  state: Exp;  lines: +1 -1
Fix requirement of `network' to `NETWORK' because the former isn't
provided by any rc.d script.

Approved by:	mtm
=============================================================================
RCS file: /home/ncvs/src/etc/rc.d/pflog,v
----------------------------
revision 1.3
date: 2004/09/16 17:04:20;  author: keramida;  state: Exp;  lines: +1 -1
We don't have any providers of `beforenetlkm' in FreeBSD.  Remove the
dependency to it from our rc.d scripts.

Approved by:	mtm
=============================================================================

Approved by: re/scottl
@
text
@d33 1
a33 1
# KEYWORD: nojail
@


1.35
log
@o Hookup rc.d/routing and rc.d/netoptions
o Ensure rc.d/network2 and rc.d/network3 are not automatically run
  during boot
o Modify script headers so rcorder(8) can put the two scripts in the
  correct sequence.
@
text
@d33 1
a33 1
# KEYWORD: FreeBSD
@


1.34
log
@pccard_ether didn't setup IPv6 after rcTOS sweep.

Reviewed by:	mtm and dougb
Approved by:	re (scott)
@
text
@d32 1
a32 1
# REQUIRE: network2
@


1.33
log
@Add rc.subr (found during new /etc/netstart testing)
@
text
@d36 1
a40 291
#required_files="/etc/rc.network6"

hexdigit()
{
	if [ $1 -lt 10 ]; then
		echo $1
	else
		case $1 in
		10)	echo a ;;
		11)	echo b ;;
		12)	echo c ;;
		13)	echo d ;;
		14)	echo e ;;
		15)	echo f ;;
		esac
	fi
}

hexprint()
{
	val=$1
	str=''

	dig=`hexdigit $((${val} & 15))`
	str=${dig}${str}
	val=$((${val} >> 4))
	while [ ${val} -gt 0 ]; do
		dig=`hexdigit $((${val} & 15))`
		str=${dig}${str}
		val=$((${val} >> 4))
	done

	echo ${str}
}

network6_interface_setup()
{
	interfaces=$*
	rtsol_interfaces=''
	case ${ipv6_gateway_enable} in
	[Yy][Ee][Ss])
		rtsol_available=no
		;;
	*)
		rtsol_available=yes
		;;
	esac
	for i in $interfaces; do
		rtsol_interface=yes
		eval prefix=\$ipv6_prefix_$i
		if [ -n "${prefix}" ]; then
			rtsol_available=no
			rtsol_interface=no
			laddr=`network6_getladdr $i`
			hostid=`expr "${laddr}" : 'fe80::\(.*\)%\(.*\)'`
			for j in ${prefix}; do
				address=$j\:${hostid}
				ifconfig $i inet6 ${address} prefixlen 64 alias

				case ${ipv6_gateway_enable} in
				[Yy][Ee][Ss])
					# subnet-router anycast address
					# (rfc2373)
					ifconfig $i inet6 $j:: prefixlen 64 \
						alias anycast
					;;
				esac
			done
		fi
		eval ipv6_ifconfig=\$ipv6_ifconfig_$i
		if [ -n "${ipv6_ifconfig}" ]; then
			rtsol_available=no
			rtsol_interface=no
			ifconfig $i inet6 ${ipv6_ifconfig} alias
		fi

		if [ ${rtsol_available} = yes -a ${rtsol_interface} = yes ]
		then
			case ${i} in
			lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*)
				;;
			*)
				rtsol_interfaces="${rtsol_interfaces} ${i}"
				;;
			esac
		else
			ifconfig $i inet6
		fi
	done

	if [ ${rtsol_available} = yes -a -n "${rtsol_interfaces}" ]; then
		# Act as endhost - automatically configured.
		# You can configure only single interface, as
		# specification assumes that autoconfigured host has
		# single interface only.
		sysctl net.inet6.ip6.accept_rtadv=1
		set ${rtsol_interfaces}
		ifconfig $1 up
		rtsol $1
	fi

	for i in $interfaces; do
		alias=0
		while : ; do
			eval ipv6_ifconfig=\$ipv6_ifconfig_${i}_alias${alias}
			if [ -z "${ipv6_ifconfig}" ]; then
				break;
			fi
			ifconfig $i inet6 ${ipv6_ifconfig} alias
			alias=$((${alias} + 1))
		done
	done
}

network6_stf_setup()
{
	case ${stf_interface_ipv4addr} in
	[Nn][Oo] | '')
		;;
	*)
		# assign IPv6 addr and interface route for 6to4 interface
		stf_prefixlen=$((16+${stf_interface_ipv4plen:-0}))
		OIFS="$IFS"
		IFS=".$IFS"
		set ${stf_interface_ipv4addr}
		IFS="$OIFS"
		hexfrag1=`hexprint $(($1*256 + $2))`
		hexfrag2=`hexprint $(($3*256 + $4))`
		ipv4_in_hexformat="${hexfrag1}:${hexfrag2}"
		case ${stf_interface_ipv6_ifid} in
		[Aa][Uu][Tt][Oo] | '')
			for i in ${ipv6_network_interfaces}; do
				laddr=`network6_getladdr ${i}`
				case ${laddr} in
				'')
					;;
				*)
					break
					;;
				esac
			done
			stf_interface_ipv6_ifid=`expr "${laddr}" : \
						      'fe80::\(.*\)%\(.*\)'`
			case ${stf_interface_ipv6_ifid} in
			'')
				stf_interface_ipv6_ifid=0:0:0:1
				;;
			esac
			;;
		esac
		ifconfig stf0 create >/dev/null 2>&1
		ifconfig stf0 inet6 2002:${ipv4_in_hexformat}:${stf_interface_ipv6_slaid:-0}:${stf_interface_ipv6_ifid} \
			prefixlen ${stf_prefixlen}
		# disallow packets to malicious 6to4 prefix
		route add -inet6 2002:e000:: -prefixlen 20 ::1 -reject
		route add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject
		route add -inet6 2002:0000:: -prefixlen 24 ::1 -reject
		route add -inet6 2002:ff00:: -prefixlen 24 ::1 -reject
		;;
	esac
}

network6_static_routes_setup()
{
	# Set up any static routes.
	case ${ipv6_defaultrouter} in
	[Nn][Oo] | '')
		;;
	*)
		ipv6_static_routes="default ${ipv6_static_routes}"
		ipv6_route_default="default ${ipv6_defaultrouter}"
		;;
	esac
	case ${ipv6_static_routes} in
	[Nn][Oo] | '')
		;;
	*)
		for i in ${ipv6_static_routes}; do
			eval ipv6_route_args=\$ipv6_route_${i}
			route add -inet6 ${ipv6_route_args}
		done
		;;
	esac
}

network6_faith_setup()
{
	case ${ipv6_faith_prefix} in
	[Nn][Oo] | '')
		;;
	*)
		sysctl net.inet6.ip6.keepfaith=1
		ifconfig faith0 create >/dev/null 2>&1
		ifconfig faith0 up
		for prefix in ${ipv6_faith_prefix}; do
			prefixlen=`expr "${prefix}" : ".*/\(.*\)"`
			case ${prefixlen} in
			'')
				prefixlen=96
				;;
			*)
				prefix=`expr "${prefix}" : \
					     "\(.*\)/${prefixlen}"`
				;;
			esac
			route add -inet6 ${prefix} -prefixlen ${prefixlen} ::1
			route change -inet6 ${prefix} -prefixlen ${prefixlen} \
				-ifp faith0
		done
		;;
	esac
}

network6_default_interface_setup()
{
	# Choose IPv6 default interface if it is not clearly specified.
	case ${ipv6_default_interface} in
	'')
		for i in ${ipv6_network_interfaces}; do
			case $i in
			lo0|faith[0-9]*)
				continue
				;;
			esac
			laddr=`network6_getladdr $i exclude_tentative`
			case ${laddr} in
			'')
				;;
			*)
				ipv6_default_interface=$i
				break
				;;
			esac
		done
		;;
	esac

	# Disallow unicast packets without outgoing scope identifiers,
	# or route such packets to a "default" interface, if it is specified.
	route add -inet6 fe80:: -prefixlen 10 ::1 -reject
	case ${ipv6_default_interface} in
	[Nn][Oo] | '')
		route add -inet6 ff02:: -prefixlen 16 ::1 -reject
		;;
	*)
		laddr=`network6_getladdr ${ipv6_default_interface}`
		route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface \
			-cloning

		# Disable installing the default interface with the
		# case net.inet6.ip6.forwarding=0 and
		# net.inet6.ip6.accept_rtadv=0, due to avoid conflict
		# between the default router list and the manual
		# configured default route.
		case ${ipv6_gateway_enable} in
		[Yy][Ee][Ss])
			;;
		*)
			if [ `sysctl -n net.inet6.ip6.accept_rtadv` -eq 1 ]
			then
				ndp -I ${ipv6_default_interface}
			fi
			;;
		esac
		;;
	esac
}

network6_getladdr()
{
	ifconfig $1 2>/dev/null | while read proto addr rest; do
		case ${proto} in
		inet6)
			case ${addr} in
			fe80::*)
				if [ -z "$2" ]; then
					echo ${addr}
					return
				fi
				case ${rest} in
				*tentative*)
					continue
					;;
				*)
					echo ${addr}
					return
				esac
			esac
		esac
	done
}
@


1.32
log
@Fix style bugs:
* Space -> tabs conversion.
* Removed blanks before semicolon in "if ... ; then".
* Proper indentation of misindented lines.
* Put a full stop after some comments.
* Removed whitespace at end of line.

Approved by:	silence from gordon
@
text
@d35 2
@


1.31
log
@Merge in all the changes that Mike Makonnen has been maintaining for a
while. This is only the script pieces, the glue for the build comes next.

Submitted by:   Mike Makonnen <makonnen@@pacbell.net>
Reviewed by:    silence on -current and -hackers
Prodded by:     rwatson
@
text
@d203 8
a210 8
        case ${ipv6_defaultrouter} in
        [Nn][Oo] | '')
                ;;
        *)
                ipv6_static_routes="default ${ipv6_static_routes}"
                ipv6_route_default="default ${ipv6_defaultrouter}"
                ;;
        esac
d346 1
a346 1
	if checkyesno ipv6_gateway_enable ; then
d374 1
a374 1
	if checkyesno ipv6_gateway_enable ; then
d404 1
a404 1
	if checkyesno ipv6_ipv4mapping ; then
@


1.30
log
@be able to configure to run an IPv6 routing daemon even on
an end node.

Requested by:	Masachika ISHIZUKA <ishizuka@@ish.org>
MFC after:	1 week
@
text
@d1 1
a1 1
#! /bin/sh
d28 1
d31 8
a38 4
# Note that almost all of the user-configurable behavior is not in this
# file, but rather in /etc/defaults/rc.conf.  Please check that file
# first before contemplating any changes here.  If you do need to change
# this file for some reason, we would like to know about it.
d40 2
a41 1
hexdigit () {
d56 2
a57 1
hexprint () {
d73 2
a74 226
# IPv6 startup

network6_pass1() {
	echo -n 'Doing IPv6 network setup:'

	# Initialize IP filtering using ip6fw
	#
	if /sbin/ip6fw -q flush > /dev/null 2>&1; then
		ipv6_firewall_in_kernel=1
	else
		ipv6_firewall_in_kernel=0
	fi

	case ${ipv6_firewall_enable} in
	[Yy][Ee][Ss])
		if [ "${ipv6_firewall_in_kernel}" -eq 0 ] && kldload ip6fw; then
			ipv6_firewall_in_kernel=1
			echo "Kernel IPv6 firewall module loaded."
		elif [ "${ipv6_firewall_in_kernel}" -eq 0 ]; then
			echo "Warning: IPv6 firewall kernel module failed to load."
		fi
		;;
	esac

	# Load the filters if required
	#
	case ${ipv6_firewall_in_kernel} in
	1)
		if [ -z "${ipv6_firewall_script}" ]; then
			ipv6_firewall_script=/etc/rc.firewall6
		fi

		case ${ipv6_firewall_enable} in
		[Yy][Ee][Ss])
			if [ -r "${ipv6_firewall_script}" ]; then
				. "${ipv6_firewall_script}"
				echo -n 'IPv6 Firewall rules loaded.'
			elif [ "`ip6fw l 65535`" = "65535 deny ipv6 from any to any" ]; then
				echo -n "Warning: kernel has IPv6 firewall functionality, "
				echo "but IPv6 firewall rules are not enabled."
				echo "		 All ipv6 services are disabled."
			fi

			case ${ipv6_firewall_logging} in
			[Yy][Ee][Ss] | '')
				echo 'IPv6 Firewall logging=YES'
				sysctl net.inet6.ip6.fw.verbose=1 >/dev/null
				;;
			*)
				;;
			esac

			;;
		esac
		;;
	esac

	case ${ipv6_network_interfaces} in
	[Aa][Uu][Tt][Oo])
		#
		# list of interfaces, and prefix for interfaces
		#
		ipv6_network_interfaces="`ifconfig -l`"
		;;
	[Nn][Oo][Nn][Ee])
		ipv6_network_interfaces=''
		;;
	esac

	# just to make sure
	ifconfig lo0 up

	# disallow "internal" addresses to appear on the wire
	route add -inet6 ::ffff:0.0.0.0 -prefixlen 96 ::1 -reject
	route add -inet6 ::0.0.0.0 -prefixlen 96 ::1 -reject

	case ${ipv6_gateway_enable} in
	[Yy][Ee][Ss])
		# act as a router
		sysctl net.inet6.ip6.forwarding=1
		sysctl net.inet6.ip6.accept_rtadv=0

		# wait for DAD
		for i in $ipv6_network_interfaces; do
			ifconfig $i up
		done
		sleep `sysctl -n net.inet6.ip6.dad_count`
		sleep 1
		;;
	*)
		# act as endhost - start with manual configuration
		# Setup of net.inet6.ip6.accept_rtadv is done later by
		# network6_interface_setup.
		sysctl net.inet6.ip6.forwarding=0
		;;
	esac

	if [ -n "${ipv6_network_interfaces}" ]; then
		# setting up interfaces
		network6_interface_setup $ipv6_network_interfaces

		# wait for DAD's completion (for global addrs)
		sleep `sysctl -n net.inet6.ip6.dad_count`
		sleep 1
	fi

	case ${ipv6_gateway_enable} in
	[Yy][Ee][Ss])
		# Filter out interfaces on which IPv6 addr init failed.
		ipv6_working_interfaces=""
		for i in ${ipv6_network_interfaces}; do
			laddr=`network6_getladdr $i exclude_tentative`
			case ${laddr} in
			'')
				;;
			*)
				ipv6_working_interfaces="$i \
					${ipv6_working_interfaces}"
				;;
			esac
		done
		ipv6_network_interfaces=${ipv6_working_interfaces}
		;;
	esac

	# 6to4 setup
	network6_stf_setup

	# install the "default interface" to kernel, which will be used
	# as the default route when there's no router.
	network6_default_interface_setup

	# setup static routes
	network6_static_routes_setup

	# setup faith
	network6_faith_setup

	# ipv6_router
	case ${ipv6_router_enable} in
	[Yy][Ee][Ss])
		if [ -x ${ipv6_router} ]; then
			echo -n " ${ipv6_router}"
			${ipv6_router} ${ipv6_router_flags}
		fi
		;;
	esac


	case ${ipv6_gateway_enable} in
	[Yy][Ee][Ss])
		# rtadvd
		# This should enabled with a great care.
		# You may want to fine-tune /etc/rtadvd.conf.
		#
		# And if you wish your rtadvd to receive and process
		# router renumbering messages, specify your Router Renumbering
		# security policy by -R option.
		#
		# See `man 3 ipsec_set_policy` for IPsec policy specification
		# details.
		# (CAUTION: This enables your routers prefix renumbering
		# from another machine, so if you enable this, do it with
		# enough care.)
		#
		case ${rtadvd_enable} in
		[Yy][Ee][Ss])
			# default
			case ${rtadvd_interfaces} in
			'')
				for i in ${ipv6_network_interfaces}; do
					case $i in
					lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*)
						continue
						;;
					*)
						rtadvd_interfaces="${rtadvd_interfaces} ${i}"
						;;
					esac
				done
				;;
			esac
			rtadvd ${rtadvd_interfaces}
			#
			# Enable Router Renumbering, unicast case
			# (use correct src/dst addr)
			# rtadvd -R "in ipsec ah/transport/fec0:0:0:1::1-fec0:0:0:10::1/require" \
			#	${ipv6_network_interfaces}
			# Enable Router Renumbering, multicast case
			# (use correct src addr)
			# rtadvd -R "in ipsec ah/transport/ff05::2-fec0:0:0:10::1/require" \
			#	${ipv6_network_interfaces}
			;;
		esac

		# mroute6d
		case ${mroute6d_enable} in
		[Yy][Ee][Ss])
			if [ -x ${mroute6d_program} ]; then
				echo -n " ${mroute6d_program}"
				${mroute6d_program} ${mroute6d_flags}
			fi
			;;
		esac
		;;
	esac

	case ${ipv6_ipv4mapping} in
	[Yy][Ee][Ss])
		echo -n ' IPv4 mapped IPv6 address support=YES'
		sysctl net.inet6.ip6.v6only=0 >/dev/null
		;;
	'' | *)
		echo -n ' IPv4 mapped IPv6 address support=NO'
		sysctl net.inet6.ip6.v6only=1 >/dev/null
		;;
	esac

	echo '.'

	# Let future generations know we made it.
	#
	network6_pass1_done=YES
}

network6_interface_setup() {
d152 2
a153 1
network6_stf_setup() {
d200 2
a201 1
network6_static_routes_setup() {
d223 2
a224 1
network6_faith_setup() {
d251 2
a252 1
network6_default_interface_setup() {
d306 2
a307 1
network6_getladdr() {
d329 86
@


1.29
log
@Now, you can specify "" or "NONE" for ipv6_network_interfaces to
prevent the interfaces from being initialized by /etc/rc.network6
wrongly.  So, you can explicitly initialize the interfaces by
/etc/pccard_ether.
With previous rc.network6, if you specify pccardd_flags="-z",
net.inet6.ip6.accept_rtadv was wronly set to 0, then RA was not
accepted.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.28 2001/12/15 03:59:47 ume Exp $
d204 11
a216 10
		# ipv6_router
		case ${ipv6_router_enable} in
		[Yy][Ee][Ss])
			if [ -x ${ipv6_router} ]; then
				echo -n " ${ipv6_router}"
				${ipv6_router} ${ipv6_router_flags}
			fi
			;;
		esac

@


1.28
log
@automatic creation of faith0 and stf0 for backward compatibility.

MFC after:	2 days
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.27 2001/12/11 08:21:45 ru Exp $
d130 3
d157 2
a159 1
		sysctl net.inet6.ip6.accept_rtadv=0
d163 3
a165 2
	# setting up interfaces
	network6_interface_setup $ipv6_network_interfaces
d167 4
a170 3
	# wait for DAD's completion (for global addrs)
	sleep `sysctl -n net.inet6.ip6.dad_count`
	sleep 1
@


1.27
log
@s/sysctl -w/sysctl/
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.26 2001/11/20 17:38:31 sheldonh Exp $
d397 1
d437 1
@


1.26
log
@(null commit)

rev 1.24 only makes sense given that test(1) has been made a shell
builtin command.  Without this optimization, you'd be better off using
printf(1) if you cared about efficiency at this level (although the use
of printf(1) prior to mounting /usr would remain an issue).
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.25 2001/11/20 12:51:12 ume Exp $
d112 1
a112 1
				sysctl -w net.inet6.ip6.fw.verbose=1 >/dev/null
d142 2
a143 2
		sysctl -w net.inet6.ip6.forwarding=1
		sysctl -w net.inet6.ip6.accept_rtadv=0
d154 2
a155 2
		sysctl -w net.inet6.ip6.forwarding=0
		sysctl -w net.inet6.ip6.accept_rtadv=0
d269 1
a269 1
		sysctl -w net.inet6.ip6.v6only=0 >/dev/null
d273 1
a273 1
		sysctl -w net.inet6.ip6.v6only=1 >/dev/null
d343 1
a343 1
		sysctl -w net.inet6.ip6.accept_rtadv=1
d435 1
a435 1
		sysctl -w net.inet6.ip6.keepfaith=1
@


1.25
log
@The rtsol must be done before the alias processing.

PR:		conf/31366
Submitted by:	gshapiro
MFC after:	1 week
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.24 2001/11/19 11:41:51 sheldonh Exp $
@


1.24
log
@Use shell functions for printing hex instead of printf(1) so that
printf(1) can be dropped from the system shell as a shell builtin.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.23 2001/07/20 18:08:17 ume Exp $
a322 9
		alias=0
		while : ; do
			eval ipv6_ifconfig=\$ipv6_ifconfig_${i}_alias${alias}
			if [ -z "${ipv6_ifconfig}" ]; then
				break;
			fi
			ifconfig $i inet6 ${ipv6_ifconfig} alias
			alias=$((${alias} + 1))
		done
d348 12
@


1.23
log
@Do more strict checking for an interface.

Suggested by:	matusita@@jp.FreeBSD.org
MFC after:	1 week
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.22 2001/07/19 12:37:22 ume Exp $
d35 31
d370 3
a372 2
		ipv4_in_hexformat=`printf "%x:%x\n" \
			$(($1*256 + $2)) $(($3*256 + $4))`
@


1.22
log
@- Avoid to select an interface which is not good for RA/RS.
	Submitted by:	sakane@@kame.net
- Avoid to select lo0 or faith for a default interface.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.21 2001/06/19 19:27:51 ume Exp $
d200 1
a200 1
					lo0|gif*|stf*|faith*|lp[012]|sl[012]|tun[012])
d305 1
a305 1
			lo0|gif*|stf*|faith*|lp[012]|sl[012]|tun[012])
d427 1
a427 1
			lo0|faith*)
@


1.21
log
@Add configuration for a FAITH IPv6-to-IPv4 TCP translator.
To use a FAITH actually, you also need faithd(8) setup.
Please consult faithd(8) manpage.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.20 2001/06/11 12:38:41 ume Exp $
d200 1
a200 1
					lo0|gif*|stf*|faith*)
d305 1
a305 1
			lo0|gif*|stf*|faith*)
d426 5
@


1.20
log
@Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some
critical problem after the snap was out were fixed.
There are many many changes since last KAME merge.

TODO:
  - The definitions of SADB_* in sys/net/pfkeyv2.h are still different
    from RFC2407/IANA assignment because of binary compatibility
    issue.  It should be fixed under 5-CURRENT.
  - ip6po_m member of struct ip6_pktopts is no longer used.  But, it
    is still there because of binary compatibility issue.  It should
    be removed under 5-CURRENT.

Reviewed by:	itojun
Obtained from:	KAME
MFC after:	3 weeks
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.19 2001/06/03 12:26:56 brian Exp $
d164 3
d390 26
@


1.19
log
@Move gif_interfaces from an IP6 option to a regular IP option.

PR:		26543
Submitted by:	Brooks Davis <brooks@@one-eyed-alien.net>
MFC after:	3 weeks
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.18 2001/04/26 17:33:37 ume Exp $
d235 1
a235 1
		sysctl -w net.inet6.ip6.mapped_addr=1 >/dev/null
d239 1
a239 1
		sysctl -w net.inet6.ip6.mapped_addr=0 >/dev/null
a258 1
		prefixcmd_enable=NO
d267 2
d270 2
a271 17
				case ${prefixcmd_enable} in
				[Yy][Ee][Ss])
					prefix $i $j::
					;;
				*)
					laddr=`network6_getladdr $i`
					hostid=`expr "${laddr}" : \
						'fe80::\(.*\)%\(.*\)'`
					address=$j\:${hostid}

					eval hostid_$i=${hostid}
					eval address_$i=${address}

					ifconfig $i inet6 ${address} \
						prefixlen 64 alias
					;;
				esac
@


1.18
log
@Enable static IPv6 address assignment on PCMCIA NIC.

PR:		conf/26633
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.17 2001/03/18 16:07:21 ume Exp $
a127 3
	# gifconfig
	network6_gif_setup

a336 20
}

network6_gif_setup() {
	case ${gif_interfaces} in
	[Nn][Oo] | '')
		;;
	*)
		for i in ${gif_interfaces}; do
			eval peers=\$gifconfig_$i
			case ${peers} in
			'')
				continue
				;;
			*)
				gifconfig $i ${peers}
				;;
			esac
		done
		;;
	esac
@


1.17
log
@Add `ipv6_ifconfig_IFN_aliasN' directive to allow multiple aliases.

PR:		conf/24239
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.16 2001/01/25 13:18:26 ume Exp $
d132 1
a132 1
	network6_interface_setup
d254 1
d265 1
a265 1
	for i in $ipv6_network_interfaces; do
@


1.16
log
@- Don't try to send RA to lo0, gifN and faithN.
- ipv6_network_interfaces has all available interfaces to work for
  static configuration even if the host is end host.  When rtsol is
  invoked, singleness of interface is checked.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.15 2000/11/14 15:49:31 ume Exp $
d305 9
@


1.15
log
@Don't install route for fec0::/10.  It was wrongly replaced from
ff02::/16 by me.

PR:		22715
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.14 2000/10/29 19:59:05 ume Exp $
d94 4
a97 18
		case ${ipv6_gateway_enable} in
		[Yy][Ee][Ss])
			#
			# list of interfaces, and prefix for interfaces
			#
			ipv6_network_interfaces="`ifconfig -l`"
			;;
		*)
			#
			# manual configurations - in case ip6_gateway_enable=NO
			# you can configure only single interface,
			# as specification assumes that
			# autoconfigured host has single interface only.
			#
			set `ifconfig -l`
			ipv6_network_interfaces="$1"
			;;
		esac
d200 1
a200 1
					stf*)
@


1.14
log
@- ipv6_prefix_* and ipv6_ifconfig_* work for end node
- rtsol should be work for only one interface
- new variable ipv6_defaultrouter is added
- option name of rtadvd in comment are corrected
- ipv6_firewall_enable, ipv6_firewall_type, ipv6_firewall_script,
  ipv6_firewall_logging are added to introduce rc.firewall6.

IPv6 firewall rule is just starting point and should be brushed up.
This commit includes PR18621, PR21694, PR22051.

PR:		conf/18621, conf/21694, conf/22051
Reviewed by:	asmodai
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.13 2000/10/08 19:18:24 obrien Exp $
d456 1
a456 1
		route add -inet6 fec0:: -prefixlen 10 ::1 -reject
d460 1
a460 1
		route add -inet6 fec0:: ${laddr} -prefixlen 10 -interface \
a469 1
			ndp -I ${ipv6_default_interface}
@


1.13
log
@Add copyright notices.  Other systems have been barrowing our /etc files
w/o giving any credit.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.12 2000/09/10 18:18:10 ume Exp $
d40 9
a48 1
	case ${ipv6_gateway_enable} in
d50 37
a86 6
		#
		# list of interfaces, and prefix for interfaces
		#
		case ${ipv6_network_interfaces} in
		[Aa][Uu][Tt][Oo])
			ipv6_network_interfaces="`ifconfig -l`"
d90 18
a107 9
	*)
		#
		# manual configurations - in case ip6_gateway_enable=NO
		# you can configure only single interface,
		# as specification assumes that
		# autoconfigured host has single interface only.
		#
		case ${ipv6_network_interfaces} in
		[Aa][Uu][Tt][Oo])
d134 7
d142 2
a143 18
		# setting up interfaces
		for i in $ipv6_network_interfaces; do
			eval prefix=\$ipv6_prefix_$i
			case ${prefix} in
			'')
				continue;
				;;
			esac
			for j in ${prefix}; do
				case ${prefixcmd_enable} in
				[Yy][Ee][Ss])
					prefix $i $j::
					;;
				*)
					laddr=`network6_getladdr $i`
					hostid=`expr "${laddr}" : \
						     'fe80::\(.*\)%\(.*\)'`
					address=$j\:${hostid}
d145 2
a146 2
					eval hostid_$i=${hostid}
					eval address_$i=${address}
d148 3
a150 16
					ifconfig $i inet6 ${address} \
						prefixlen 64 alias
					;;
				esac

				# subnet-router anycast address (rfc2373)
				ifconfig $i inet6 $j:: prefixlen 64 \
					alias anycast
			done

			ifconfig $i inet6
		done

		# again, wait for DAD's completion (for global addrs)
		sleep `sysctl -n net.inet6.ip6.dad_count`
		sleep 1
d152 2
d168 2
d171 2
a172 2
		# gifconfig
		network6_gif_setup
d174 3
a176 2
		# 6to4 setup
		network6_stf_setup
d178 2
a179 6
		# install the "default interface" to kernel, which will be used
		# as the default route when there's no router.
		network6_default_interface_setup

		# setup static routes
		network6_static_routes_setup
d181 2
d199 1
a199 1
		# security policy by -P option.
d210 14
a223 10
			for i in ${ipv6_network_interfaces}; do
				case $i in
				stf*)
					continue
					;;
				*)
					rtadvd_interfaces="${rtadvd_interfaces} ${i}"
					;;
				esac
			done
d228 1
a228 1
			# rtadvd -P "in ipsec ah/transport/fec0:0:0:1::1-fec0:0:0:10::1/require" \
d232 1
a232 1
			# rtadvd -P "in ipsec ah/transport/ff05::2-fec0:0:0:10::1/require" \
a246 32
	*)
		# act as endhost - automatically configured
		sysctl -w net.inet6.ip6.forwarding=0
		sysctl -w net.inet6.ip6.accept_rtadv=1

		case ${ipv6_network_interfaces} in
		lo0|gif*|stf*|faith*)
			;;
		*)
			ifconfig ${ipv6_network_interfaces} up
			rtsol ${ipv6_network_interfaces}
			;;
		esac

		# wait for DAD's completion (for global addrs)
		sleep `sysctl -n net.inet6.ip6.dad_count`
		sleep 1

		# gifconfig
		network6_gif_setup

		# 6to4 setup
		network6_stf_setup

		# install the "default interface" to kernel, which will be used
		# as the default route when there's no router.
		# ndp -I ${ipv6_default_interface}
		network6_default_interface_setup

		# setup static routes
		network6_static_routes_setup
		;;
d267 79
d413 8
d453 1
a455 1
		route add -inet6 fe80:: -prefixlen 10 ::1 -reject
d462 17
a478 1
		ndp -I ${ipv6_default_interface}
@


1.12
log
@Make default interface work.

Obtained from:	KAME
@
text
@d2 27
a28 1
# $FreeBSD: src/etc/rc.network6,v 1.11 2000/09/06 07:39:55 ume Exp $
@


1.11
log
@Avoid doing rtsol to psuedo interface.

PR:		bin/21062
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.10 2000/07/18 08:44:17 ume Exp $
d322 1
a322 1
	[Nn][Oo] | '')
d342 1
a342 1
		route add -inet6 ff02:: -prefixlen 16 ::1 -reject
d346 1
a346 3
		route add -inet6 fe80:: ${laddr} -prefixlen 10 -interface \
			-cloning
		route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface \
d348 1
@


1.10
log
@Fix an unmatched opening quote.

PR:		conf/20000
Submitted by:	Alex Kapranoff <alex@@kapran.bitmcnit.bryansk.su>
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.9 2000/07/09 20:12:50 ume Exp $
d193 8
a200 4
		ifconfig ${ipv6_network_interfaces} up
		rtsol ${ipv6_network_interfaces}


@


1.9
log
@- Remove use of programs in /usr like sed as possible.  In this
time, I have no idea if there is equivalence of printf.  So, stf
setup still depends on /usr.  In addition, prefix(8) and gifconfig(8)
are in /usr/sbin.  Should we move these into /sbin?

- Sync with latest stf behavior.  Latest stf doesn't have link-local
address.  And, latest stf is not gif but stf.
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.8 2000/04/06 00:24:52 shin Exp $
d77 1
a77 1
						     'fe80::\(.*\)%\(.*\)`
@


1.8
log
@Removed unnecessary comma in stf addr printf in hex format,
which I mysteriously added.

Submitted by: ume
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.7 2000/03/28 17:46:02 shin Exp $
d34 2
a35 2
			ipv6_network_interfaces="`ifconfig -l \
				| sed -e 's/ .*//'`"
d75 3
a77 6
					laddr=`ifconfig $i inet6 \
						| grep 'inet6 fe80:' \
						| head -1 | awk '{print $2}'`
					hostid=`echo ${laddr} | sed \
					    -e 's/fe80:[0-9a-fA-F]+::/fe80::/' \
					    -e 's/fe80:://' -e 's/%.*//'`
d103 1
a103 3
			laddr=`ifconfig $i inet6 2>/dev/null | \
				grep 'inet6 fe80:' | \
				head -1 | grep -v tentative`
d155 10
a164 2
			rtadvd_interfaces=`echo ${ipv6_network_interfaces} | \
				sed -e 's/ stf0//'`
a260 2
		# setup outer IPv4 addrs
		gifconfig stf0 ${stf_interface_ipv4addr} 255.255.255.255
d271 12
a282 5
			laddr=`ifconfig stf0 inet6 | grep 'inet6 fe80:' \
				| head -1 | awk '{print $2}'`
			stf_interface_ipv6_ifid=`echo ${laddr} | sed \
				-e 's/fe80:[0-9a-fA-F]+::/fe80::/' \
				-e 's/fe80:://' -e 's/%.*//'`
d293 4
a296 3
		route add -inet6 2002:7f00:0000:: -prefixlen 24 ::1 -reject
		route add -inet6 2002:0000:0000:: -prefixlen 48 ::1 -reject
		route add -inet6 2002:ffff:ffff:: -prefixlen 48 ::1 -reject
d320 1
a320 3
			laddr=`ifconfig $i inet6 2>/dev/null \
				| grep 'inet6 fe80:' | \
				head -1 | grep -v tentative`
d341 1
a341 2
		laddr=`ifconfig ${ipv6_default_interface} inet6 \
			| grep 'inet6 fe80:' | head -1 | awk '{print $2}'`
d348 23
@


1.7
log
@Avoid using sed and awk in configure script.

TODO: also replace other sed and awk usages.

Submitted by: wollman
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.6 2000/03/28 17:39:53 shin Exp $
d266 1
a266 1
		ipv4_in_hexformat=`printf "%x:%x\n", \
@


1.6
log
@Add a configuration options which enable/disable IPv4 mapped IPv6 addr
support.

Suggested and Reviewed by: ume
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.5 2000/03/12 20:35:52 shin Exp $
d262 6
a267 4
		ipv4_in_hexformat=`echo ${stf_interface_ipv4addr} | \
			sed -e s/"\."/" "/g | \
			awk '{$5 = $1*256 + $2; $6 = $3*256 + $4; \
			printf "%x:%x\n", $5, $6}'`
@


1.5
log
@IPv6 related configuration updates.
  - 6to4(stf) interface configuration.
  - Static route configuration.
  - Comment additions.
  - Replaced a still existed '@@' to '%' in IPv6 scoped addr format.
    (This became necessary as previous IPv6 scoped addr format change.)

Much thanks to ume, who helped me reviewing, testing, and finding problems
with these changes.

Approved by: jkh

Reviewed by: ume
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.4 2000/03/11 20:10:39 shin Exp $
d212 11
@


1.5.2.1
log
@MFC:
Avoid using sed and awk in configure script.
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.5 2000/03/12 20:35:52 shin Exp $
d251 4
a254 6
		OIFS="$IFS"
		IFS=".$IFS"
		set ${stf_interface_ipv4addr}
		IFS="$OIFS"
		ipv4_in_hexformat=`printf "%x:%x\n", \
			$(($1*256 + $2)) $(($3*256 + $4))`
@


1.5.2.2
log
@MFC:

emoved unnecessary comma in stf addr printf in hex format,
which I mysteriously added.

Submitted by: ume
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.1 2000/04/02 16:37:59 shin Exp $
d255 1
a255 1
		ipv4_in_hexformat=`printf "%x:%x\n" \
@


1.5.2.3
log
@MFC: Merge KAME 2000/07 code.
@
text
@d2 1
a2 1
# $FreeBSD$
d34 2
a35 2
			set `ifconfig -l`
			ipv6_network_interfaces="$1"
d75 6
a80 3
					laddr=`network6_getladdr $i`
					hostid=`expr "${laddr}" : \
						     'fe80::\(.*\)%\(.*\)`
d106 3
a108 1
			laddr=`network6_getladdr $i exclude_tentative`
d160 2
a161 10
			for i in ${ipv6_network_interfaces}; do
				case $i in
				stf*)
					continue
					;;
				*)
					rtadvd_interfaces="${rtadvd_interfaces} ${i}"
					;;
				esac
			done
d247 2
d259 5
a263 12
			for i in ${ipv6_network_interfaces}; do
				laddr=`network6_getladdr ${i}`
				case ${laddr} in
				'')
					;;
				*)
					break
					;;
				esac
			done
			stf_interface_ipv6_ifid=`expr "${laddr}" : \
						      'fe80::\(.*\)%\(.*\)'`
d274 3
a276 4
		route add -inet6 2002:e000:: -prefixlen 20 ::1 -reject
		route add -inet6 2002:7f00:: -prefixlen 24 ::1 -reject
		route add -inet6 2002:0000:: -prefixlen 24 ::1 -reject
		route add -inet6 2002:ff00:: -prefixlen 24 ::1 -reject
d300 3
a302 1
			laddr=`network6_getladdr $i exclude_tentative`
d323 2
a324 1
		laddr=`network6_getladdr ${ipv6_default_interface}`
a330 23
}

network6_getladdr() {
	ifconfig $1 2>/dev/null | while read proto addr rest; do
		case ${proto} in
		inet6)
			case ${addr} in
			fe80::*)
				if [ -z "$2" ]; then
					echo ${addr}
					return
				fi
				case ${rest} in
				*tentative*)
					continue
					;;
				*)
					echo ${addr}
					return
				esac
			esac
		esac
	done
@


1.5.2.4
log
@MFC: Fix an unmatched opening quote.

PR:		conf/20000
Submitted by:	Alex Kapranoff <alex@@kapran.bitmcnit.bryansk.su>
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.3 2000/07/15 07:49:29 kris Exp $
d77 1
a77 1
						     'fe80::\(.*\)%\(.*\)'`
@


1.5.2.5
log
@MFC: Add ipv6_ipv4mapping knob.
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.4 2000/07/18 08:47:37 ume Exp $
a214 11
		;;
	esac

	case ${ipv6_ipv4mapping} in
	[Yy][Ee][Ss])
		echo -n ' IPv4 mapped IPv6 address support=YES'
		sysctl -w net.inet6.ip6.mapped_addr=1 >/dev/null
		;;
	'' | *)
		echo -n ' IPv4 mapped IPv6 address support=NO'
		sysctl -w net.inet6.ip6.mapped_addr=0 >/dev/null
@


1.5.2.6
log
@MFC rev 1.10 -> 1.11: Avoid doing rtsol to psuedo interface.
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.5 2000/08/16 23:17:33 jhb Exp $
d193 4
a196 8
		case ${ipv6_network_interfaces} in
		lo0|gif*|stf*|faith*)
			;;
		*)
			ifconfig ${ipv6_network_interfaces} up
			rtsol ${ipv6_network_interfaces}
			;;
		esac
@


1.5.2.7
log
@MFC: Add copyright.
@
text
@d2 1
a2 27
#
# Copyright (c) 2000  The KAME Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD$
#
@


1.5.2.8
log
@MFC:
  - ipv6_prefix_* and ipv6_ifconfig_* work for end node
  - rtsol should be work for only one interface
  - new variable ipv6_defaultrouter is added
  - option name of rtadvd in comment are corrected
  - ipv6_firewall_enable, ipv6_firewall_type, ipv6_firewall_script,
    ipv6_firewall_logging are added to introduce rc.firewall6.

  IPv6 firewall rule is just starting point and should be brushed up.
  This commit includes PR18621, PR21694, PR22051.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.7 2000/10/30 10:40:11 obrien Exp $
d40 1
a40 9
	# Initialize IP filtering using ip6fw
	#
	if /sbin/ip6fw -q flush > /dev/null 2>&1; then
		ipv6_firewall_in_kernel=1
	else
		ipv6_firewall_in_kernel=0
	fi

	case ${ipv6_firewall_enable} in
d42 6
a47 37
		if [ "${ipv6_firewall_in_kernel}" -eq 0 ] && kldload ip6fw; then
			ipv6_firewall_in_kernel=1
			echo "Kernel IPv6 firewall module loaded."
		elif [ "${ipv6_firewall_in_kernel}" -eq 0 ]; then
			echo "Warning: IPv6 firewall kernel module failed to load."
		fi
		;;
	esac

	# Load the filters if required
	#
	case ${ipv6_firewall_in_kernel} in
	1)
		if [ -z "${ipv6_firewall_script}" ]; then
			ipv6_firewall_script=/etc/rc.firewall6
		fi

		case ${ipv6_firewall_enable} in
		[Yy][Ee][Ss])
			if [ -r "${ipv6_firewall_script}" ]; then
				. "${ipv6_firewall_script}"
				echo -n 'IPv6 Firewall rules loaded.'
			elif [ "`ip6fw l 65535`" = "65535 deny ipv6 from any to any" ]; then
				echo -n "Warning: kernel has IPv6 firewall functionality, "
				echo "but IPv6 firewall rules are not enabled."
				echo "		 All ipv6 services are disabled."
			fi

			case ${ipv6_firewall_logging} in
			[Yy][Ee][Ss] | '')
				echo 'IPv6 Firewall logging=YES'
				sysctl -w net.inet6.ip6.fw.verbose=1 >/dev/null
				;;
			*)
				;;
			esac

d51 9
a59 18
	esac

	case ${ipv6_network_interfaces} in
	[Aa][Uu][Tt][Oo])
		case ${ipv6_gateway_enable} in
		[Yy][Ee][Ss])
			#
			# list of interfaces, and prefix for interfaces
			#
			ipv6_network_interfaces="`ifconfig -l`"
			;;
		*)
			#
			# manual configurations - in case ip6_gateway_enable=NO
			# you can configure only single interface,
			# as specification assumes that
			# autoconfigured host has single interface only.
			#
a85 7
		;;
	*)
		# act as endhost - start with manual configuration
		sysctl -w net.inet6.ip6.forwarding=0
		sysctl -w net.inet6.ip6.accept_rtadv=0
		;;
	esac
d87 31
a117 2
	# gifconfig
	network6_gif_setup
d119 2
a120 2
	# setting up interfaces
	network6_interface_setup
d122 3
a124 3
	# wait for DAD's completion (for global addrs)
	sleep `sysctl -n net.inet6.ip6.dad_count`
	sleep 1
a125 2
	case ${ipv6_gateway_enable} in
	[Yy][Ee][Ss])
a139 2
		;;
	esac
d141 5
a145 2
	# 6to4 setup
	network6_stf_setup
d147 3
a149 3
	# install the "default interface" to kernel, which will be used
	# as the default route when there's no router.
	network6_default_interface_setup
d151 2
a152 2
	# setup static routes
	network6_static_routes_setup
a153 2
	case ${ipv6_gateway_enable} in
	[Yy][Ee][Ss])
d170 1
a170 1
		# security policy by -R option.
d181 10
a190 14
			case ${rtadvd_interfaces} in
			'')
				for i in ${ipv6_network_interfaces}; do
					case $i in
					stf*)
						continue
						;;
					*)
						rtadvd_interfaces="${rtadvd_interfaces} ${i}"
						;;
					esac
				done
				;;
			esac
d195 1
a195 1
			# rtadvd -R "in ipsec ah/transport/fec0:0:0:1::1-fec0:0:0:10::1/require" \
d199 1
a199 1
			# rtadvd -R "in ipsec ah/transport/ff05::2-fec0:0:0:10::1/require" \
d214 32
a265 79
network6_interface_setup() {
	rtsol_interfaces=''
	case ${ipv6_gateway_enable} in
	[Yy][Ee][Ss])
		rtsol_available=no
		;;
	*)
		rtsol_available=yes
		prefixcmd_enable=NO
		;;
	esac
	for i in $ipv6_network_interfaces; do
		rtsol_interface=yes
		eval prefix=\$ipv6_prefix_$i
		if [ -n "${prefix}" ]; then
			rtsol_available=no
			rtsol_interface=no
			for j in ${prefix}; do
				case ${prefixcmd_enable} in
				[Yy][Ee][Ss])
					prefix $i $j::
					;;
				*)
					laddr=`network6_getladdr $i`
					hostid=`expr "${laddr}" : \
						'fe80::\(.*\)%\(.*\)'`
					address=$j\:${hostid}

					eval hostid_$i=${hostid}
					eval address_$i=${address}

					ifconfig $i inet6 ${address} \
						prefixlen 64 alias
					;;
				esac

				case ${ipv6_gateway_enable} in
				[Yy][Ee][Ss])
					# subnet-router anycast address
					# (rfc2373)
					ifconfig $i inet6 $j:: prefixlen 64 \
						alias anycast
					;;
				esac
			done
		fi
		eval ipv6_ifconfig=\$ipv6_ifconfig_$i
		if [ -n "${ipv6_ifconfig}" ]; then
			rtsol_available=no
			rtsol_interface=no
			ifconfig $i inet6 ${ipv6_ifconfig} alias
		fi

		if [ ${rtsol_available} = yes -a ${rtsol_interface} = yes ]
		then
			case ${i} in
			lo0|gif*|stf*|faith*)
				;;
			*)
				rtsol_interfaces="${rtsol_interfaces} ${i}"
				;;
			esac
		else
			ifconfig $i inet6
		fi
	done

	if [ ${rtsol_available} = yes -a -n "${rtsol_interfaces}" ]; then
		# Act as endhost - automatically configured.
		# You can configure only single interface, as
		# specification assumes that autoconfigured host has
		# single interface only.
		sysctl -w net.inet6.ip6.accept_rtadv=1
		set ${rtsol_interfaces}
		ifconfig $1 up
		rtsol $1
	fi
}

a332 8
        case ${ipv6_defaultrouter} in
        [Nn][Oo] | '')
                ;;
        *)
                ipv6_static_routes="default ${ipv6_static_routes}"
                ipv6_route_default="default ${ipv6_defaultrouter}"
                ;;
        esac
d348 1
a348 1
	'')
a364 1
	route add -inet6 fe80:: -prefixlen 10 ::1 -reject
d367 2
a368 1
		route add -inet6 fec0:: -prefixlen 10 ::1 -reject
d372 3
a374 1
		route add -inet6 fec0:: ${laddr} -prefixlen 10 -interface \
a375 17

		# Disable installing the default interface with the
		# case net.inet6.ip6.forwarding=0 and
		# net.inet6.ip6.accept_rtadv=0, due to avoid conflict
		# between the default router list and the manual
		# configured default route.
		case ${ipv6_gateway_enable} in
		[Yy][Ee][Ss])
			ndp -I ${ipv6_default_interface}
			;;
		*)
			if [ `sysctl -n net.inet6.ip6.accept_rtadv` -eq 1 ]
			then
				ndp -I ${ipv6_default_interface}
			fi
			;;
		esac
@


1.5.2.9
log
@MFC 1.14->1.15: Don't install route for fec0::/10.
It was wrongly replaced from ff02::/16 by me.

Approved by:	jkh
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.8 2000/11/01 07:21:45 ume Exp $
d456 1
a456 1
		route add -inet6 ff02:: -prefixlen 16 ::1 -reject
d460 1
a460 1
		route add -inet6 ff02:: ${laddr} -prefixlen 16 -interface \
d470 1
@


1.5.2.10
log
@MFC 1.15->1.16
- Don't try to send RA to lo0, gifN and faithN.
- ipv6_network_interfaces has all available interfaces to work for
  static configuration even if the host is end host.  When rtsol is
  invoked, singleness of interface is checked.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.9 2000/11/15 07:47:51 ume Exp $
d94 18
a111 4
		#
		# list of interfaces, and prefix for interfaces
		#
		ipv6_network_interfaces="`ifconfig -l`"
d214 1
a214 1
					lo0|gif*|stf*|faith*)
@


1.5.2.11
log
@MFC: add copyright notices
@
text
@d27 1
a27 27
#
#
# Copyright (c) 2000  The KAME Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# $FreeBSD: src/etc/rc.network6,v 1.5.2.10 2001/02/18 15:21:32 ume Exp $
@


1.5.2.12
log
@I really did a number on adding the copyrights...
@
text
@d27 27
a53 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.11 2001/03/06 01:58:45 obrien Exp $
@


1.5.2.13
log
@MFC: Add `ipv6_ifconfig_IFN_aliasN' directive to allow multiple aliases.

	etc/defaults/rc.conf:	1.94 -> 1.95
	etc/rc.network6:	1.16 -> 1.17

Approved by:	jkh
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.12 2001/03/06 02:22:00 obrien Exp $
a304 9
		alias=0
		while : ; do
			eval ipv6_ifconfig=\$ipv6_ifconfig_${i}_alias${alias}
			if [ -z "${ipv6_ifconfig}" ]; then
				break;
			fi
			ifconfig $i inet6 ${ipv6_ifconfig} alias
			alias=$((${alias} + 1))
		done
@


1.5.2.14
log
@MFC: Enable static IPv6 address assignment on PCMCIA NIC.

	etc/pccard_ether:	1.23->1.24
	etc/rc.network6:	1.17->1.18
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.13 2001/03/19 09:33:59 ume Exp $
d132 1
a132 1
	network6_interface_setup $ipv6_network_interfaces
a253 1
	interfaces=$*
d264 1
a264 1
	for i in $interfaces; do
@


1.5.2.15
log
@MFC: Configure gif interfaces without requiring ipv6
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.14 2001/05/06 15:08:52 ume Exp $
d128 3
d340 20
@


1.5.2.16
log
@MFC: Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some
critical problem after the snap was out were fixed.
There are many many changes since last KAME merge.

	etc/defaults/rc.conf:			1.111
	etc/rc.network:				1.98
	etc/rc.network6:			1.20
	lib/libipsec/ipsec_set_policy.3:	1.8
	lib/libipsec/ipsec_strerror.3:		1.7
	lib/libipsec/ipsec_strerror.c:		1.3
	lib/libipsec/ipsec_strerror.h:		1.3
	lib/libipsec/libpfkey.h:		1.2
	lib/libipsec/pfkey.c:			1.3
	lib/libipsec/pfkey_dump.c:		1.3
	lib/libipsec/policy_token.l:		1.5
	lib/libipsec/test-policy.c:		1.4
	sbin/ifconfig/ifconfig.8:		1.42
	sbin/ifconfig/ifconfig.c:		1.63
	sbin/ping6/ping6.8:			1.10
	sbin/ping6/ping6.c:			1.9
	sbin/route/route.c:			1.48, 1.50
	sbin/rtsol/Makefile:			1.4
	share/doc/IPv6/IMPLEMENTATION:		1.3
	share/examples/IPv6/USAGE:		1.3
	share/man/man4/faith.4:			1.10
	share/man/man4/gif.4:			1.9
	share/man/man4/inet6.4:			1.8
	share/man/man4/ip6.4:			1.8
	share/man/man4/ipsec.4:			1.9
	share/man/man4/kame.4:			1.8
	share/man/man4/stf.4:			1.8
	sys/conf/files:				1.534
	sys/crypto/md5.c:			1.4
	sys/crypto/sha1.c:			1.7
	sys/crypto/blowfish/bf_enc.c:		1.4
	sys/crypto/blowfish/bf_locl.h:		1.4
	sys/crypto/blowfish/bf_skey.c:		1.4
	sys/crypto/blowfish/blowfish.h:		1.4
	sys/crypto/cast128/cast128.c:		1.4
	sys/crypto/cast128/cast128.h:		1.4
	sys/crypto/des/des.h:			1.4
	sys/crypto/des/des_ecb.c:		1.4
	sys/crypto/des/des_locl.h:		1.5
	sys/crypto/des/des_setkey.c:		1.4
	sys/crypto/rijndael/boxes-fst.dat:	1.2
	sys/crypto/rijndael/rijndael-alg-fst.c:	1.2, 1.3
	sys/crypto/rijndael/rijndael-alg-fst.h:	1.2
	sys/crypto/rijndael/rijndael-api-fst.c:	1.2
	sys/crypto/rijndael/rijndael-api-fst.h:	1.2
	sys/crypto/rijndael/rijndael_local.h:	1.3
	sys/kern/uipc_domain.c:			1.24
	sys/kern/uipc_mbuf.c:			1.82
	sys/kern/uipc_mbuf2.c:			1.8
	sys/net/if.c:				1.109
	sys/net/if_faith.c:			1.4, 1.5
	sys/net/if_gif.c:			1.10
	sys/net/if_gif.h:			1.4
	sys/net/if_loop.c:			1.61
	sys/net/if_sppp.h:			1.17
	sys/net/if_spppsubr.c:			1.68, 1.69
	sys/net/net_osdep.c:			1.4
	sys/net/net_osdep.h:			1.5
	sys/net/pfkeyv2.h:			1.6
	sys/net/ppp_defs.h:			1.7
	sys/net/rtsock.c:			1.52
	sys/netinet/icmp6.h:			1.4
	sys/netinet/in.c:			1.54
	sys/netinet/in_gif.c:			1.10
	sys/netinet/in_pcb.c:			1.84
	sys/netinet/in_pcb.h:			1.38
	sys/netinet/in_proto.c:			1.56
	sys/netinet/ip6.h:			1.5
	sys/netinet/ip_ecn.c:			1.4
	sys/netinet/ip_ecn.h:			1.4
	sys/netinet/ip_encap.c:			1.4
	sys/netinet/ip_icmp.c:			1.57
	sys/netinet/ip_input.c:			1.171
	sys/netinet/ip_output.c:		1.126
	sys/netinet/ip_var.h:			1.56
	sys/netinet/raw_ip.c:			1.78
	sys/netinet/tcp_input.c:		1.132
	sys/netinet/tcp_output.c:		1.50
	sys/netinet/tcp_subr.c:			1.103
	sys/netinet/tcp_usrreq.c:		1.60
	sys/netinet/udp_usrreq.c:		1.89
	sys/netinet6/ah.h:			1.5
	sys/netinet6/ah6.h:			1.4
	sys/netinet6/ah_core.c:			1.8
	sys/netinet6/ah_input.c:		1.7
	sys/netinet6/ah_output.c:		1.7
	sys/netinet6/dest6.c:			1.6
	sys/netinet6/esp.h:			1.4
	sys/netinet6/esp6.h:			1.4
	sys/netinet6/esp_core.c:		1.5
	sys/netinet6/esp_input.c:		1.7
	sys/netinet6/esp_output.c:		1.5
	sys/netinet6/frag6.c:			1.8
	sys/netinet6/icmp6.c:			1.11
	sys/netinet6/in6.c:			1.12
	sys/netinet6/in6.h:			1.13
	sys/netinet6/in6_cksum.c:		1.4
	sys/netinet6/in6_gif.c:			1.5
	sys/netinet6/in6_ifattach.c:		1.6
	sys/netinet6/in6_ifattach.h:		1.3
	sys/netinet6/in6_pcb.c:			1.15
	sys/netinet6/in6_pcb.h:			1.4
	sys/netinet6/in6_prefix.c:		1.7
	sys/netinet6/in6_prefix.h:		1.5
	sys/netinet6/in6_proto.c:		1.14
	sys/netinet6/in6_rmx.c:			1.4
	sys/netinet6/in6_src.c:			1.4
	sys/netinet6/in6_var.h:			1.8
	sys/netinet6/ip6_ecn.h:			1.4
	sys/netinet6/ip6_forward.c:		1.11
	sys/netinet6/ip6_fw.c:			1.11
	sys/netinet6/ip6_fw.h:			1.11
	sys/netinet6/ip6_input.c:		1.27
	sys/netinet6/ip6_mroute.c:		1.7
	sys/netinet6/ip6_mroute.h:		1.4
	sys/netinet6/ip6_output.c:		1.25
	sys/netinet6/ip6_var.h:			1.7
	sys/netinet6/ip6protosw.h:		1.6
	sys/netinet6/ipcomp.h:			1.2
	sys/netinet6/ipcomp6.h:			1.2
	sys/netinet6/ipcomp_core.c:		1.2
	sys/netinet6/ipcomp_input.c:		1.2
	sys/netinet6/ipcomp_output.c:		1.2
	sys/netinet6/ipsec.c:			1.12
	sys/netinet6/ipsec.h:			1.8
	sys/netinet6/ipsec6.h:			1.5
	sys/netinet6/mld6.c:			1.7
	sys/netinet6/nd6.c:			1.9
	sys/netinet6/nd6.h:			1.7
	sys/netinet6/nd6_nbr.c:			1.9
	sys/netinet6/nd6_rtr.c:			1.7, 1.8
	sys/netinet6/raw_ip6.c:			1.11
	sys/netinet6/route6.c:			1.4
	sys/netinet6/scope6.c:			1.2
	sys/netinet6/udp6_output.c:		1.3
	sys/netinet6/udp6_usrreq.c:		1.15
	sys/netkey/key.c:			1.25
	sys/netkey/key.h:			1.7
	sys/netkey/key_debug.c:			1.14
	sys/netkey/key_debug.h:			1.7
	sys/netkey/key_var.h:			1.4
	sys/netkey/keydb.h:			1.6
	sys/netkey/keysock.c:			1.6
	sys/netsmb/smb_crypt.c:			1.2
	sys/sys/mbuf.h:				1.79, 1.80
	sys/sys/protosw.h:			1.33
	sys/sys/socket.h:			1.54, 1.56
	sys/sys/sockio.h:			1.17
	usr.bin/netstat/inet.c:			1.42
	usr.bin/netstat/inet6.c:		1.10
	usr.bin/netstat/ipsec.c:		1.2
	usr.bin/netstat/main.c:			1.40
	usr.bin/netstat/mroute6.c:		1.5
	usr.bin/netstat/netstat.1:		1.29
	usr.bin/netstat/netstat.h:		1.21
	usr.bin/netstat/route.c:		1.50, 1.51, 1.55
	usr.sbin/faithd/Makefile:		1.6
	usr.sbin/faithd/README:			1.4
	usr.sbin/faithd/faithd.8:		1.9
	usr.sbin/faithd/faithd.c:		1.7
	usr.sbin/faithd/faithd.h:		1.3
	usr.sbin/faithd/ftp.c:			1.5
	usr.sbin/faithd/rsh.c:			1.5
	usr.sbin/faithd/tcp.c:			1.3
	usr.sbin/gifconfig/gifconfig.8:		1.6
	usr.sbin/gifconfig/gifconfig.c:		1.4
	usr.sbin/ifmcstat/ifmcstat.8:		1.3
	usr.sbin/ifmcstat/ifmcstat.c:		1.7
	usr.sbin/mld6query/mld6.c:		1.2
	usr.sbin/mld6query/mld6query.8:		1.2
	usr.sbin/ndp/ndp.8:			1.6
	usr.sbin/ndp/ndp.c:			1.6
	usr.sbin/prefix/Makefile:		1.4
	usr.sbin/rip6query/rip6query.8:		1.4
	usr.sbin/rip6query/rip6query.c:		1.5
	usr.sbin/route6d/route6d.8:		1.6
	usr.sbin/route6d/route6d.c:		1.9
	usr.sbin/route6d/route6d.h:		1.3
	usr.sbin/rrenumd/lexer.l:		1.3
	usr.sbin/rrenumd/parser.y:		1.3
	usr.sbin/rrenumd/rrenumd.8:		1.6
	usr.sbin/rrenumd/rrenumd.c:		1.4
	usr.sbin/rrenumd/rrenumd.conf.5:	1.10
	usr.sbin/rrenumd/rrenumd.h:		1.3
	usr.sbin/rtadvd/advcap.c:		1.4
	usr.sbin/rtadvd/advcap.h:		1.4
	usr.sbin/rtadvd/config.c:		1.7
	usr.sbin/rtadvd/config.h:		1.4
	usr.sbin/rtadvd/dump.c:			1.3
	usr.sbin/rtadvd/dump.h:			1.3
	usr.sbin/rtadvd/if.c:			1.6
	usr.sbin/rtadvd/if.h:			1.4
	usr.sbin/rtadvd/pathnames.h:		1.5
	usr.sbin/rtadvd/rrenum.c:		1.5
	usr.sbin/rtadvd/rrenum.h:		1.4
	usr.sbin/rtadvd/rtadvd.8:		1.8
	usr.sbin/rtadvd/rtadvd.c:		1.6
	usr.sbin/rtadvd/rtadvd.conf.5:		1.6
	usr.sbin/rtadvd/rtadvd.h:		1.4
	usr.sbin/rtadvd/timer.c:		1.4
	usr.sbin/rtadvd/timer.h:		1.4
	usr.sbin/rtsold/Makefile:		1.6
	usr.sbin/rtsold/dump.c:			1.4
	usr.sbin/rtsold/if.c:			1.5
	usr.sbin/rtsold/probe.c:		1.5
	usr.sbin/rtsold/rtsol.c:		1.4
	usr.sbin/rtsold/rtsold.8:		1.5
	usr.sbin/rtsold/rtsold.c:		1.4
	usr.sbin/rtsold/rtsold.h:		1.4
	usr.sbin/setkey/parse.y:		1.3
	usr.sbin/setkey/scriptdump.pl:		1.3
	usr.sbin/setkey/setkey.8:		1.14
	usr.sbin/setkey/setkey.c:		1.3
	usr.sbin/setkey/token.l:		1.5
	usr.sbin/traceroute6/traceroute6.8:	1.7
	usr.sbin/traceroute6/traceroute6.c:	1.8
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.15 2001/06/23 23:33:14 brian Exp $
d235 1
a235 1
		sysctl -w net.inet6.ip6.v6only=0 >/dev/null
d239 1
a239 1
		sysctl -w net.inet6.ip6.v6only=1 >/dev/null
d259 1
a267 2
			laddr=`network6_getladdr $i`
			hostid=`expr "${laddr}" : 'fe80::\(.*\)%\(.*\)'`
d269 17
a285 2
				address=$j\:${hostid}
				ifconfig $i inet6 ${address} prefixlen 64 alias
@


1.5.2.17
log
@MFC: Add configuration for a FAITH IPv6-to-IPv4 TCP translator.
To use a FAITH actually, you also need faithd(8) setup.
Please consult faithd(8) manpage.

	etc/rc.network6:	1.21
	etc/defaults/rc.conf:	1.113
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.16 2001/07/03 11:01:12 ume Exp $
a163 3
	# setup faith
	network6_faith_setup

a386 26
		done
		;;
	esac
}

network6_faith_setup() {
	case ${ipv6_faith_prefix} in
	[Nn][Oo] | '')
		;;
	*)
		sysctl -w net.inet6.ip6.keepfaith=1
		ifconfig faith0 up
		for prefix in ${ipv6_faith_prefix}; do
			prefixlen=`expr "${prefix}" : ".*/\(.*\)"`
			case ${prefixlen} in
			'')
				prefixlen=96
				;;
			*)
				prefix=`expr "${prefix}" : \
					     "\(.*\)/${prefixlen}"`
				;;
			esac
			route add -inet6 ${prefix} -prefixlen ${prefixlen} ::1
			route change -inet6 ${prefix} -prefixlen ${prefixlen} \
				-ifp faith0
@


1.5.2.18
log
@MFC 1.22, 1.23:
- Avoid to select an interface which is not good for RA/RS.
- Avoid to select lo0 or faith for a default interface.
- Do more strict checking for an interface.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.17 2001/07/10 10:10:04 ume Exp $
d200 1
a200 1
					lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*)
d305 1
a305 1
			lo0|gif[0-9]*|stf[0-9]*|faith[0-9]*|lp[0-9]*|sl[0-9]*|tun[0-9]*)
a425 5
			case $i in
			lo0|faith[0-9]*)
				continue
				;;
			esac
@


1.5.2.19
log
@MFC 1.25: The rtsol must be done before the alias processing.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.18 2001/07/27 20:37:53 ume Exp $
d292 9
a325 12

	for i in $interfaces; do
		alias=0
		while : ; do
			eval ipv6_ifconfig=\$ipv6_ifconfig_${i}_alias${alias}
			if [ -z "${ipv6_ifconfig}" ]; then
				break;
			fi
			ifconfig $i inet6 ${ipv6_ifconfig} alias
			alias=$((${alias} + 1))
		done
	done
@


1.5.2.20
log
@MFC 1.28 (partly): automatic creation of faith0 for backward compatibility.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.19 2001/11/27 19:38:05 ume Exp $
a403 1
		ifconfig faith0 create >/dev/null 2>&1
@


1.5.2.21
log
@MFC: s/sysctl -w/sysctl/
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.20 2001/12/17 13:51:43 ume Exp $
d81 1
a81 1
				sysctl net.inet6.ip6.fw.verbose=1 >/dev/null
d111 2
a112 2
		sysctl net.inet6.ip6.forwarding=1
		sysctl net.inet6.ip6.accept_rtadv=0
d123 2
a124 2
		sysctl net.inet6.ip6.forwarding=0
		sysctl net.inet6.ip6.accept_rtadv=0
d238 1
a238 1
		sysctl net.inet6.ip6.v6only=0 >/dev/null
d242 1
a242 1
		sysctl net.inet6.ip6.v6only=1 >/dev/null
d312 1
a312 1
		sysctl net.inet6.ip6.accept_rtadv=1
d403 1
a403 1
		sysctl net.inet6.ip6.keepfaith=1
@


1.5.2.22
log
@MFC 1.29: Now, you can specify "" or "NONE" for ipv6_network_interfaces
to prevent the interfaces from being initialized by /etc/rc.network6
wrongly.  So, you can explicitly initialize the interfaces by
/etc/pccard_ether.
With previous rc.network6, if you specify pccardd_flags="-z",
net.inet6.ip6.accept_rtadv was wrongly set to 0, then RA was not
accepted.
@
text
@d27 1
a27 1
# $FreeBSD: src/etc/rc.network6,v 1.5.2.21 2001/12/19 17:52:17 ru Exp $
a98 3
	[Nn][Oo][Nn][Ee])
		ipv6_network_interfaces=''
		;;
a122 2
		# Setup of net.inet6.ip6.accept_rtadv is done later by
		# network6_interface_setup.
d124 1
d128 2
a129 3
	if [ -n "${ipv6_network_interfaces}" ]; then
		# setting up interfaces
		network6_interface_setup $ipv6_network_interfaces
d131 3
a133 4
		# wait for DAD's completion (for global addrs)
		sleep `sysctl -n net.inet6.ip6.dad_count`
		sleep 1
	fi
@


1.4
log
@Prevent multicast packets from being sent over stf0 interface,
to avoid error messages printed on /var/log/messages.

  Recently added "stf" interface has IFF_MULTICAST bit set,
  because IPv6 don't work on non IFF_MULTICAST set interfaces
  in current implementation.
  But "stf" interface is multi-dest IPv6 over IPv4 tunnel, so
  can't treat multicast packet with no special configuration.

  On the other hand, tools like "rtadvd", "pim6dd", "pim6sd"
  send messages on IFF_MULTICAST set interfaces by default.
  So there will be many bogus error message on /var/log/messages,
  that multicast packets sent to "stf0" failed.

  So,

   -strip "stf0" from rtadvd sending interfaces in rc.network6
    ("rtadvd" is a daemon used only for local subnet, so it
     will never need to send its packets over "stf0" interfaces.)

   -Add default configuration files for "pim6dd" and "pim6sd",
    and disable "stf0" in those files.

Approved by: jkh
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.3 2000/02/24 18:52:58 shin Exp $
d80 1
a80 1
					    -e 's/fe80:://' -e 's/@@.*//'`
d123 3
d130 3
d202 3
d209 3
d242 51
d296 1
a296 1
	'')
d316 1
a316 1
	'')
@


1.3
log
@-Remove IPv6 initialization failed interfaces from the list of
 interfaces passed to rtadvd
-Comment out example sentences more completely
-Redirect error message of ifconfig output into /dev/null, to correctly
 find out working IPv6 interfaces

Approved by: jkh
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.2 2000/02/24 06:51:03 shin Exp $
d154 3
a156 1
			rtadvd ${ipv6_network_interfaces}
@


1.2
log
@-Removed unnecessary use of awk.
-small comment fix.

Approved by: jkh

Submitted by:  Chris Costello <chris@@calldei.com>
@
text
@d2 1
a2 1
# $FreeBSD: src/etc/rc.network6,v 1.1 2000/02/23 18:05:57 shin Exp $
d103 17
d159 1
a159 1
				${ipv6_network_interfaces}
d163 1
a163 1
				${ipv6_network_interfaces}
d233 2
a234 1
			laddr=`ifconfig $i inet6 | grep 'inet6 fe80:' | \
@


1.1
log
@Add IPv6 configuration scripts.

Initial version created by, and kindly much tested by:
	bmah@@CA.Sandia.GOV (Bruce A. Mah)

Approved by: jkh

Reviewed by: bmah@@CA.Sandia.GOV (Bruce A. Mah),
	Ollivier Robert <roberto@@keltia.freenix.fr>
Obtained from: KAME project
@
text
@d2 1
a2 1
# $FreeBSD$
d4 2
a5 2
# Note that almost all of the user-configurable behavior is no longer in
# this file, but rather in /etc/defaults/rc.conf.  Please check that file
d58 1
a58 1
		sleep `sysctl net.inet6.ip6.dad_count | awk '{print $NF}'`
d100 1
a100 1
		sleep `sysctl net.inet6.ip6.dad_count | awk '{print $NF}'`
d171 1
a171 1
		sleep `sysctl net.inet6.ip6.dad_count | awk '{print $NF}'`
@

