aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-tunnel
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/ifup-tunnel')
-rwxr-xr-xsysconfig/network-scripts/ifup-tunnel11
1 files changed, 9 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup-tunnel b/sysconfig/network-scripts/ifup-tunnel
index 49c52c0b..2eaa4bb7 100755
--- a/sysconfig/network-scripts/ifup-tunnel
+++ b/sysconfig/network-scripts/ifup-tunnel
@@ -39,12 +39,19 @@ fi
case "$TYPE" in
GRE)
MODE=gre
+ proto=-4
/sbin/modprobe ip_gre
;;
IPIP)
MODE=ipip
+ proto=-4
/sbin/modprobe ipip
;;
+ IPIP6)
+ MODE=ipip6
+ proto=-6
+ /sbin/modprobe ip6_tunnel
+ ;;
*)
net_log $"Invalid tunnel type $TYPE"
exit 1
@@ -52,14 +59,14 @@ case "$TYPE" in
esac
# Generic tunnel devices are not supported here
-if [ "$DEVICE" = gre0 -o "$DEVICE" = tunl0 ]; then
+if [ "$DEVICE" = gre0 -o "$DEVICE" = tunl0 -o "$DEVICE" = ip6tnl0 ]; then
net_log $"Device '$DEVICE' isn't supported as a valid GRE device name."
exit 1
fi
# Create the tunnel
# The outer addresses are those of the underlying (public) network.
-/sbin/ip tunnel add "$DEVICE" mode "$MODE" \
+/sbin/ip $proto tunnel add "$DEVICE" mode "$MODE" \
${MY_OUTER_IPADDR:+local "$MY_OUTER_IPADDR"} \
${PEER_OUTER_IPADDR:+remote "$PEER_OUTER_IPADDR"} \
${KEY:+key "$KEY"} ${TTL:+ttl "$TTL"}