am a1140ad4
: Merge change 5455 into donut
Merge commit 'a1140ad45dc90e6f51944a12d0a690e757c9bd0b' * commit 'a1140ad45dc90e6f51944a12d0a690e757c9bd0b': Add new PPP IPCP script for VPN.
This commit is contained in:
commit
a65044fad8
1 changed files with 18 additions and 0 deletions
18
rootdir/etc/ppp/ip-up-vpn
Executable file
18
rootdir/etc/ppp/ip-up-vpn
Executable file
|
@ -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"
|
Loading…
Reference in a new issue