Azure Point to Site VPN provides a secure and convenient way to access Azure resources remotely.
This feature allows users to establish a secure connection to Azure from anywhere, using their own devices.
With Azure Point to Site VPN, users can access Azure resources securely, even from public networks.
The connection is established through a VPN client, which is easily downloadable and installable.
Azure Point to Site VPN is particularly useful for developers, administrators, and other users who need to access Azure resources frequently.
Setting Up Connection
To set up a Point-to-Site VPN connection in Azure, you'll need a Resource Group to organize your resources. This is the foundation of your Azure setup.
A Virtual Machine is also required, which will serve as the central hub for your VPN connection. You'll need to create this from scratch.
In addition to the Virtual Machine, you'll need to create a Virtual Network (VNet) and Subnets. This is where your resources will be hosted, and it's essential for setting up your Point-to-Site VPN connection.
A Virtual Network Gateway is also necessary, as it enables secure communication between your client devices and the virtual network in Azure. This is a critical component of your Point-to-Site VPN setup.
To connect to your virtual network, you'll need to use an Azure VPN Client. This client will establish an encrypted connection to your virtual network, allowing you to access resources securely.
Here are the resources and tools you'll need to set up your Point-to-Site VPN connection in Azure:
- Resource Group
- Virtual Machine
- Virtual Network (VNet) and Subnets
- Virtual Network Gateway
- Azure VPN Client
Azure Configuration
To configure Azure for Point-to-Site (P2S) VPN, you'll need to create a virtual network gateway with a Public IP address. This IP address is statically assigned and only changes when the gateway is deleted and re-created.
You can request a Public IP address resource and refer to it when creating your virtual network gateway. The Public IP address is essential for the VPN gateway to function.
To start the configuration process, navigate to the virtual network gateway resource and click on the "Point-to-Site Configuration" under the settings section. From there, you can configure the necessary details, including the address pool, tunnel type, and authentication type.
Here are the key details you'll need to configure:
- Address pool: 10.1.3.0/27 (or any valid address range of your choice)
- Tunnel type: OpenVPN(SSL)
- Authentication type: Azure Active Directory
Create Resource Group
To create a resource group in Azure, start by naming it, as you would with "RGTEST1". This is the foundation for organizing your Azure resources.
The name should be unique to avoid conflicts with other users. You'll be creating every other resource in this group, so choose wisely.
In the example, the resource group name is "RGTEST1". This is a simple yet effective approach to organization.
Resource groups can be created using the Azure portal, Azure CLI, or PowerShell. The method you choose depends on your comfort level and workflow.
To get started, you'll need to create a resource group with a name that makes sense for your project. In this case, "RGTEST1" is a clear and concise choice.
Azure Configuration
To configure Azure for a Point-to-Site VPN, you'll first need to create a virtual network gateway. This involves requesting a public IP address resource, which will be statically assigned to the gateway. The public IP address won't change unless the gateway is deleted and re-created.
You can then configure the virtual network gateway resource by navigating to the Point-to-Site Configuration section under Settings. From there, click Configure now and fill in the required details, such as the address pool, tunnel type, and authentication type.
Azure supports various authentication types, including Azure Active Directory, and you'll need to provide your Tenant ID, which can be found in Microsoft Entra ID -> Properties. You'll also need to specify the audience and issuer, which are used to authenticate the connection.
To connect to Azure, you'll need to configure the Azure VPN Client on your client computers. This involves examining the profile configuration package and configuring the client for the specific operating system you're using, such as Windows, Linux, or macOS.
Here are the steps to create a P2S VPN in Azure:
- Create a Virtual Network
- Create Subnet(s) for Virtual Machines
- Create Virtual Machine(s) within the subnet in step 2 above
- Create a Gateway Subnet within the Virtual Network
- Create a Virtual Network Gateway after Step 3 above is complete
- Create the Root VPN certificate and client certificate using PowerShell commands
- Create the Client Certificate
- Configure Root Certificate on Gateway created in Step 5 above
- Download VPN Software after the certificate has been validated by Azure
The VPN software downloaded after Step 8 can be distributed along with the client certificate (PFX) to all clients who wish to connect to Azure VMs.
Protocols for
OpenVPN is an SSL/TLS based VPN protocol that can penetrate firewalls, making it a reliable choice for secure connections. It supports connections from Android, iOS, Windows, Linux, and Mac devices, as long as they meet the minimum version requirements.
Secure Socket Tunneling Protocol (SSTP) is a proprietary TLS-based VPN protocol that's only supported on Windows devices. This protocol can also traverse firewalls, but it's limited to Windows devices.
IKEv2 VPN is a standards-based IPsec VPN solution that uses outbound UDP ports 500 and 4500 and IP protocol no. 50. This protocol can be used to connect from Mac devices, but it may not be able to traverse proxies and firewalls.
Here's a summary of the supported protocols for P2S VPN:
It's worth noting that IKEv2 and OpenVPN are only available for the Resource Manager deployment model, and not for the classic deployment model.
Create the Gateway
To create the gateway for your Azure Point to Site VPN, you'll need to request a Public IP address. This IP address is statically assigned to the resource when the VPN gateway is created.
First, you'll need to create a gateway subnet within your virtual network. This is a crucial step in setting up your VPN gateway.
A VPN gateway must have a Public IP address, which is requested and then referenced when creating the virtual network gateway. This IP address is only reassigned when the gateway is deleted and re-created.
Here are the key steps to create the VPN gateway:
- Request a Public IP address
- Create a virtual network gateway
- Assign the Public IP address to the gateway
Remember, the Public IP address is only reassigned when the gateway is deleted and re-created, not during resizing, resetting, or other internal maintenance/upgrades.
Certificate Management
Certificate management is a crucial aspect of Azure Point-to-Site VPN. You can generate root and client certificates using PowerShell, which is essential for authentication.
To create a root certificate, you need to use the New-SelfSignedCertificate cmdlet. This cmdlet creates a new self-signed certificate with the specified parameters, including the subject name, key export policy, and hash algorithm.
You can identify the self-signed root certificate installed on your computer using the Get-ChildItem cmdlet. This cmdlet returns a list of certificates installed on your computer, and you can locate the subject name and thumbprint of the root certificate.
Here's a list of steps to generate a root certificate:
1. Identify the self-signed root certificate using Get-ChildItem.
2. Declare a variable for the root certificate using the thumbprint.
3. Modify the New-SelfSignedCertificate cmdlet to generate a client certificate.
The exported certificate will be used to upload the public key information to Azure. You can export the certificate as a .cer file using the Certificate Export Wizard.
To upload the root certificate public key information, you need to declare a variable for the certificate name, replace the file path with your own, and run the cmdlets. You can then upload the public key information to Azure using the Add-AzVpnClientRootCertificate cmdlet.
Here's a list of steps to upload the root certificate public key information:
1. Declare the variable for your certificate name.
2. Replace the file path with your own and run the cmdlets.
3. Upload the public key information to Azure using the Add-AzVpnClientRootCertificate cmdlet.
Note that you can't upload the .cer file using Azure Cloud Shell, and you need to use PowerShell locally on your computer or the Azure portal steps.
Authentication and Authorization
Azure AD authentication is required for enabling VPN tunnel type, and it's essential to use a trusted root certificate to generate client certificates. Client certificates are validated by the VPN gateway during P2S VPN connection establishment.
To authenticate users, Azure offers three options: Native Azure Certificate Authentication, Azure AD Authentication, and AD domain authentication. Azure AD Authentication allows users to connect to Azure using Azure Active Directory credentials.
Here are the three authentication options available in Azure:
- Native Azure Certificate Authentication: uses client certificates to authenticate users
- Azure AD Authentication: allows users to connect to Azure using Azure Active Directory credentials
- AD domain authentication: allows users to connect to Azure using their organization domain credentials
Azure AD Authentication also supports conditional access and Multi-factor Authentication features for VPN.
User Assignment
User assignment is a crucial step in controlling access to your Azure VPN application. You can set it to require user assignment, which means users and other apps or services must be assigned to the application before accessing it.
If you set user assignment to yes, all users will not be able to sign in automatically. Instead, they must be assigned to the application first. This setting only applies to specific types of applications and services, including those using SAML, OpenID Connect, OAuth 2.0, or WS-Federation for user sign-in.
To select a group for assignment, you might need to upgrade your Azure Active Directory (AAD) plan to P1 or P2. If you can't upgrade, you'll have to use selected users to grant assignment.
Frequently Asked Questions
What is the difference between point to point and site-to-site VPN?
Point-to-site VPNs don't require a public-facing IP address or a VPN device, whereas site-to-site VPNs do. This makes point-to-site VPNs a more flexible option for remote access
How to configure point to point VPN connection?
To configure a point-to-site VPN connection, start by creating a subscription on the Azure portal and follow the subsequent steps to set up a virtual network, virtual machine, and virtual network gateway. This process typically involves 5 steps, beginning with creating a subscription and ending with setting up a virtual network gateway.
What is point-to-point VPN in Azure?
A Point-to-Site (P2S) VPN in Azure is a secure connection from an individual client computer to your virtual network. It's established directly from the client computer, providing a convenient and secure access to your Azure resources.
What is required on P2S client devices in order to authenticate to the Azure VPN?
To authenticate to the Azure VPN, P2S client devices require a client certificate. This replaces the need for the Azure VPN app and MFA app.
Sources
- https://dev.to/gabbyti/cloud-safety-how-to-establish-azure-point-to-site-vpn-connections-3e
- http://blog.51sec.org/2022/01/azure-point-to-site-vpn.html
- https://www.dclessons.com/azure-point-to-site-vpn-its-routing
- https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/vpn-gateway/point-to-site-entra-gateway.md
- https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/vpn-gateway/vpn-gateway-howto-point-to-site-rm-ps.md
Featured Images: pexels.com