aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2011-12-03 22:16:36 +0000
committerHiroki Sato <hrs@FreeBSD.org>2011-12-03 22:16:36 +0000
commited097b53745a02b8483bd66d9331b5563604d331 (patch)
treec2e40e9aa791a608baeeb384991143225c868613
parent6143f086112c40e10649149b3bf556b796774d55 (diff)
Notes
-rw-r--r--etc/network.subr19
-rw-r--r--share/man/man5/rc.conf.543
2 files changed, 47 insertions, 15 deletions
diff --git a/etc/network.subr b/etc/network.subr
index d595b79440116..c1faf59bfa3cf 100644
--- a/etc/network.subr
+++ b/etc/network.subr
@@ -532,7 +532,7 @@ ipv4_up()
# Add 127.0.0.1/8 to lo0 unless otherwise specified.
if [ "${_if}" = "lo0" ]; then
- ifconfig_args=`ifconfig_getargs ${_if}`
+ ifconfig_args=`get_if_var ${_if} ifconfig_IF`
if [ -z "${ifconfig_args}" ]; then
ifconfig ${_if} inet 127.0.0.1/8 alias
fi
@@ -556,7 +556,7 @@ ipv6_up()
fi
ifalias_up ${_if} inet6 && _ret=0
- ipv6_prefix_hostid_addr_up ${_if} && _ret=0
+ ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0
ipv6_accept_rtadv_up ${_if} && _ret=0
# wait for DAD
@@ -612,6 +612,7 @@ ipv6_down()
fi
ipv6_accept_rtadv_down ${_if} && _ret=0
+ ipv6_prefix_hostid_addr_common ${_if} -alias && _ret=0
ifalias_down ${_if} inet6 && _ret=0
inetList="`ifconfig ${_if} | grep 'inet6 ' | tr "\n" "$_ifs"`"
@@ -859,12 +860,14 @@ ifalias_ipv6_down()
return $_ret
}
-# ipv6_prefix_hostid_addr_up if
-# add IPv6 prefix + hostid addr to the interface $if
-ipv6_prefix_hostid_addr_up()
+# ipv6_prefix_hostid_addr_common if action
+# Add or remove IPv6 prefix + hostid addr on the interface $if
+#
+ipv6_prefix_hostid_addr_common()
{
- local _if prefix laddr hostid j address
+ local _if _action prefix laddr hostid j address
_if=$1
+ _action=$2
prefix=`get_if_var ${_if} ipv6_prefix_IF`
if [ -n "${prefix}" ]; then
@@ -874,13 +877,13 @@ ipv6_prefix_hostid_addr_up()
for j in ${prefix}; do
address=$j\:${hostid}
- ifconfig ${_if} inet6 ${address} prefixlen 64 alias
+ ifconfig ${_if} inet6 ${address} prefixlen 64 ${_action}
# if I am a router, add subnet router
# anycast address (RFC 2373).
if checkyesno ipv6_gateway_enable; then
ifconfig ${_if} inet6 $j:: prefixlen 64 \
- alias anycast
+ ${_action} anycast
fi
done
fi
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index a936bb4b9df31..e4a058ae3947c 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -1423,6 +1423,11 @@ IPv6 functionality on an interface should be configured by
.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6 ,
instead of setting ifconfig parameters in
.Va ifconfig_ Ns Aq Ar interface .
+If this variable is empty, all of IPv6 configurations on the
+specified interface by other variables such as
+.Va ipv6_prefix_ Ns Ao Ar interface Ac
+will be ignored.
+.Pp
Aliases should be set by
.Va ifconfig_ Ns Ao Ar interface Ac Ns Va _alias Ns Aq Ar n
with
@@ -1433,6 +1438,17 @@ ifconfig_ed0_ipv6="inet6 2001:db8:1::1 prefixlen 64"
ifconfig_ed0_alias0="inet6 2001:db8:2::1 prefixlen 64"
.Ed
.Pp
+Interfaces that have an
+.Dq Li inet6 accept_rtadv
+keyword in
+.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6
+setting will be automatically configured by SLAAC
+.Pq StateLess Address AutoConfiguration
+described in
+.Rs
+.%T "RFC 4862"
+.Re
+.Pp
Note that a link-local address will be automatically configured in
addition to the configured global-scope addresses because the IPv6
specifications require it on each link.
@@ -1457,19 +1473,32 @@ For example:
.Bd -literal
ifconfig_ed0_ipv6="inet6 fe80::1 prefixlen 64"
.Ed
-.Pp
-Interfaces that have an
-.Dq Li inet6 accept_rtadv
-keyword in
-.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6
-setting will be automatically configured by
-.Xr rtsol 8 .
.It Va ipv6_prefix_ Ns Aq Ar interface
.Pq Vt str
If one or more prefixes are defined in
.Va ipv6_prefix_ Ns Aq Ar interface
addresses based on each prefix and the EUI-64 interface index will be
configured on that interface.
+Note that this variable will be ignored when
+.Va ifconfig_ Ns Ao Ar interface Ac Ns _ipv6
+is empty.
+.Pp
+For example, the following configuration
+.Bd -literal
+ipv6_prefix_ed0="2001:db8:1:0 2001:db8:2:0"
+.Ed
+.Pp
+is equivalent to the following:
+.Bd -literal
+ifconfig_ed0_alias0="inet6 2001:db8:1:: eui64 prefixlen 64"
+ifconfig_ed0_alias1="inet6 2001:db8:1:: prefixlen 64 anycast"
+ifconfig_ed0_alias2="inet6 2001:db8:2:: eui64 prefixlen 64"
+ifconfig_ed0_alias3="inet6 2001:db8:2:: prefixlen 64 anycast"
+.Ed
+.Pp
+These Subnet-Router anycast addresses will be added only when
+.Va ipv6_gateway_enable
+is YES.
.It Va ipv6_default_interface
.Pq Vt str
If not set to