ashi009 / bestroutetb

Generating the most optimized route table for VPN users.
MIT License
879 stars 99 forks source link

如何将ip网段合并 #5

Closed nosecrain closed 11 years ago

nosecrain commented 11 years ago

请教Ashi009: 您的脚本可以讲ip地址段进行合并,压缩,但我看不懂脚本,请问如何通过bestroutetb脚本来压缩如下路由表? 谢谢!

14.20.0.0 14.20.255.255
14.28.0.0 14.28.255.255
14.120.0.0 14.120.63.255
14.120.128.0 14.120.255.255
14.122.0.0 14.122.255.255
14.124.0.0 14.124.255.255
14.127.0.0 14.127.255.255
14.153.0.0 14.153.116.255

NOSEC Rain

ashi009 commented 11 years ago

参考一下 http://ashi009.tumblr.com/post/36581070478/vpn

这几天比较忙就不仔细解释了,如果你这个代码段里没有其他地址段被标记为应使用其他路由,他们就会合并成这些段共享的prefix

nosecrain commented 11 years ago

请教: 我的需求是将一个的确的ip地址段合并用于设定我们自己的路由. bestroutetb有代码实现这项功能,但我能力尚浅,看不懂.请问如何调用才能压缩这些ip地址? 请给一个例子,谢谢!

ashi009 commented 11 years ago

昨天刚更新过的中文说明,你可以参考一下。 https://github.com/ashi009/bestroutetb/wiki/%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E

bestroutetb需要两组互斥的ip段才能进行合并,比如14.20.0.0/16到网关A,14.28.0.0/16到网关B才可以。否则按照目前的算法,就会直接把合并结果提高到0.0.0.0/0。