Felix Yan | 2011-01-20 | 1,363 views
刷上 Froyo 的盆友们在安装 OpenVPN 的时候会怨念的发现, “明明在 OpenVPN Settings 里显示已连接, 却连一点连接上了的感觉都没有呢?”
如果在终端里手动键入 openvpn 的命令来获得反馈的 log, 会得到下面这样让你感到十分 confused 的结果:
Sat Jul 3 13:30:58 2010 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:4: route (2.1.1)
Sat Jul 3 13:30:58 2010 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:7: ifconfig (2.1.1)
神马? 找不到哥的 route 和 ifconfig 命令? 他们都很乖的呆在 /system/xbin 里呢…
恩, 这貌似是一个已知的 bug ,暂时可以用下面的猥琐方法给 workaround 掉:
首先, 你要保证你的内核有 tun 设备. 如果没有, 则需要到网上找到对应你内核版本的 tun.ko 文件手动刷进去:) (这些内容就不再赘述)
然后, 进入你的 root 终端, 输入下面的命令:
mkdir /system/xbin/bb
ln -s /system/xbin/ifconfig /system/xbin/bb/
ln -s /system/xbin/route /system/xbin/bb/
然后, 像你以前做的一样, 进 Market 装上 OpenVPN Installer.
注意: 安装Binary的时候选择route等命令的路径到 /system/xbin/bb
然后…恭喜你, 就这么简单:)
参考资料: http://code.google.com/p/android-openvpn-installer/issues/detail?id=2
Felix Yan | 2010-11-12 | 1,843 views
1, 如果是IPv4用户, 可以到官网(http://openvpn.net/)下载安装最新版OpenVPN, 并跳过下面的 5 – 6 步
如果是IPv6用户, 可以到官网下载2.1.1版本(http://openvpn.net/release/openvpn-2.1.1-install.exe)的OpenVPN(IPv6补丁最高支持到2.1.1版本的OpenVPN)
然后到github(https://github.com/downloads/jjo/openvpn-ipv6/openvpn.exe-2.1.1-ipv6-0.4.11.zip)下载IPv6补丁.
2, 如果无法访问上述地址(如教育网用户), 可以访问http://m.uudisc.com/user/felixonmars/files/3671029下载OpenVPN 2.1.1及其IPv6补丁包.

3, Win7 用户下载后不要直接打开, 需要使用管理员权限运行.

4, 按照提示安装 OpenVPN 客户端软件

Read the rest of this entry »
Felix Yan | 2010-08-13 | 547 views
首先, 感谢 @BOYPT @jimmy_xu_wrk @tjmao @yegle 等朋友的帮忙!
1, 多网环境, Felix 的环境是 VPN over cernet2 + cernet 双网.
2, 自动路由表, 采用 www.nic.edu.cn 的官方 Free IP 数据.
以下是 Felix 用 Python 写的一个小小的自动生成脚本:
import re
import urllib
a=urllib.urlopen('http://www.nic.edu.cn/RS/ipstat/internalip/real.html').read()
b=re.compile("([\d\.]+)\s+[\d\.]+\s+([\d\.]+)")
c=b.findall(a)
m=["#!/bin/bash","OLDGW=$1","NEWGW=$2","route del -net 0.0.0.0 netmask 0.0.0.0","route add -net 0.0.0.0 netmask 0.0.0.0 gw $NEWGW"]
n=["#!/bin/bash"]
for d in c:
m.append("route add -net "+d[0]+" netmask "+d[1]+" gw $OLDGW")
n.append("route del -net "+d[0]+" netmask "+d[1])
e=open('gtwcernet',"w")
e.write("\n".join(m))
e.close()
f=open('gtwcernetd',"w")
f.write("\n".join(n))
f.close()
会在当前目录生成 gtwcernet 和 gtwcernetd 两个文件
然后给他们加上执行权限
chmod +x gtwcernet
chmod +x gtwcernetd
前一个是启用自动路由表
Usage: gtwcernet <教育网网关> <VPN/电信网网关>
后一个是禁用自动路由表
Usage: gtwcernetd
Read the rest of this entry »
Felix Yan | 2010-07-16 | 318 views
恩,作为笔记系列的文章,内容会比较混乱.
这段时间以来,作为Ubuntu双十版的小白鼠,虽然挂彩数次,不过也在 @yegle @tjmao @poplarch @BOYPT @liangsuilong @jimmy_xu_wrk 等等推友的帮助下搞定重生.
以下是这段时间来发现的好东西:
1, @tualatrix 大大的notify脚本(Felix降碳版)
#!/bin/bash
# Copyright: TualatriX GPL v3
# Website: http://imtx.cn/archives/1516.html
# Please add the following line to ~/.bashrc to enable the bash completion support
# complete -o filenames -F _root_command notify
$* && \
notify-send "\"$*\" finished successfully" || \
notify-send "\"$*\" failed"
并在 ~/.bashrc 里加入:
complete -o filenames -F _root_command notify
以适应bash的自动完成功能. 原文在此
这玩意着实好用, 不过本猫发现10.04及以上版本会出现找不到notify-send命令,这时只需要
# apt-get install libnotify-bin
就好.
Read the rest of this entry »