Getting Access to Multiple Branches while Using a Split VPN Tunnel for Performance

IT

Getting Access to Multiple Branches while Using a Split VPN Tunnel for Performance

I recently had to help a client who was having performance issues over the VPN. They had a fast connection at home, but just a standard T1 line at the office for VPN access. When they got onto the VPN, they kept complaining about the performance while working on other items. When we unchecked the “Use default gateway on remote network” option, they were able to get better performance. However, they were unable to get to remote branches on the VPN. I searched multiple sites and merged the information from multiple places to come up with the following batch file:

——————

@echo off

@echo make sure to be disconnected!

set /p password= Input password:

cd

rasdial /d

@echo start to connect to vpnrasdial %password%

netsh interface ip show config name= | findstr “IP” > c:ip.dat

set /p ip=

del c:ip.dat

set ip=%ip:~-14%

@echo VPN IP is %ip% 

 

route add 192.168.1.0 mask 255.255.255.0 %ip% Metric 1

————-

Batch File Breakdown:

The batch file requests the user password as an input. I did this since the password keeps changing and so that they wouldn’t have to keep calling. It also prevents the password from being stored in the batch file for someone else to possibly see.

Next, it checks and disconnects the VPN if it is connected.

It then dials the . Please replace with the name of the VPN you are wanting to use that has the split VPN tunnel. Make sure to use quotes for the name if there is a space (e.g. “Split VPN”).

Since it was for a specific user, I placed his user name for the network in the spot.

It then dials that connection, polls the IP address of the VPN connection (since the default gateway is either blank or 0.0.0.0) and sets it up as a variable. Depending on the IP range you are using, you might need to adjust the settings on the “set ip=%ip:~-14%”. When I initially set this up and went through troubleshooting, I found that it was cutting off some of the IP address. I had to bump it up from the 12 value to a 14 value to get the initial 19 part of the 192 to fully populate.

It uses the IP that it pulled from the current VPN connection as the gateway for the destination network (branch office). Feel free to add as many routes as you have networks that are needing to be accessed. In the one I was working on, I had 10+ networks defined.

Finally, since the end user was an executive for the company, I added the batch file he used to use to re-map his network drives at the bottom of the file. I did this so he wouldn’t have to run something else when getting connected and working remotely.

More About the Author

Richard Clapp

Systems Engineer
Cleaning Up WinSXS Folder on Windows Server 2008 R2 I finally found some good information for cleaning up the WinSXS folder on new instances of Windows. I found the following site ...
Getting Access to Multiple Branches while Using a Split VPN Tunnel for Performance I recently had to help a client who was having performance issues over the VPN. They had a fast connection at home, but just a standard ...

See more from this author →

Subscribe to our newsletter

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072