Skip to content

Instantly share code, notes, and snippets.

@imcj
Last active September 6, 2020 02:34
Show Gist options
  • Save imcj/4499611 to your computer and use it in GitHub Desktop.
Save imcj/4499611 to your computer and use it in GitHub Desktop.

理想的上网方案

优点:

  1. 不用添加大量的路由表,维护会访问的网站的路由
  2. 节省流量
  3. 提高上网速度
  4. 科学上网

我使用 [chnroutes] 方案,国内的流量走本地连接,虽然可行,但不是所有国外流量都需要走VPN,也失去了CDN的功能。

所以比较理想的方案应该是, DNS被污染IP被墙 会走VPN,被污染或者墙掉的域名由 [gfwlist] 提供了。。

DNS代理

使用一个DNS代理,根据用户的请求来维护路由表。DNS请求的域名如果在 [gfwlist] 内,那么走VPN,详细见图。

DNS代理放在国内的服务器或者本地机上,确保DNS代理本身不会被污染,以下是最理想的场合,优先级别顺序排列。

  1. 路由器
  2. 本地
  3. 镇内服务器

[流程图]

http://i.imgur.com/GDBFBGB.png

[1]推薦使用chnroutes取代SSH翻牆 https://docs.google.com/document/edit?id=1aSVUSp8dpEPfkcWOq5M9b0Uu5JEeYKulREqqmeT3I5U
[2]graceMode http://code.google.com/p/autoddvpn/wiki/graceMode
[3]autoddvpn http://code.google.com/p/autoddvpn/
[4]自动翻墙设备实现 http://a.bookgo.org/?p=110
[chnroutes]chnroutes http://code.google.com/p/chnroutes/
[gfwlist](1, 2) https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt
[流程图]https://cacoo.com/diagrams/PaZLBAw7Z77R62E9
[pwx-dns-proxy]http://code.google.com/p/pwx-dns-proxy/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment