bestroutetb
bestroutetb copied to clipboard
Generating the most optimized route table for VPN users.
你好!我在做类似的研究,旨在优化梯子的选路规则,然后搜索看到了这个项目,十分棒的想法!对我帮助很大。同时我也希望交流分享一下思路,或许这有点用。同时我也在尝试将这个项目生成的路由表引入到我的方案中,由于这个项目生成的路由表并不大,叠加之后不会增加太多路由条目,所以似乎效果不错。 首先我是个网工而不是程序员,也看不懂代码(抱歉),我的关注点是在被墙掉的服务和一些容易被重点照顾的CDN(例如akamai),将这些IP段指向梯子的隧道接口,就可以实现大部分的被墙服务翻墙,剩下的走本地默认路由。这个想法很久之前有人提过(例如“是否存在GFW的黑名单IP”一类的话题),但由于被墙地址池经常变动且不容易验证等等多数原因,这个并不好实现。 我的思路是,被墙的公司(eg. Google, Facebook, Twitter etc.)的公司往往拥有自己的ASN,通过 [bgp.he.net](https://bgp.he.net/) 网站或者类似服务可以查到该公司的ASN以及所宣告的prefix。 例如Google: [https://bgp.he.net/irr/as-set/AS-GOOGLE](https://bgp.he.net/irr/as-set/AS-GOOGLE) 在其prefixes v4中,可以获取其宣告的网段,其中连续的网段可以聚合成一个更大的网段,例如 `AS36492` : | Prefix | Description | | --- | :-- | | 64.9.224.0/24 | Google, Inc....
bestroutetb --route.vpn=us -p iproute -o route_us.sh ubuntu下测试,到100%之后就不动了,没有任何错误提示,文件也没有生成。 james@james-VirtualBox:~/projects/bestroutetb$ bestroutetb --route.vpn=us -p iproute -o route_us.sh prog db updating... 100% 19663975B/19663975B 0.0s
Test cli: ``` sh node ./cli.js -v -p custom \ --rule-format $'r a %prefix/%length %gw table vpn\n' \ --route.net="CN" \ --gateway.net="via 172.27.0.1 dev eth0" \ --route.vpn="US" \ --gateway.vpn="via 172.27.0.2 dev...
I have tried using `%gateway` and found that `%gateway` is no longer supported. Update the document.
对于iproute进行配置的时候 如果是pppoe拨号的动态ip那就比较难指定gateway ip了 以及并没有找到如何将gateway.net配置为interface 如果直接写interface name会生成类似 ``` ip route add 0.0.0.0/0 via ppp0 ``` 这样的输出
Broadcast addresses should not be included in the report. > Example: For broadcasting a packet to an entire IPv4 subnet using the private IP address space 172.16.0.0/12, which has the...
首先说up.sh的问题,顶部的#!/bin/shnetgw=$(cat /tmp/net_gateway)read target dummy vpngw dummy
当前产生路由表的回溯算法是最大匹配的,即假设存在变色点的前缀树: ``` R(N(N,B),N(B,N)) ``` 其中R/B/N分别表示节点值为红/蓝/无色 再产生路由规则时时会将值为蓝色的孙子节点提高到R的儿子高度: ``` R(B,B) ``` 对于一些地址段,这样的策略可能并不是十分妥当: 1. 希望从net_gateway的地址空间中去掉个别主机地址:x.y.z.w/32 2. 希望尽可能多的地址使用net_gateway或vpn_gateway。 所以希望可以实现最小匹配标记,即修改`minifier.js`的输入参数`--local=specs`和`--vpn=specs`接受如下格式的标记: 1. `-国家缩写` 如 `-us`,表示在APNIC分配表内的美国地址使用最小匹配。 2. `-IP/mask` 如 `-123.123.15.30/30`,表示123.123.15.30/30地址段使用最小匹配。 并在保持产生最少规则数的原则下,满足最小匹配的要求,(实际只有在父节点/子节点的值不同时,才可以应用这一规则。)