summaryrefslogtreecommitdiff
path: root/package/vpnc/files/vpnc-route
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /package/vpnc/files/vpnc-route
Initial import
Diffstat (limited to 'package/vpnc/files/vpnc-route')
-rwxr-xr-xpackage/vpnc/files/vpnc-route30
1 files changed, 30 insertions, 0 deletions
diff --git a/package/vpnc/files/vpnc-route b/package/vpnc/files/vpnc-route
new file mode 100755
index 000000000..f39eb1355
--- /dev/null
+++ b/package/vpnc/files/vpnc-route
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+#* VPNGATEWAY -- vpn gateway address (always present)
+#* TUNDEV -- tunnel device (always present)
+#* INTERNAL_IP4_ADDRESS -- address (always present)
+
+# define which traffic should be routed through the tunnel device
+# any traffic that is not bound to a local interface will be
+# mangled by the "main" routing table, so we add our rules to
+# the main routing table
+
+# the setup for remote traffic and already bound traffic is done by
+# the hotplug scripts.
+
+if [ "x$TUNDEV" == "x" ]; then
+ echo "No TUNDEV given. Script must be called from vpnc-script"
+ exit 1;
+fi
+case "$1" in
+ start)
+ # for each subnet that should be reached from this machine over the vpn tunnel,
+ # add a line like this:
+ # ip route add some.sub.net/msk dev $TUNDEV src $INTERNAL_IP4_ADDRESS
+ ;;
+ stop)
+ # remove the routing entries
+ ;;
+esac;
+exit 0;
+