aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifup-ipv6')
-rwxr-xr-xsysconfig/network-scripts/ifup-ipv632
1 files changed, 21 insertions, 11 deletions
diff --git a/sysconfig/network-scripts/ifup-ipv6 b/sysconfig/network-scripts/ifup-ipv6
index 6ff924b0..8762129f 100755
--- a/sysconfig/network-scripts/ifup-ipv6
+++ b/sysconfig/network-scripts/ifup-ipv6
@@ -4,17 +4,17 @@
#
#
# Taken from:
-# (P) & (C) 2000-2004 by Peter Bieringer <pb@bieringer.de>
+# (P) & (C) 2000-2005 by Peter Bieringer <pb@bieringer.de>
#
# You will find more information on the initscripts-ipv6 homepage at
# http://www.deepspace6.net/projects/initscripts-ipv6.html
#
# RHL integration assistance by Pekka Savola <pekkas@netcore.fi>
#
-# Version 2004-03-21
+# Version 2005-09-22
#
# Note: if called (like normally) by /etc/sysconfig/network-scripts/ifup
-# exit codes aren't handled by "ifup"
+# exit codes aren't handled by "ifup"
#
# Uses following information from "/etc/sysconfig/network":
# NETWORKING_IPV6=yes|no: controls IPv6 initialization (global setting)
@@ -31,14 +31,16 @@
# IPV6FORWARDING=yes: IPV6_AUTOCONF=no, IPV6_ROUTER=yes
# IPV6FORWARDING=no: IPV6_AUTOCONF=yes
# IPV6_MTU=<MTU for IPv6>: controls IPv6 MTU for this link (optional)
+# IPV6_PRIVACY="rfc3041": control IPv6 privacy (optional)
+# This script only supports "rfc3041" (if kernel supports it)
#
# Optional for 6to4 tunneling (hardwired name of tunnel device is "tun6to4"):
# IPV6TO4INIT=yes|no: controls 6to4 tunneling setup
# IPV6TO4_RELAY=<IPv4 address>: IPv4 address of the remote 6to4 relay (default: 192.88.99.1)
# IPV6TO4_MTU=<MTU for IPv6>: controls IPv6 MTU for the 6to4 link (optional, default is MTU of interface - 20)
# IPV6TO4_IPV4ADDR=<IPv4 address>: overwrite local IPv4 address (optional)
-# IPV6TO4_ROUTING="<device>-<suffix>/<prefix length> ...": information to setup local subnetting
-# Example: IPV6TO4_ROUTING="eth0-:f101::0/64 eth1-:f102::0/64"
+# IPV6TO4_ROUTING="<device>-<suffix>/<prefix length> ...": information to setup additional interfaces
+# Example: IPV6TO4_ROUTING="eth0-:f101::1/64 eth1-:f102::1/64"
#
# Optional for 6to4 tunneling to trigger radvd:
# IPV6_CONTROL_RADVD=yes|no: controls radvd triggering (optional)
@@ -48,18 +50,18 @@
# Required version of radvd to use 6to4 prefix recalculation
# 0.6.2p3 or newer supporting option "Base6to4Interface"
# Required version of radvd to use dynamic ppp links
-# 0.7.0 + fixes or newer
+# 0.7.0 + fixes or newer
#
-. /etc/sysconfig/network
+. /etc/sysconfig/network
cd /etc/sysconfig/network-scripts
-. network-functions
+. network-functions
CONFIG=$1
[ -f "$CONFIG" ] || CONFIG=ifcfg-$CONFIG
-source_config
+source_config
# IPv6 don't need aliases anymore, config is skipped
REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'`
@@ -83,7 +85,7 @@ ipv6_test_device_status $DEVICE
if [ $? != 0 -a $? != 11 ]; then
# device doesn't exist or other problem occurs
exit 1
-fi
+fi
# Setup IPv6 address on specified interface
if ! [ -z "$IPV6ADDR" ]; then
@@ -142,6 +144,14 @@ if [ -n "$IPV6ADDR_SECONDARIES" ]; then
done
fi
+# Enable IPv6 RFC3041 privacy extensions if desired
+if [ "$IPV6_PRIVACY" = "rfc3041" ]; then
+ ipv6_exec_sysctl -w net.ipv6.conf.$DEVICE.use_tempaddr=2 >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo $"Cannot enable IPv6 privacy method '$IPV6_PRIVACY', not supported by kernel"
+ fi
+fi
+
# Setup default IPv6 route, check are done by function
if [ -n "$IPV6_DEFAULTDEV" -o -n "$IPV6_DEFAULTGW" ]; then
ipv6_set_default_route "$IPV6_DEFAULTGW" "$IPV6_DEFAULTDEV" "$DEVICE"
@@ -284,7 +294,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
for devsuf in $IPV6TO4_ROUTING; do
dev="`echo $devsuf | awk -F- '{ print $1 }'`"
suf="`echo $devsuf | awk -F- '{ print $2 }'`"
- ipv6_add_route ${ipv6to4prefix}$suf :: $dev
+ ipv6_add_addr_on_device ${dev} ${ipv6to4prefix}${suf}
done
else
echo $"Error occurred while calculating the IPv6to4 prefix"