Page 1 of 1

Down script to fix route issue

Posted: Fri Dec 30, 2011 3:07 pm
by starcraftcats
Am using Openvpn client on windows 7 laptop. After I disconnect from the vpn, my internet no longer works, even though my wireless is still connected.

I think this is a route issue... the route table in windows must not be refreshing. So I am trying to make a down batch file that can fix this that runs on disconnect of the vpn client. At the moment I can get a batch file to run but if I even just put
@echo off
route print
in it, I get:

Code: Select all

'route' is not recognized as an internal or external command,
operable program or batch file.
Fri Dec 30 23:01:24 2011 WARNING: Failed running command (--up/--down): returned error code 1
If I double click on the batch file it works, but it isn't working when the Openvpn client calls it. My client config just has:

Code: Select all

script-security 2
down down.cmd
in it.

I guess I would like to know what to add to the batch file so that upon running it, the route table is deleted and then restored. Or alternatively, the route table is delete and then the wireless connection is restarted. However the first option seems better, to just restore the working route table before the vpn was started.

Thanks for help.

Re: Down script to fix route issue

Posted: Sat Jan 07, 2012 6:31 pm
by Mimiko
try

Code: Select all

%systemroute%\system32\route.exe