android:android上安装启用openvpn脚本
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
android:android上安装启用openvpn脚本 [2010/04/01 06:26] – percy | android:android上安装启用openvpn脚本 [2016/05/05 13:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | 下载openvpn static | ||
+ | |||
+ | 直接下载static的openvpn, | ||
+ | |||
+ | http:// | ||
+ | |||
+ | 新增目录如下: | ||
+ | |||
+ | < | ||
+ | F: | ||
+ | .: | ||
+ | 鎬昏 1407 | ||
+ | drwx------+ 2 Percy.Peng ???????? | ||
+ | -rwx------+ 1 Percy.Peng ???????? 907764 Mar 31 10:59 openvpn-static | ||
+ | -rwx------+ 1 Percy.Peng ???????? 529519 Mar 31 10:56 openvpn-static-2.1.1.bz2 | ||
+ | -rwx------+ 1 Percy.Peng ???????? | ||
+ | |||
+ | ./openvpn: | ||
+ | 鎬昏 12 | ||
+ | -rwx------+ 1 Percy.Peng ???????? | ||
+ | -rwx------+ 1 Percy.Peng ???????? 1415 Mar 29 13:49 ca.crt | ||
+ | -rwx------+ 1 Percy.Peng ???????? 3470 Mar 31 11:23 client.conf | ||
+ | -rwx------+ 1 Percy.Peng ???????? 3992 Mar 29 13:49 client.crt | ||
+ | -rwx------+ 1 Percy.Peng ???????? | ||
+ | </ | ||
+ | |||
+ | 其中./ | ||
+ | |||
+ | startopenvpn.sh是我写的一个脚本文件, | ||
+ | 内容如下 | ||
+ | <file BASH startopenvpn.sh> | ||
+ | #!/bin/sh | ||
+ | #This shell is used to install openvpn on the Android Phone and start the OpenVPN in the SHELL | ||
+ | #You can find more details here: | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | echo "adb push openvpn-static system/ | ||
+ | adb push openvpn-static system/ | ||
+ | |||
+ | echo "adb shell chmod 775 / | ||
+ | adb shell chmod 775 / | ||
+ | |||
+ | echo "adb shell mkdir / | ||
+ | adb shell mkdir / | ||
+ | |||
+ | echo "adb push openvpn/ | ||
+ | adb push openvpn/ | ||
+ | |||
+ | echo "adb push openvpn/ | ||
+ | adb push openvpn/ | ||
+ | |||
+ | echo "adb push openvpn/ | ||
+ | adb push openvpn/ | ||
+ | |||
+ | echo "adb push openvpn/ | ||
+ | adb push openvpn/ | ||
+ | |||
+ | echo "adb push tun.ko / | ||
+ | adb push tun.ko / | ||
+ | |||
+ | echo "adb shell chmod 777 / | ||
+ | adb shell chmod 777 / | ||
+ | |||
+ | echo "adb shell insmod / | ||
+ | adb shell insmod / | ||
+ | |||
+ | echo "adb shell mkdir / | ||
+ | adb shell mkdir / | ||
+ | |||
+ | echo "adb shell busybox | ||
+ | adb shell busybox | ||
+ | echo "adb shell busybox | ||
+ | adb shell busybox | ||
+ | |||
+ | echo "adb shell openvpn --config / | ||
+ | adb shell openvpn --config / | ||
+ | |||
+ | echo "Also you can run the following commands to start openvpn:" | ||
+ | echo "adb shell" | ||
+ | echo "cd / | ||
+ | echo " | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | 如果要能正常使用这个脚本, | ||
+ | - 建立如上面所示目录结构 | ||
+ | - 修改client.conf文件, | ||
+ | < | ||
+ | ca / | ||
+ | cert / | ||
+ | key / | ||
+ | </ | ||
+ | 做完之后, | ||
+ | | ||
+ | < | ||
+ | F: | ||
+ | adb push openvpn-static system/ | ||
+ | 1533 KB/s (907764 bytes in 0.578s) | ||
+ | adb shell chmod 775 / | ||
+ | adb shell mkdir / | ||
+ | mkdir failed for / | ||
+ | adb push openvpn/ | ||
+ | 216 KB/s (3470 bytes in 0.015s) | ||
+ | adb push openvpn/ | ||
+ | 44 KB/s (1415 bytes in 0.031s) | ||
+ | adb push openvpn/ | ||
+ | 249 KB/s (3992 bytes in 0.015s) | ||
+ | adb push openvpn/ | ||
+ | 55 KB/s (887 bytes in 0.015s) | ||
+ | adb shell chmod 777 / | ||
+ | adb shell cd / | ||
+ | Wed Mar 31 04:55:14 2010 OpenVPN 2.1.1 i686-pc-linux-gnu [SSL] [LZO2] [EPOLL] built on Feb 2 2010 | ||
+ | Wed Mar 31 04:55:14 2010 NOTE: OpenVPN 2.1 requires ' | ||
+ | Wed Mar 31 04:55:14 2010 WARNING: file '/ | ||
+ | Wed Mar 31 04:55:14 2010 LZO compression initialized | ||
+ | Wed Mar 31 04:55:14 2010 Control Channel MTU parms [ L:1544 D:140 EF:40 EB:0 ET:0 EL:0 ] | ||
+ | Wed Mar 31 04:55:14 2010 Data Channel MTU parms [ L:1544 D:1450 EF:44 EB:135 ET:0 EL:0 AF:3/1 ] | ||
+ | Wed Mar 31 04:55:14 2010 Local Options hash (VER=V4): ' | ||
+ | Wed Mar 31 04:55:14 2010 Expected Remote Options hash (VER=V4): ' | ||
+ | Wed Mar 31 04:55:14 2010 Attempting to establish TCP connection with 66.96.223.36: | ||
+ | Wed Mar 31 04:55:14 2010 TCP: connect to 66.96.223.36: | ||
+ | Wed Mar 31 04:55:19 2010 TCP: connect to 66.96.223.36: | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||