aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2002-12-02 21:32:31 +0000
committerBill Nottingham <notting@redhat.com>2002-12-02 21:32:31 +0000
commitf5ba1b5cd4b5a7c4ec1e07a3908e992cdb60b037 (patch)
treee5ca1b5869f2953b3ed75b7f3bf7476f9080422b /sysconfig/network-scripts
parent7e01bbb197edd6a156ead3795b2b47cb2a70b17d (diff)
downloadinitscripts-f5ba1b5cd4b5a7c4ec1e07a3908e992cdb60b037.tar
initscripts-f5ba1b5cd4b5a7c4ec1e07a3908e992cdb60b037.tar.gz
initscripts-f5ba1b5cd4b5a7c4ec1e07a3908e992cdb60b037.tar.bz2
initscripts-f5ba1b5cd4b5a7c4ec1e07a3908e992cdb60b037.tar.xz
initscripts-f5ba1b5cd4b5a7c4ec1e07a3908e992cdb60b037.zip
IPv6 update (<pekkas@netcore.fi>, <pb@bieringer.de>)
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifup-ipv622
-rw-r--r--sysconfig/network-scripts/network-functions-ipv69
2 files changed, 27 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifup-ipv6 b/sysconfig/network-scripts/ifup-ipv6
index e8960553..45b1140a 100755
--- a/sysconfig/network-scripts/ifup-ipv6
+++ b/sysconfig/network-scripts/ifup-ipv6
@@ -11,7 +11,7 @@
#
# RHL integration assistance by Pekka Savola <pekkas@netcore.fi>
#
-# Version 2002-11-02
+# Version 2002-11-12a
#
# Note: if called (like normally) by /etc/sysconfig/network-scripts/ifup
# exit codes aren't handled by "ifup"
@@ -35,6 +35,7 @@
# 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"
@@ -198,7 +199,22 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
# Setup 6to4 tunnel (hardwired name is "tun6to4"), if config is valid
if [ "$valid6to4config" = "yes" ]; then
- ipv6_add_6to4_tunnel tun6to4 $ipv4addr || exit 1
+ # Get MTU of master device
+ ipv4mtu="`ipv6_exec_ip link show dev $DEVICE | grep -w "mtu" | awk '{ print $5 }'`"
+ if [ -n "$ipv4mtu" ]; then
+ # IPv6 tunnel MTU is IPv4 MTU minus 20 for IPv4 header
+ tunnelmtu=$[ $ipv4mtu - 20 ]
+ fi
+
+ if [ -n "$IPV6TO4_MTU" ]; then
+ if [ $IPV6TO4_MTU -gt $tunnelmtu ]; then
+ echo $"Warning: configured MTU '$IPV6TO4_MTU' for 6to4 exceeds maximum limit of '$tunnelmtu', ignored"
+ else
+ tunnelmtu=$IPV6TO4_MTU
+ fi
+ fi
+
+ ipv6_add_6to4_tunnel tun6to4 $ipv4addr "" $tunnelmtu || exit 1
# Add default route, if device matches
if [ "$IPV6_DEFAULTDEV" = "tun6to4" ]; then
@@ -217,7 +233,7 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
if [ -z "$gateway" ]; then
gateway="$ipv6to4_relay"
fi
- ipv6_add_route $network $ipv6to4_relay tun6to4
+ ipv6_add_route $network $gateway tun6to4
done
fi
diff --git a/sysconfig/network-scripts/network-functions-ipv6 b/sysconfig/network-scripts/network-functions-ipv6
index f6f83476..eba48121 100644
--- a/sysconfig/network-scripts/network-functions-ipv6
+++ b/sysconfig/network-scripts/network-functions-ipv6
@@ -5,7 +5,7 @@
# Taken from: network-functions-ipv6
# (P) & (C) 1997-2002 by Peter Bieringer <pb@bieringer.de>
#
-# Version: 2002-11-02
+# Version: 2002-11-12
#
# Extended address detection is enabled, if 'ipv6calc' is installed
# Available here: http://www.bieringer.de/linux/IPv6/ipv6calc/
@@ -1041,6 +1041,7 @@ ipv6_create_6to4_relay_address() {
# $1: <Interface> : only "tun6to4" is supported
# $2: <IPv4 address> : global address of local interface
# $3: [<IPv6 suffix>] : for 6to4 prefix (optional, default is "::1")
+# $4: [<MTU>] : MTU of tunnel device (optional, default is automatic)
# return code: 0=ok 1=argument error 2=IPv6 test fails 3=major problem
ipv6_add_6to4_tunnel() {
local fn="ipv6_add_6to4_tunnel"
@@ -1048,6 +1049,7 @@ ipv6_add_6to4_tunnel() {
local device=$1
local localipv4=$2
local localipv6to4suffix=$3
+ local mtu=$4
if [ -z "$device" ]; then
ipv6_log $"Missing parameter 'device' (arg 1)" err $fn
@@ -1086,6 +1088,11 @@ ipv6_add_6to4_tunnel() {
local retval=0
fi
+ # Set MTU, if given
+ if [ -n "$mtu" ]; then
+ ipv6_set_mtu $device $mtu
+ fi
+
return $retval
}