ras_init.vbs: Override And Restore Routes With Windows RAS
When initiating a PPP/PPTP connection through Windows RAS you will usually end up with an altered network default route which will redirect all and every traffic through PPP/PPTP.
There are many cases however where such a behaviour is simply not desired, considering Windows RAS providing you with no way to circumvent this, you’re on your own for once more.
I wrote this script, ras_init.vbs, out of the requirement to restore my default route for normal connections and route only specific hosts and networks through PPP/PPTP.
ras_init.vbs is released under the terms of the GNU GPL, version 2. Any feedback is appreciated.
Note: Some time in the past the code of release 0.3 has been lost. As this script is not actively maintained any more, I will not invest time to redo the bugfixes.
The script would need to undergo a major rewrite, maybe in PowerShell, to work on Vista/Windows 7/Server 2008 anyway.
- fixed a bug with wrong RAS_Routes array enumeration
- changed script to figure out language settings on its own
- addedd support for RAS_Name, RAS_User and RAS_Pass attributes to include whitespace characters
- added support for Windows Vista (requires administrative privileges though)
- add support for interactive/non-interactive mode
- initial release
- tested on Windows 2000/XP
- searches through all interfaces and looks for the expected RAS subnet address
- removes RAS default route and replace it by your local default route
- optionally set up host/network routes for routing through RAS