Routing of non VPN traffic - a solution
Posted: Sun Dec 20, 2015 2:07 pm
I have the client set up in Windows, connecting via TCP to a server in another location. Server DHCP set up with defaults, 192.168.30.0/24 subnet, routing to local network of 192.168.254.0/24
I only want traffic for 192.168.254.0/24 subnet to go through VPN.
I found creating a batch file with these routes solved the problem. Batch file has to be run with admin privileges:
@echo on
route add 192.168.254.0 mask 255.255.255.0 192.168.30.1
pause
route add 0.0.0.0 mask 0.0.0.0 192.168.1.254 metric 1 if 4
pause
The pause enables me to check if the route add command has worked.
In addition, I set the metric for the network adapter to 1, and the virtual adapter as 100 , but I'm not sure if that had any effect.
The batch file needs to be run after you connect.
I only want traffic for 192.168.254.0/24 subnet to go through VPN.
I found creating a batch file with these routes solved the problem. Batch file has to be run with admin privileges:
@echo on
route add 192.168.254.0 mask 255.255.255.0 192.168.30.1
pause
route add 0.0.0.0 mask 0.0.0.0 192.168.1.254 metric 1 if 4
pause
The pause enables me to check if the route add command has worked.
In addition, I set the metric for the network adapter to 1, and the virtual adapter as 100 , but I'm not sure if that had any effect.
The batch file needs to be run after you connect.