User Tools

Site Tools


android:g1使用openvpn

如何在G1上使用OpenVPN

本方讲述了如何在G1上使用OpenVPN,前提是你用的Rom已经安装了OpenVPN.

使用命令:

openvpn --config client.conf -auth auth

说明:

1.将证书文件放到/data/vpn目录下

2.手动编辑一个auth文件:第一行写证书用户名,第二行写密码,也放到/data/vpn目录下

3.cd 到/data/vpn目录下

4.启动OpenVPN

openvpn --config client.conf -auth auth

如果嫌每次输入这个命令,可以弄一个小脚本,将这行命令扔到一个文件里,比如:

echo "openvpn --config client.conf -auth auth"  >>vpn
chmod 777 vpn
./vpn

就可以启动OpenVPN了

5.如果一切正常,可以查看下G1的IP:

# busybox ifconfig
busybox ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:460 errors:0 dropped:0 overruns:0 frame:0
          TX packets:460 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:34332 (33.5 KiB)  TX bytes:34332 (33.5 KiB)

rmnet0    Link encap:Ethernet  HWaddr 7A:ED:9A:75:46:FC
          inet addr:10.110.219.120  Bcast:10.110.219.123  Mask:255.255.255.252
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2722 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2330 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2344247 (2.2 MiB)  TX bytes:289966 (283.1 KiB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.8.0.18  P-t-P:10.8.0.17  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:404 (404.0 B)  TX bytes:4931 (4.8 KiB)

其中tun0就是OpenVPN链接了:

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.8.0.18  P-t-P:10.8.0.17  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:7 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:404 (404.0 B)  TX bytes:4931 (4.8 KiB)

/var/www/dokuwiki/wiki/data/pages/android/g1使用openvpn.txt · Last modified: 2016/05/05 13:07 by 127.0.0.1