Showing posts with label cmd route batch rasdial. Show all posts
Showing posts with label cmd route batch rasdial. Show all posts

Monday, September 15, 2014

vpn connect and route in single batch file;

Have made an batch that connects to vpn and add route

For security reason you should NOT plain password in batch file, and enter it each time you run script;

rasdial "connection name1" /disconnect
rasdial "connection name2" /disconnect 
rasdial "connection name1" "user" "pass"
route add -P 192.168.24.0/24 MASK 255.255.255.0 192.168.10.0 metric 21 -4
rem pause 

It disconnects previous vpn connections and should be runned as administrator