Connecting an Azure virtual network to an external VPN gateway - azure

I have a virtual network on Azure and would like to establish a VPN connection using the encryption details and shared key that I have received. All the Azure documentation that I've found for point-to-site and site-to-site VPN setups seem to not cover this case, but only cover how an external router can connect to a VPN gateway which has been created on Azure. Is the set up that I want possible with Azure virtual networks or do I need to configure the VPN connection on each VM that I want on the VPN?

You need to create a VNet-to-VNet connection as per this article

Related

Using Azure for VPN

We have a combination of people working from home and people in an office. The office internet has a static IP and the router allows people outside to VPN in. We use the static IP to allow restricted access to our own Azure & AWS resources, but also to clients Azure, AWS and on-site physical hardware.
We are moving to a multi tenancy office that provides a communal internet connection for all tenants.
We'd like to set up some form of VPN in Azure that employees can connect to, authenticated by their O365 accounts (already used to log into their machines), that allows both access to our azure, but also an onward static IP that we can provide to customers who use Azure, AWS or on-site physical hardware.
Note that: You can deploy a VPN gateway in Azure and create a site-to-site VPN with the on-prem VPN router and also another site-to-site connection between Azure and AWS, then configure P2S VPN on the same VPN gateway with AD authentication using Radius server.
I created an Azure virtual network along with gateway subnet and virtual network gateway, gateway type as VPN and VPN type as route-based like below:
You can see public ip, this public IP address will be used to configure on-premise VPN device
Created local network gateway like below:
Created site-to-site VPN connection between virtual network gateway and on-premises VPN device like below.
In Azure portal -> type connection;
In virtual network gateway, under setting -> Add connection like below:
And try to verify the connection in local network gateway like below:
You can view the connection in the virtual network gateway.
Reference:
Tutorial - Configure a BGP-enabled connection between Azure and Amazon Web Services (AWS) using the portal - Azure VPN Gateway | Microsoft Learn
https://learn.microsoft.com/en-us/azure/vpn-gateway/point-to-site-vpn-client-configuration-radius-password

VPN Gateway peering

I know Virtual network peering is a thing but just like that is VPN Gateway peering is a thing? if so then if a VPN Gateway(A) with AD AuthN(OpenVPN SSL tunnel type) and a VPN Gateway(B) with Azure certificate-based authN with SSTP(SSL) tunnel type, Can A and B be peered.
Questions based on above:
Do we have to do S2S peering setup between A and B with manual routing for each to access any resource from A to B and vice versa?
What is the limitation of this setup and advantages(if any)?
Will it be called a Hybrid solution?
If you have two VPN gateways in Azure, you could configure the VNet-to-VNet connections to connect Azure VNets to each other. You don't need manual routing. VNet-to-VNet supports connecting virtual networks. Connecting multiple Azure virtual networks together doesn't require a VPN device unless cross-premises connectivity is required.
When you connect a virtual network to another virtual network with a
VNet-to-VNet connection type (VNet2VNet), it's similar to creating a
Site-to-Site IPsec connection to an on-premises location. Both
connection types use a VPN gateway to provide a secure tunnel with
IPsec/IKE and function the same way when communicating. However, they
differ in the way the local network gateway is configured.
When you create a VNet-to-VNet connection, the local network gateway
address space is automatically created and populated. If you update
the address space for one VNet, the other VNet automatically routes to
the updated address space. It's typically faster and easier to create
a VNet-to-VNet connection than a Site-to-Site connection.
You could read the document for more details.

Azure OpenVPN appliance not traversing virtual network gateway

I deployed an openvpn virtual appliance and clients can reach peered networks, the VNET of the appliance itself, but not the network onpremise that is reachable via the virtual network gateway (routed VPN). When I use the P2S OpenVPN provided from Azure clients can reach onpremise network. What am I missing ?
I deployed an OpenVPN appliance because Azure OpenVPN lacks ccd support.
I solved the problem by adding the OpenVPN client IP range to the VNET address space. I then created a subnet with the same IP range. Obviously, you can't put any resource in this subnet. By then adding this subnet to the route, OpenVPN clients could traverse the gateway.
After my test on my windows client, I can directly access the on-premise network from the Azure VPN gateway based VNet or access the resources in the VPN based VNet from the on-premise network. You could follow these tutorials:
Configure a Point-to-Site connection to a VNet using native Azure certificate authentication: Azure portal
Set up OpenVPNĀ® Protocol on Azure VPN Gateway.
Configure OpenVPN clients for Azure VPN Gateway
I have not deployed an OpenVPN virtual appliance, but I think it will be something like this: Point-to-Site (P2S) connection using OpenVPN infrastructure
According to this quick start, If you use a virtual VPN appliance, It is necessary to create a routing table on Azure so that traffic to your VPN subnet is directed back to your VPN instance and enable IP forwarding for this network interface. You could get more details about custom routes.
Feel free to let me know if I am misunderstanding you.

Azure web app can't see VM through vnet-to-vnet connection

I have a VM running a WebAPI service that I want to hit from an Azure web app using a vnet-to-vnet conneciton. As such, I have the VPNs configured as follows:
Virtual Machine - VMVnet
Address Space: 10.1.0.0/16
Subnet: 10.1.0.0/24
Gateway Subnet: 10.1.1.0/27
Private IP: 10.1.0.4
I also opened the target port up in Windows Firewall.
Web App - AppVnet
Address Space: 10.2.0.0/16
Subnet: 10.2.0.0/24
Gateway Subnet: 10.2.1.0/27
I also have Virtual Network Gateways configured for both, each with a connection going to the other.
Now, after I connect the app to AppVnet and sync the routes from the app service plan's networking section, I should be able to hit the VM using its private IP from the app code. When I try, I get the following error:
An attempt was made to access a socket in a way forbidden by its access permissions
I also tried setting up Virtual Network Peering between the networks, but that didn't work either.
Is what I'm trying to do even possible with Azure web apps? I saw this question, which seemed like what I was looking for but the information in it is a bit lacking.
If not, I have tried this with a point-to-site configuration with the app connected to the VM's vnet, and it worked fine. Would it be preferable to set up a second nic on the VM using the AppVnet and connect all apps through that?
I'm just wondering why neither the vnet-to-vnet nor vnet peering works
with the web app
First of all, you need to know to Integrate your app with an Azure Virtual Network.
Here are some things to keep in mind before connecting your web app to
a virtual network:
If your target virtual network already exists, it must have point-to-site VPN enabled with a Dynamic routing gateway before it can
be connected to an app.
If your gateway already exists with point-to-site enabled, and it is not in the basic SKU, IKEV2 must be disabled in your point-to-site
configuration.
That is to say, you already have a P2S connection that you can connect to AppVnet from your App. If you want to connect to VMVnet through the AppVnet from your app, you can achieve it by gateway transit for virtual network peering in hub-and-spoke network architecture.
In the diagram, gateway transit allows the peered virtual networks to use the Azure VPN gateway in Hub-RM. In this case, your AppVnet is the Hub-RM. Your web app is the VPN client in a P2S VPN connection.
I am not sure that you real configuration in your side, but I guess your creating Vnet to Vnet connection is just like Hub-RM to Spoke-RM connection in the diagram, so it does not work. Setting up Vnet peering and gateway transit enabled, it should work. For more details about Configure VPN gateway transit for virtual network peering.

Azure Site-to-Site network bypassing VPN tunnel

I have a couple of queries about Azure VNet to On-Premises Site-to-Site networking -
As per Azure, Site-to-Site connection between On-Premises and Azure VNet should have a VPN tunnel. For this to happen there should be a VPN supported device at On-Prem and also a VPN Gateway at VNet. Is my understanding correct ?
Secondly, if a custom device capable of VPN functionality is deployed at On-Prem as well as a VM in Azure VNet, can they establish a connection between them without default Azure provided Site-to-Site VPN tunnel ? Is it possible to establish a network in Site-to-Site without VPN tunnel like with just igw's(Internet Gateways in AWS Cloud)?
What is the significance of next hop being "Internet" in azure route table ?
Yes. This device should also have a real external ip address, not behind the NAT.
Yes, you could use, say, Sophos to create VPN without using Azure's default VPN.
Internet. Represents the default Internet gateway provided by the Azure Infrastructure. (https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-udr-overview/)

Resources