OpenVPN智能翻墙之中国/亚洲路由表

原文:http://igfw.net/archives/8426

开讲前先更新你的OpenVPN客户端到最新版,

下载地址:http://openvpn.net/index.php/download/community-downloads.html

亚洲路由表

我们一般访问的被墙网站(twitter/youtube/facebook等)其服务器多是在欧美地区,OpenVPN设置亚洲路由表使访问亚洲服务器网站时直接访问(不通过VPN),访问非亚洲服务器网站时才通过VPN代理访问。这样既不影响国内网站访问速度又可以达到翻墙的目的。

用记事本或写字板等文本编辑工具打开OpenVPN配置文件(一般是config文件夹下的.ovpn后缀文件),在末尾添加亚洲路由信息(下文有下载地址),修改完之后, 重新进行OpenVPN连接即可。

由于添加路由信息较少(不到50条),添加速度很快,基本不影响OpenVPN连接速度。不过服务器在亚洲的被墙网站可能依然无法访问。

中国路由表

chnroutes项目中提供了个chnroutes.py文件,安装python2.7后运行此文件,将生成一个名为 routes.txt 的文本文件其中即是最新的中国路由表(ip数据不是固定不变的, 尽管变化不大, 但还是建议每隔两三个月更新一次 )。

使用你喜欢的文本编辑器打开上述文件, 并把内容复制粘贴到openvpn配置文件的末,同时在openvpn配置文件的头部添加一句 max-routes num, 其中num是一个不小于文件routes.txt的行数的数字, 实际上因为还有一些服务器端push过来的路由信息, 所以保险起见可以用 routes.txt的行数加上50, 比如目前得到的routes.txt的行数是3940, 你可以把数字设置为4000: max-routes 4000 修改完之后, 重新进行openvpn连接。

由于添加路由信息很多(近4000条),添加速度较慢。不过相对比较精确,中国服务器网站都不通过代理,非中国服务器网站都通过VPN代理。

路由表下载http://sharesend.com/dwt2o (包含最新的中国/亚洲路由表及chnroutes.py文件)

注意,这里用到一个net_gateway的变量表示未连接openvpn前的网关地址,但openvpn的文档里有说明这个不是所有系统都支持的,如果发生这个情况,,可以修改一下生成脚本, 把net_gateway修改为你的局域网的网关地址。如果不能连接到VPN的网络,可以尝试在配置文件中加入:

route-method exe route-delay 2

另外使用此法时需要设置本机DNS服务器为境外DNS服务器(比如8.8.8.8)。路由配置生效后访问此站应该看到中国IP(你的真实IP),访问此站应该看到国外IP(你VPN的IP)。

本文原始地址:http://igfw.net/archives/8426

1 条评论:

匿名 说...

[p]It also doesn't help people who want to run their own custom-tweaked versions of Linux . Eventually you don隆炉t miss the damn thing Winking smile . Oh and did I mention it had the ability to even share your screen predating the ubiquitous Remote Desktop too? Ohhh . Start8 is [url=http://www.windows7keysus.com]norton key[/url] available for $5 . If you dabbled with the Developer Preview edition [url=http://www.windows8keyus.com]window xp key[/url] of Windows 8, released nearly six months ago, you experienced bits and pieces of what Windows 8 would eventually become . I figured there must be no longer be distinct "Upgrade" or "Full" versions like there have been for [url=http://www.windows8keyus.com]antivirus key[/url] previous versions of Windows . And a hidden thing in the bottom left corner of the screen is a "start"-type button thing that when right clicked will show you a list of common tasks like Event Viewer, Disk Management, Command Prompt, Task Manager, Control Panel, Windows Explorer, Run, etc . However, if one forgot his computer password, then it would be quite problematic since he may not be able to access to his PC.[/p][p])

So, I typed my product key into the activation utility and double-checked that it was typed correctly . Windows XP or Later

Windows Key + D: Clear all [url=http://www.windows7keysus.com]windows 7 key[/url] the windows and show the Windows Desktop . It隆炉s a really useful way to get into that menu without [url=http://www.windows7keysus.com]kaspersky key[/url] having to move the mouse to the lower left corner and click Start . As pictured in [url=http://www.windows7keysus.com]windows product key[/url] the graphic for this posting you can see the little Windows symbol on the key . Have you spent what seems like hours trying to find a basic file [url=http://www.windows8keyus.com]windows activation key[/url] on your computer . 隆掳Sideloading requires a digital certificate and using a Powershell script that we provide to do the deployment,隆卤 says Thomas . With today's unveiling [url=http://www.windows8keyus.com]windows shortcut keys[/url] of the Consumer Preview, the picture becomes considerably clearer.[/p]