Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Virtual Network Point-to-Site (ex. Azure Connect) autoconnect

While Azure Connect is being retired and Azure Virtual Network provides similar feature with better speed, i've noticed few drawbacks though.

Azure Connect was capable of maintaining connection automatically, without user even having to log in. Azure Virtual Network however requires user to interactively connect/reconnect to VPN. This makes it quite unusable in production environment. Are there any ways to overcome this obstacle?

like image 864
Bas van Rossum Avatar asked Jul 08 '13 10:07

Bas van Rossum


People also ask

Which two options can you use to connect Azure virtual networks VNets to each other?

There are three ways that you can connect applications in two different Azure VNets: Route via the Internet. VNet peering. Site-to-site VPN.

How do I link my Azure virtual networks to each other?

Connecting Two VNets in the Same SubscriptionCreate the virtual networks and matching local networks with cross premises connectivity. Create the Azure Dynamic Routing VPN gateways for the virtual networks. Connect the virtual networks together.


1 Answers

To solve this problem you can use rasdial. First time i used rasdial i run into this problem: This function is not supported on this system. Don't get fooled by this message because its just that you didn't give the correct syntax.

rasdial "Your VPN name" /phonebook:%userprofile%\AppData\Roaming\Microsoft\Network\Connections\Cm\Your-VPN\Your-VPN.pbk"
  • %userprofile% is de user profiel you used to install Azure vpn with.
  • Your-VPN is de name of the azure vpn connection.

A simpel methode is to make a batch script:

SET VPN_NAME=azureVPN
:loop
rasdial %VPN_NAME% /PHONEBOOK:C:\Users\bas\AppData\Roaming\Microsoft\Network\Connections\Cm\%VPN_NAME%\%VPN_NAME%.pbk
timeout 10
goto loop

result will be:

Connecting to test...
Verifying username and password...
Registering your computer on the network...
Successfully connected to test.
Command completed successfully.

after 10 seconds:

You are already connected to test.
Command completed successfully.

To let this script start when the computer starts use the taskscheduler.

like image 111
Bas van Rossum Avatar answered Sep 30 '22 04:09

Bas van Rossum