aboutsummaryrefslogtreecommitdiffstats
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
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>)
-rw-r--r--ppp/ip-up.ipv6to420
-rw-r--r--sysconfig.txt20
-rwxr-xr-xsysconfig/network-scripts/ifup-ipv622
-rw-r--r--sysconfig/network-scripts/network-functions-ipv69
4 files changed, 59 insertions, 12 deletions
diff --git a/ppp/ip-up.ipv6to4 b/ppp/ip-up.ipv6to4
index da0ba48e..be45e488 100644
--- a/ppp/ip-up.ipv6to4
+++ b/ppp/ip-up.ipv6to4
@@ -9,7 +9,7 @@
# You will find more information in the IPv6-HowTo for Linux at
# http://www.bieringer.de/linux/IPv6/
#
-# Version 2002-11-02
+# Version 2002-11-12a
#
# Calling parameters:
# $1: interface name
@@ -27,6 +27,7 @@
# IPV6TO4INIT=yes|no: controls configuration
# IPV6TO4_IPV4ADDR=<IPv4 address>: special local address for 6to4 tunneling (only needed behind a NAT gateway)
# IPV6TO4_RELAY=<IPv4 address>: remote 6to4 relay router address (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_ROUTING="<device>-<suffix>/<prefix length> ...": information to setup local subnetting
# Example: IPV6TO4_ROUTING="eth0-:f101::0/64 eth1-:f102::0/64"
#
@@ -119,8 +120,23 @@ if [ "$IPV6TO4INIT" = "yes" ]; then
# Cleanup all old data (needed, if "ip-down.ipv6to4" wasn't executed), delete all configured 6to4 address
ipv6_cleanup_6to4_tunnels tun6to4
+ # 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
+
# Setup new data
- ipv6_add_6to4_tunnel tun6to4 $ipv4addr || exit 1
+ ipv6_add_6to4_tunnel tun6to4 $ipv4addr "" $tunnelmtu || exit 1
# Add default route, if device matches
if [ "$IPV6_DEFAULTDEV" = "tun6to4" ]; then
diff --git a/sysconfig.txt b/sysconfig.txt
index 49ace959..b0388952 100644
--- a/sysconfig.txt
+++ b/sysconfig.txt
@@ -202,10 +202,10 @@ Files in /etc/sysconfig
Add a default route through specified gateway
An interface can be specified: required for link-local addresses
Examples:
- IPV6_DEFAULTGW="3ffe:400:100:f101::2"
- Add default route through 3ffe:400:100:f101::2
- IPV6_DEFAULTGW="3ffe:400:100:f101::2%eth0"
- Add default route through 3ffe:400:100:f101::2 and device eth0
+ IPV6_DEFAULTGW="3ffe:ffff:1234:5678::1"
+ Add default route through 3ffe:ffff:1234:5678::1
+ IPV6_DEFAULTGW="3ffe:ffff:1234:5678::1%eth0"
+ Add default route through 3ffe:ffff:1234:5678::1 and device eth0
IPV6_DEFAULTGW="fe80::1%eth0"
Add default route through fe80::1 and device eth0
@@ -279,8 +279,10 @@ Files in /etc/sysconfig
adds routes through dedicated tunnel interface sit1
tun6to4 3ffe:ffff:1234::/56
- tun6to4 3ffe:ffff:5678::/56 ::5.6.7.8
adds routes through hardwired 6to4 tunnel interface tun6to4
+ tun6to4 3ffe:ffff:5678::/56 ::5.6.7.8
+ adds routes through hardwired 6to4 tunnel interface tun6to4,
+ specifying next hop
Notes:
* default routes (such as the "2000::/3" shown above) should be set with
@@ -568,10 +570,16 @@ Files in /etc/sysconfig/network-scripts/
IPV6TO4_IPV4ADDR=<IPv6 address>[/<prefix length>] (optional)
Overwrite local IPv4 address which is accessable from the Internet
(optional, in case of static IPv4-NAT behind a router or other special scenarios)
+ IPV6TO4_MTU=<MTU for IPv6> (optional)
+ Controls IPv6 MTU for the 6to4 tunnel
+ Note: Must be greater or equal to 1280
+ Example:
+ IPV6TO4_MTU="1280"
+ Default: MTU of master device - 20
IPV6TO4_ROUTING="<device>-<suffix>/<prefix length> ..." (optional)
A list of routing tokens to setup proper IPv6 routes on the LAN
Example:
- IPV6TO4_ROUTING="eth0-:f101::0/64 eth1-:f102::0/64"
+ IPV6TO4_ROUTING="eth0-:0004::0/64 eth1-:0005::0/64"
Will create one route per eth0 and eth1, taking given SLA
Optional settings for a 6to4 tunnel or a ppp link
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
}