Solved

Auto connect to VPN when connection is lost

Posted on 2008-10-24
3
491 Views
Last Modified: 2012-05-05
Hi,

I have a SBS 2003 server (server 1) connection to a 2003 R2 Server (server 2) via VPN. The line works well, but occasionally the connection is dropped due to restart of the target server (Server 2).

I have checked the box (redial if line is dropped) in the VPN configuration, but this does not do anything, when the target server is restarted. Probably because of the long period of time (about 10 min.). Then we have to etablish the connection again manually.

Is there somewhere, where I can aks the connection to always redial?

If this is not possible I am thinking about making a script and make it run each 10 minutes from the taskmanager. This script shuld check if there is a connection - and if not dial up the connection. The script is probably pretty simple, but I don't know anything about making scripts. Can anyone help me?

Thanks!
   
0
Comment
Question by:sjaller
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Expert Comment

by:Werrock
ID: 22794581
You can use "rasdial VPNNAME USER PASSWORD"

A script could look like this if your vpn will creates a new IP starting with 192.168.10. This will check the connection every 30 sec.

:start
ipconfig | findstr "196.168.10"
if %ERRORLEVEL% == 0 goto :wait
rasdial.exe VPNNAME USER PASSWORD
:wait
sleep 30
goto start
0
 

Author Comment

by:sjaller
ID: 22795422
Thanks,

I have made a scriptfile like you suggested with succes. ONLY I HAD TO MAKE ONE CHANGE since the command "sleep 30" does not exist. I replaced the command with the following "fake command just to make it wait - each line takes 5 seconds to process, so now i waits for 30 seconds"

ping 1.0.0.0 -n 1 -w 5000 >NUL
ping 1.0.0.0 -n 1 -w 5000 >NUL
ping 1.0.0.0 -n 1 -w 5000 >NUL
ping 1.0.0.0 -n 1 -w 5000 >NUL
ping 1.0.0.0 -n 1 -w 5000 >NUL
ping 1.0.0.0 -n 1 -w 5000 >NUL

If you agree with my method, please post again with corrected script, then I will accept that as solution.
0
 
LVL 6

Accepted Solution

by:
Werrock earned 250 total points
ID: 22796114
Yes, I'm sorry that sleep did not work. The command sleep a part of Windows 2003 Resource Kit which i happened to have installed. Your solution is good enough and you can find a similar solution at:
http://malektips.com/dos0017.html
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VMware ESXi 5.5 - Remote Latency via VPN 2 90
RDP Sonicwall 8 100
URGENT- Can't login to Bizportal over VPN 2 43
Incredibly slow speeds while testing on server in China? 5 82
Secure VPN Connection terminated locally by the Client.  Reason 442: Failed to enable Virtual Adapter. If you receive this error on Windows 8 or Windows 8.1 while trying to connect with the Cisco VPN Client then the solution is a simple registry f…
I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question