Down script to fix route issue

Need help configuring your VPN? Just post here and you'll get that help.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
starcraftcats
OpenVpn Newbie
Posts: 7
Joined: Sat Dec 24, 2011 1:17 am

Down script to fix route issue

Post by starcraftcats » Fri Dec 30, 2011 3:07 pm

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.

User avatar
Mimiko
Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: Down script to fix route issue

Post by Mimiko » Sat Jan 07, 2012 6:31 pm

try

Code: Select all

%systemroute%\system32\route.exe

Post Reply