clowwindy / ShadowVPN

Removed according to regulations.
1.47k stars 1.06k forks source link

routes mutation tool #143

Closed icylogic closed 9 years ago

icylogic commented 9 years ago

By now there is no script for applying routes on Windows. The scripts generated by chnroutes.py execute thousands of lines of commands like route add .... There are more than 5000 lines of chnroutes and this scripts would take several minutes everytime. (I've not tested provided scripts on Linux yet, but it seems to use the same method.)

I found that some would use cmroute.dll to add/delete routes, which apply the entire chnroutes in less than a second.

Furthermore, considering you have mentioned that this util will provide several strategies to mutate routes table, such as Whitelist(chnroute), Blacklist(foreign) and maybe the combination (bestroutetb) that offer more settings like country selection while the structures will be more complex (multiple interfaces?), users may need a convinient and fast tool to switch/backup/restore routes. What's more, they could even simply change one line in a configuration file to select strategy without maintaining the routes table themself. This tool may be a single script that use different methods to mutate on different platforms. I'd recommend using cmroute.dll as the basic on Windows.

If you are interested in this, I could open an pull request to add chnroutes script with the dll.