diff options
author | Miloslav Trmac <mitr@volny.cz> | 2006-05-14 01:34:30 +0000 |
---|---|---|
committer | Miloslav Trmac <mitr@volny.cz> | 2006-05-14 01:34:30 +0000 |
commit | 599631bda00f650cdfc6e3f39d112efc0bb7c6bf (patch) | |
tree | f2139af6236f9fc2027276b8cf3994f0d9cb8aff /sysconfig/network-scripts/ifup-ipv6 | |
parent | 906238c891d3f02b4c706457783694e3a01d91ce (diff) | |
download | initscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.tar initscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.tar.gz initscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.tar.bz2 initscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.tar.xz initscripts-599631bda00f650cdfc6e3f39d112efc0bb7c6bf.zip |
Modify IPV6TO4_ROUTING to also add addresses on the interfaces
Add RFC 3041 (IPv6 privacy) support
(patch for both by Peter Bieringer <pb@bieringer.de>)
Diffstat (limited to 'sysconfig/network-scripts/ifup-ipv6')
-rwxr-xr-x | sysconfig/network-scripts/ifup-ipv6 | 32 |
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" |