aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-06-25 20:49:36 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-06-25 20:49:36 -0700
commita1140ad45dc90e6f51944a12d0a690e757c9bd0b (patch)
tree57a0ac5ec06443befe830c6e23fcf6264e69ba20
parentc3115b9ec2f9bc07e6ffd7d7bb7338415822c338 (diff)
parent34ccf656e23038ca89dcacf29045c3e1a50639a0 (diff)
downloadsystem_core-a1140ad45dc90e6f51944a12d0a690e757c9bd0b.tar.gz
system_core-a1140ad45dc90e6f51944a12d0a690e757c9bd0b.tar.bz2
system_core-a1140ad45dc90e6f51944a12d0a690e757c9bd0b.zip
Merge change 5455 into donut
* changes: Add new PPP IPCP script for VPN.
-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"