aboutsummaryrefslogtreecommitdiffstats
path: root/rootdir
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-06-25 20:50:44 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-06-25 20:50:44 -0700
commita65044fad8d668fad71769555486254eee7b8dc3 (patch)
tree726ccaf6935d12be74cfd022f9edcadad4a3b87e /rootdir
parent0e6146c0725b992e7cb90c5e6e4c9ccd2d853055 (diff)
parenta1140ad45dc90e6f51944a12d0a690e757c9bd0b (diff)
downloadsystem_core-a65044fad8d668fad71769555486254eee7b8dc3.tar.gz
system_core-a65044fad8d668fad71769555486254eee7b8dc3.tar.bz2
system_core-a65044fad8d668fad71769555486254eee7b8dc3.zip
am a1140ad4: Merge change 5455 into donut
Merge commit 'a1140ad45dc90e6f51944a12d0a690e757c9bd0b' * commit 'a1140ad45dc90e6f51944a12d0a690e757c9bd0b': Add new PPP IPCP script for VPN.
Diffstat (limited to 'rootdir')
-rwxr-xr-xrootdir/etc/ppp/ip-up-vpn18
1 files changed, 18 insertions, 0 deletions
diff --git a/rootdir/etc/ppp/ip-up-vpn b/rootdir/etc/ppp/ip-up-vpn
new file mode 100755
index 00000000..5d6b6114
--- /dev/null
+++ b/rootdir/etc/ppp/ip-up-vpn
@@ -0,0 +1,18 @@
+#!/system/bin/sh
+
+/system/bin/setprop "vpn.dns1" "$DNS1"
+/system/bin/setprop "vpn.dns2" "$DNS2"
+
+GATEWAY=${6#*@}
+VPNSERVER=${6%@*}
+
+# Protect the route to vpn server
+/system/bin/route add -net "$VPNSERVER" netmask 255.255.255.255 gw "$GATEWAY"
+
+if (exp $?) ; then exit $?; fi
+
+# Route all traffic to vpn connection
+/system/bin/route add -net 0.0.0.0 netmask 128.0.0.0 gw $IPREMOTE
+/system/bin/route add -net 128.0.0.0 netmask 128.0.0.0 gw $IPREMOTE
+
+/system/bin/setprop "vpn.up" "1"