diff options
author | Bill Nottingham <notting@redhat.com> | 2002-11-12 04:15:58 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2002-11-12 04:15:58 +0000 |
commit | 67428c04a5f7ad98287a4254ad581767d73d7131 (patch) | |
tree | dd62d4958e002ee903aebf6d3cd6c55c022aed4c /sysconfig/network-scripts | |
parent | 0d272a1007cc37b0c271ef66e7be83de65bb11c4 (diff) | |
download | initscripts-67428c04a5f7ad98287a4254ad581767d73d7131.tar initscripts-67428c04a5f7ad98287a4254ad581767d73d7131.tar.gz initscripts-67428c04a5f7ad98287a4254ad581767d73d7131.tar.bz2 initscripts-67428c04a5f7ad98287a4254ad581767d73d7131.tar.xz initscripts-67428c04a5f7ad98287a4254ad581767d73d7131.zip |
IPv6 update <pekkas@netcore.fi>, <pb@bieringer.de>
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-x | sysconfig/network-scripts/ifdown-ipv6 | 8 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifdown-sit | 10 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-ipv6 | 48 | ||||
-rwxr-xr-x | sysconfig/network-scripts/ifup-sit | 8 | ||||
-rwxr-xr-x | sysconfig/network-scripts/init.ipv6-global | 4 | ||||
-rw-r--r-- | sysconfig/network-scripts/network-functions-ipv6 | 65 |
6 files changed, 66 insertions, 77 deletions
diff --git a/sysconfig/network-scripts/ifdown-ipv6 b/sysconfig/network-scripts/ifdown-ipv6 index f40d6b21..375ee78e 100755 --- a/sysconfig/network-scripts/ifdown-ipv6 +++ b/sysconfig/network-scripts/ifdown-ipv6 @@ -11,7 +11,7 @@ # # RHL integration assistance by Pekka Savola <pekkas@netcore.fi> # -# Version 2002-04-12 +# Version 2002-10-30 # # Note: if called as (like normally) by /etc/sysconfig/network-scripts/ifdown # exit codes aren't handled by "ifdown" @@ -56,8 +56,6 @@ REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'` [ "${NETWORKING_IPV6}" = "yes" ] || exit 0 [ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1 - -# Source IPv6 helper functions . /etc/sysconfig/network-scripts/network-functions-ipv6 @@ -83,7 +81,7 @@ if [ -z "$IPV6TO4_RELAY" ]; then fi # Get IPv4 address from interface -if [ ! -z "$IPV6TO4_IPV4ADDR" ]; then +if [ -n "$IPV6TO4_IPV4ADDR" ]; then # Take special configured from config file (precedence 1) ipv4addr="$IPV6TO4_IPV4ADDR" else @@ -111,7 +109,7 @@ fi # Shutdown of 6to4, if configured if [ "$valid6to4config" = "yes" ]; then - if [ ! -z "$IPV6TO4_ROUTING" ]; then + if [ -n "$IPV6TO4_ROUTING" ]; then # Delete routes to local networks for devsuf in $IPV6TO4_ROUTING; do dev="`echo $devsuf | awk -F- '{ print $1 }'`" diff --git a/sysconfig/network-scripts/ifdown-sit b/sysconfig/network-scripts/ifdown-sit index 521217ce..2059f96a 100755 --- a/sysconfig/network-scripts/ifdown-sit +++ b/sysconfig/network-scripts/ifdown-sit @@ -11,7 +11,7 @@ # # RHL integration assistance by Pekka Savola <pekkas@netcore.fi> # -# Version 2002-01-25 +# Version 2002-11-01 # # Uses following information from /etc/sysconfig/network: # NETWORKING_IPV6=yes|no: controls IPv6 initialization (global setting) @@ -21,10 +21,8 @@ # -# Get global network configuration . /etc/sysconfig/network -# Source IPv4 helper functions cd /etc/sysconfig/network-scripts . network-functions @@ -39,11 +37,7 @@ REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'` # Test whether IPv6 should be configured, else stop [ "$NETWORKING_IPV6" = "yes" ] || exit 0 -if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then - exit 1 -fi - -# Source IPv6 helper functions +[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1 . /etc/sysconfig/network-scripts/network-functions-ipv6 diff --git a/sysconfig/network-scripts/ifup-ipv6 b/sysconfig/network-scripts/ifup-ipv6 index ff45d683..e8960553 100755 --- a/sysconfig/network-scripts/ifup-ipv6 +++ b/sysconfig/network-scripts/ifup-ipv6 @@ -11,13 +11,15 @@ # # RHL integration assistance by Pekka Savola <pekkas@netcore.fi> # -# Version 2002-01-25 +# Version 2002-11-02 # # Note: if called (like normally) by /etc/sysconfig/network-scripts/ifup # exit codes aren't handled by "ifup" # # Uses following information from "/etc/sysconfig/network": # NETWORKING_IPV6=yes|no: controls IPv6 initialization (global setting) +# IPV6_DEFAULTDEV=<device>: controls default route (optional) +# IPV6_DEFAULTGW=<address>: controls default route (optional) # # Uses following information from "/etc/sysconfig/network-scripts/ifcfg-$1": # IPV6INIT=yes|no: controls IPv6 configuration for this interface @@ -28,19 +30,19 @@ # defaults: # 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_MTU=<MTU for IPv6>: controls IPv6 MTU for this link (optional) # # 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_IPV4ADDR=<IPv4 address>: overwrite local IPv4 address [optional] +# IPV6TO4_RELAY=<IPv4 address>: IPv4 address of the remote 6to4 relay (default: 192.88.99.1) +# 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" # # Optional for 6to4 tunneling to trigger radvd: -# IPV6_CONTROL_RADVD=yes|no: controls radvd triggering [optional] -# IPV6_RADVD_PIDFILE=<file>: PID file of radvd for sending signals, default is "/var/run/radvd/radvd.pid" [optional] -# IPV6_RADVD_TRIGGER_ACTION=startstop|reload|restart|SIGHUP: how to trigger radvd [optional, default is SIGHUP] +# IPV6_CONTROL_RADVD=yes|no: controls radvd triggering (optional) +# IPV6_RADVD_PIDFILE=<file>: PID file of radvd for sending signals, default is "/var/run/radvd/radvd.pid" (optional) +# IPV6_RADVD_TRIGGER_ACTION=startstop|reload|restart|SIGHUP: how to trigger radvd (optional, default is SIGHUP) # # Required version of radvd to use 6to4 prefix recalculation # 0.6.2p3 or newer supporting option "Base6to4Interface" @@ -49,10 +51,8 @@ # -# Get global network configuration . /etc/sysconfig/network -# Source IPv4 helper functions cd /etc/sysconfig/network-scripts . network-functions @@ -70,11 +70,7 @@ REALDEVICE=`echo ${DEVICE} | sed 's/:.*//g'` # Test whether IPv6 should be configured, else stop [ "${NETWORKING_IPV6}" = "yes" ] || exit 0 -if [ ! -f /etc/sysconfig/network-scripts/network-functions-ipv6 ]; then - exit 1 -fi - -# Source IPv6 helper functions +[ -f /etc/sysconfig/network-scripts/network-functions-ipv6 ] || exit 1 . /etc/sysconfig/network-scripts/network-functions-ipv6 @@ -134,19 +130,19 @@ ipv6_exec_sysctl -w net.ipv6.conf.$DEVICE.accept_ra=$ipv6_local_auto >/dev/null ipv6_exec_sysctl -w net.ipv6.conf.$DEVICE.accept_redirects=$ipv6_local_auto >/dev/null # Set IPv6 MTU, if given -if [ ! -z "$IPV6_MTU" ]; then +if [ -n "$IPV6_MTU" ]; then ipv6_set_mtu $DEVICE $IPV6_MTU fi # Setup additional IPv6 addresses from list, if given -if [ ! -z "$IPV6ADDR_SECONDARIES" ]; then +if [ -n "$IPV6ADDR_SECONDARIES" ]; then for ipv6addr in $IPV6ADDR_SECONDARIES; do ipv6_add_addr_on_device $DEVICE $ipv6addr done fi # Setup default IPv6 route, check are done by function -if [ ! -z "$IPV6_DEFAULTDEV" -o ! -z "$IPV6_DEFAULTGW" ]; then +if [ -n "$IPV6_DEFAULTDEV" -o -n "$IPV6_DEFAULTGW" ]; then ipv6_set_default_route "$IPV6_DEFAULTGW" "$IPV6_DEFAULTDEV" "$DEVICE" fi @@ -170,7 +166,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then fi # Get IPv4 address for local 6to4 prefix calculation - if [ ! -z "$IPV6TO4_IPV4ADDR" ]; then + if [ -n "$IPV6TO4_IPV4ADDR" ]; then # Take special configured from config file (precedence 1) ipv4addr="$IPV6TO4_IPV4ADDR" else @@ -181,9 +177,9 @@ if [ "$IPV6TO4INIT" = "yes" ]; then ipv4addr="$IPADDR" fi fi - if [ ! -z "$ipv4addr" ]; then + if [ -n "$ipv4addr" ]; then if ! ipv6_test_ipv4_addr_global_usable $ipv4addr; then - echo $"Given IPv4 address '$ipv4addr' is not globally usable, 6to4 configuration is not valid" + echo $"Given IPv4 address '$ipv4addr' is not globally usable" valid6to4config="no" fi if [ -z "$IPV6TO4_RELAY" ]; then @@ -196,7 +192,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then valid6to4config="no" fi else - echo $"IPv6to4 configuration needs an IPv4 address on related interface or otherwise specified, 6to4 configuration is not valid" + echo $"IPv6to4 configuration needs an IPv4 address on related interface or otherwise specified" valid6to4config="no" fi @@ -206,9 +202,9 @@ if [ "$IPV6TO4INIT" = "yes" ]; then # Add default route, if device matches if [ "$IPV6_DEFAULTDEV" = "tun6to4" ]; then - if [ ! -z "$IPV6_DEFAULTGW" ]; then - echo $"Warning: interface 'tun6to4' does not support 'IPV6_DEFAULTGW', ignored" - fi + if [ -n "$IPV6_DEFAULTGW" ]; then + echo $"Warning: interface 'tun6to4' does not support 'IPV6_DEFAULTGW', ignored" + fi ipv6_set_default_route $ipv6to4_relay tun6to4 fi @@ -235,9 +231,9 @@ if [ "$IPV6TO4INIT" = "yes" ]; then echo $"Using 6to4 and RADVD IPv6 forwarding usually should be enabled, but it isn't" fi - if [ ! -z "$IPV6TO4_ROUTING" ]; then + if [ -n "$IPV6TO4_ROUTING" ]; then ipv6to4prefix="`ipv6_create_6to4_prefix $ipv4addr`" - if [ ! -z "$ipv6to4prefix" ]; then + if [ -n "$ipv6to4prefix" ]; then # Add route to local networks for devsuf in $IPV6TO4_ROUTING; do dev="`echo $devsuf | awk -F- '{ print $1 }'`" diff --git a/sysconfig/network-scripts/ifup-sit b/sysconfig/network-scripts/ifup-sit index b26432c2..ada8b086 100755 --- a/sysconfig/network-scripts/ifup-sit +++ b/sysconfig/network-scripts/ifup-sit @@ -8,15 +8,17 @@ # # RHL integration assistance by Pekka Savola <pekkas@netcore.fi> # -# Version 2002-01-25 +# Version 2002-11-01 # # Uses following information from /etc/sysconfig/network: # NETWORKING_IPV6=yes|no: controls IPv6 initialization (global setting) +# IPV6_DEFAULTDEV=<device>: controls default route (optional) +# IPV6_DEFAULTGW=<address>: controls default route (optional) # # Uses following information from /etc/sysconfig/network-scripts/ifcfg-$1: # DEVICE=<device> # IPV6INIT=yes|no: controls IPv6 configuration for this interface -# IPV6_MTU=<MTU for IPv6>: controls IPv6 MTU for this link [optional] +# IPV6_MTU=<MTU for IPv6>: controls IPv6 MTU for this link (optional) # # For static tunnels # IPV6TUNNELIPV4=<IPv4 address>: IPv4 address of remote tunnel endpoint @@ -25,10 +27,8 @@ # -# Get global network configuration . /etc/sysconfig/network -# Source IPv4 helper functions cd /etc/sysconfig/network-scripts . network-functions diff --git a/sysconfig/network-scripts/init.ipv6-global b/sysconfig/network-scripts/init.ipv6-global index 262bc2f7..407e6d07 100755 --- a/sysconfig/network-scripts/init.ipv6-global +++ b/sysconfig/network-scripts/init.ipv6-global @@ -11,7 +11,7 @@ # # RHL integration assistance by Pekka Savola <pekkas@netcore.fi> # -# Version 2002-01-25 +# Version 2002-10-30 # # Calling parameters: # $1: action (currently supported: start|stop|showsysctl) @@ -31,10 +31,8 @@ -# Get global network configuration . /etc/sysconfig/network -# Source IPv4 helper functions cd /etc/sysconfig/network-scripts . network-functions diff --git a/sysconfig/network-scripts/network-functions-ipv6 b/sysconfig/network-scripts/network-functions-ipv6 index 70a6d9f3..f6f83476 100644 --- a/sysconfig/network-scripts/network-functions-ipv6 +++ b/sysconfig/network-scripts/network-functions-ipv6 @@ -5,10 +5,10 @@ # Taken from: network-functions-ipv6 # (P) & (C) 1997-2002 by Peter Bieringer <pb@bieringer.de> # -# Version: 2002-01-25 +# Version: 2002-11-02 # # Extended address detection is enabled, if 'ipv6calc' is installed -# Available here: http://www.bieringer.de/linux/IPv6/tools/index.html#ipv6calc +# Available here: http://www.bieringer.de/linux/IPv6/ipv6calc/ # # @@ -269,7 +269,7 @@ ipv6_exec_ip() { ipv6_exec_sysctl() { local options=$* - LC_ALL=C /sbin/sysctl $options 2>&1 + LC_ALL=C /sbin/sysctl -e $options 2>&1 return $? } @@ -307,7 +307,7 @@ ipv6_control_forwarding() { # Global control? (if no device is given) if [ -z "$fw_device" ]; then - ipv6_exec_sysctl -w -e net.ipv6.conf.all.forwarding=$status >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.all.forwarding=$status >/dev/null fi # Per device control (not implemented in kernel) @@ -487,9 +487,9 @@ ipv6_enable_autotunnel() { fi # Set sysctls proper (regardless "default") - ipv6_exec_sysctl -w -e net.ipv6.conf.sit0.forwarding=1 >/dev/null - ipv6_exec_sysctl -w -e net.ipv6.conf.sit0.accept_ra=0 >/dev/null - ipv6_exec_sysctl -w -e net.ipv6.conf.sit0.accept_redirects=0 >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.sit0.forwarding=1 >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.sit0.accept_ra=0 >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.sit0.accept_redirects=0 >/dev/null fi return 0 @@ -514,9 +514,9 @@ ipv6_disable_autotunnel() { true else # take down basic tunnel device - ipv6_exec_sysctl -w -e net.ipv6.conf.sit0.forwarding=0 >/dev/null - ipv6_exec_sysctl -w -e net.ipv6.conf.sit0.accept_ra=0 >/dev/null - ipv6_exec_sysctl -w -e net.ipv6.conf.sit0.accept_redirects=0 >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.sit0.forwarding=0 >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.sit0.accept_ra=0 >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.sit0.accept_redirects=0 >/dev/null ipv6_exec_ifconfig sit0 down @@ -671,7 +671,7 @@ ipv6_add_addr_on_device() { else ipv6_exec_ifconfig $device up - if ! test_interface_status $device; then + if ! ipv6_test_device_status $device; then ipv6_log $"Device '$device' enabling didn't work" err $fn return 3 fi @@ -1145,18 +1145,6 @@ ipv6_del_6to4_tunnel() { ipv6_test || return 2 - # generate 6to4 address - local prefix6to4="`ipv6_create_6to4_prefix $localipv4`" - if [ $? -ne 0 -o -z "$prefix6to4" ]; then - return 3 - fi - - if [ -z "$localipv6to4suffix" ]; then - local address6to4="$prefix6to4::1/16" - else - local address6to4="${prefix6to4}::${localipv6to4suffix}/16" - fi - ipv6_del_tunnel_device tun6to4 local retval=$? @@ -1235,9 +1223,9 @@ ipv6_add_tunnel_device() { fi # Set sysctls proper (regardless "default") - ipv6_exec_sysctl -w -e net.ipv6.conf.$device.forwarding=1 >/dev/null - ipv6_exec_sysctl -w -e net.ipv6.conf.$device.accept_ra=0 >/dev/null - ipv6_exec_sysctl -w -e net.ipv6.conf.$device.accept_redirects=0 >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.$device.forwarding=1 >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.$device.accept_ra=0 >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.$device.accept_redirects=0 >/dev/null if [ -n "$addressipv6local" ]; then # Setup P-t-P address @@ -1437,7 +1425,7 @@ ipv6_set_mtu() { fi # Set value - ipv6_exec_sysctl -w -e net.ipv6.conf.$device.mtu=$ipv6_mtu >/dev/null + ipv6_exec_sysctl -w net.ipv6.conf.$device.mtu=$ipv6_mtu >/dev/null return 0 } @@ -1472,7 +1460,7 @@ ipv6_set_default_route() { fi # Scope device has precedence - if [ -n "$device_scope" -a ! -z "$device" -a "$device_scope" != "$device" ]; then + if [ -n "$device_scope" -a -n "$device" -a "$device_scope" != "$device" ]; then ipv6_log $"Given IPv6 default gateway '$address' has scope '$device_scope' defined, given default gateway device '$device' will be not used" inf $fn local device="" fi @@ -1579,7 +1567,7 @@ ipv6_test_route_requires_next_hop() { # $2: [startstop|restart|reload|SIGHUP] : triger mechanism (default is "SIGHUP") # "startstop" : reason=up -> start, reason=down -> stop # $3: [<filename>] : alternative pid file [optional] -# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem 10=need no explicit hop +# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem ipv6_trigger_radvd() { local fn="ipv6_trigger_radvd" @@ -1630,7 +1618,12 @@ ipv6_trigger_radvd() { # PID file needed? if [ "$action" = "SIGHUP" ]; then if ! [ -f "$pidfile" ]; then - ipv6_log $"Given pidfile '$pidfile' doesn't exist, cannot send trigger to radvd" err $fn + if [ "$reason" = "down" ]; then + # be quiet because triggering may have been disabled + true + else + ipv6_log $"Given pidfile '$pidfile' doesn't exist, cannot send trigger to radvd" err $fn + fi return 3 fi @@ -1650,7 +1643,17 @@ ipv6_trigger_radvd() { kill -HUP $pid ;; 'reload'|'restart'|'stop'|'start') - service radvd $action >/dev/null 2>&1 + if ! /sbin/chkconfig --list radvd >/dev/null 2>&1; then + if [ "$reason" = "down" ]; then + # be quiet because triggering may have been disabled + true + else + ipv6_log $"radvd not (properly) installed, triggering failed" err $fn + fi + return 3 + else + /sbin/service radvd $action >/dev/null 2>&1 + fi ;; *) # Normally not reached, "action" is set above to proper value |