V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
fangdingjun

我优化后的 chnroute windows 下添加路由的脚本

  •  
  •   fangdingjun · Jan 5, 2015 · 9539 views
    This topic created in 4130 days ago, the information mentioned may be changed or developed.

    原来程序生成的脚本是使用route命令一条一条添加路由,添加5000多条路由在我的机器上要执行120秒,
    我改成了生成一个临时netsh脚本,使用netsh -f执行,大概只要10s(不支持 XP)

    使用方法

    python chnroutes.py -p netsh
    

    将会生成 add_route.bat和 del_route.bat两个脚本

    修改后的脚本生成程序
    https://raw.githubusercontent.com/fangdingjun/chnroutes/master/chnroutes.py

    测试脚本:
    添加路由脚本
    https://www.ratafee.nl/add_route.bat

    删除路由脚本
    https://www.ratafee.nl/del_route.bat

    3 replies    2016-05-23 17:46:36 +08:00
    yywudi
        1
    yywudi  
       Jan 5, 2015
    这个配合VPN使用是极好的。
    不过现在都在浏览器里用ss+PAC,其他程序有需要翻墙的用127.0.0.1:port 设代理
    基本不用VPN了
    jkingben
        2
    jkingben  
       Aug 23, 2015
    非常好,不过在 python3.4 下,脚本 API 有点变动
    jitongxi
        3
    jitongxi  
       May 23, 2016
    很牛逼啊,这个效率绝对高
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6006 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 84ms · UTC 03:31 · PVG 11:31 · LAX 20:31 · JFK 23:31
    ♥ Do have faith in what you're doing.