Jump to content
Sign in to follow this  

VPN Connection Error

Recommended Posts



I'm using a VPN to connect to my cable/lan but the problem is that sometimes the connection remains active(?), but there is nothing being downloaded. It is only after disconnecting and connecting the damn connection again that anything can be downloaded. This is specially frustrating when you wake in morning and see nothing has been downloaded.

I've googled a lot but can't find any software which can do what i want. So, i was wondering if anyone can help me with a script which can do that. Also, i was using the script given by a friend(as below) for this but since 3 days its also not working. When the script starts automatically, its giving the error "Destination net unreachable", where as previously it connected the connection.

Any help please? :blink:


Ping www.yahoo.com -t  -n 10 | find "Reply"
if errorlevel 1 echo Ping Failed && goto loop
goto ling

rasdial "connection name" /DISCONNECT
Echo Trying to Dial up..................................
rasdial "connection name" username password

if errorlevel 1 goto failed
goto ling


Echo Failed to connect......will retry

goto loop

Share this post

Link to post
Share on other sites

I wonder if you can incorporate a "ping loop" after the connection is created in order to keep the connection alive. Just be careful with which server you ping and how often... It works with my Cisco VPN connection and it will basically stay open (and pass data) until the server is reset unless the server has rules in effect that would otherwise disconnect you after a certain period of time, I chose an IP that was only reachable when the connection was active.

Another suggestion is increase the amount of time between disconnecting and reconnecting, for me, with Cisco IPSEC, have to wait 30 seconds before attempting to reconnect right after a disconnect.

Also, your ping command includes "-t" which means no timeout and "-n 10" which means send echo request 'n' number of times. The command as-is is saying "ping yahoo.com an unlimited number of times and 10 times" - you could just get rid of both arguments and let ping go its default of 3 tries.

Do you plan on keeping this in BATCH or transitioning to AutoIt if you can?

I'm not familiar with rasdial but if I find a way to have AutoIt start up that connection I will post. Good luck.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this