Private endpoint with virtual network gateway - azure

I want to make a Postgres DB available on-premise using a VPN / Virtual Network Gateway. I've created the Virtual Network Gateway with GatewaySubnet, the Local Network Gateway and the VPN Connection.
Now I want to create a private endpoint in the GatewaySubnet but I am getting the following errors:
Portal: "The selected subnet GatewaySubnet is restricted and cannot be used with a private endpoint"
or
ARM: "Subnet with name 'GatewaySubnet' can be used only for the Gateway resource."
Am I missing something? I thought the GatewaySubnet is exactly the Subnet that will be made accessible over the VPN?

The GatewaySubnet is a special subnet that contains the IP addresses that the virtual network gateway services use. Never deploy anything else (for example, additional VMs) to the gateway subnet. You can only leave it empty without any other resources deployed to this subnet.
When you deploy a VPN gateway in one Azure virtual network. With site-to-site VPN connection, all subnets in that VPN VNet could access the on-premise network because by default resources in all subnets in the same virtual network could communicate with each other. So you can deploy another subnet in the same VPN VNet used for your private endpoint.
See the diagram for using cases of Private Link for Azure Database for PostgreSQL

Related

Not able to select VNet gateway when creating local network gateway

I'm having problem when creating connection on Local network gateway.
when I'm creating connection the Vnet gateway is selectable but when i select it the Azure did not populate or actually select the gateway not sure why. is there any subscript do i needed or my vnet gateway is created incorrectly?
I tried to reproduce the same scenario in my environment wherein I tried with the Local network gateway to make connection with the Virtual network gateway, and it is successfully done. Please find the below snapshots for your reference.
I have created a Virtual network, a Virtual network gateway, a local network gateway in the same location and assigned the local network gateway a different virtual network subnet other than the one created earlier and assigned the virtual network gateway, the original one.
Vnet:
Virtual network gateway:
Local Network gateway:
The process is you need to add your connection in Virtual network gateway by below process:
When I add connection in virtual network gateway it created and reflected in local network gateway.
Reference:
Tutorial - Connect an on-premises network and a virtual network: S2S VPN: Azure portal - Azure VPN Gateway | Microsoft Docs

Can't reach Vnet using VPN gateway while peering is on

Hello ,
I have 2 Vnets, a Vnet containing Vms (Private Vnet)
a Vnet containing an Aks Cluster (Private but the pod I want to use is public (exposed using LB))
to Connect to Vnet1 from my local I'm using a Vpn Gateway but when I added I Network peering betweeen Vnet1 & Vnet2 , Suddenly I can't reach my private vms even when im connected to the vpn
although the peering between Vnet1 & vnet2 Is working just fine
I can reach my private vms from aks pods
here is my vnets/subnets
GatewaySubnet 172.17.1.0/24
default 172.17.0.0/24
my vpn config :
point to site
Address pool 10.0.0.0/16
Tunnel type IKEv2 and OpenVPN(SSL)
Active-active mode : disabled
Gateway Private IPs : disabled
VPN type : Route Based
and here is my peering configuration :
I don't know what is causing this
I hope somebody can guide me to the right direction
the "aks" vnet has an address space of "10.0.0.0/8" that overlaps with the VPN's Point to Site VPN client address pool.
Changing the adress pool of your p2s config will solve your problem

Can't add existing Virtual Network to Virtual network gateway in Azure

While creating the Virtual network gateway and selecting the vnet, it says the VNet is "in use".
VNET address space is 10.0.0.0/16
Any idea why I'm getting this error?
I created a new subnet and it has no devices connected to it.
The connected devices are not on GatewaySubnet.
I reproduce your scenario and it is working fine for me.
Below Point Should be notice before creating VNET Gateway
Gateway subnet address range: This field only appears if your VNet doesn't have a gateway subnet. It's best to specify /27 or larger (/26,/25 etc.).
Please check the same for Gateway Subnet address range from this MS doc: Tutorial - Create and manage a VPN gateway: Azure portal - Azure VPN Gateway | Microsoft Docs

Azure AKS vnet to another vnet communication

We have managed AKS Cluster and it has a few applications PODS. In the same subscription, we have a few servers in the different Resource Group and different VNET. We have a requirement to happen a communication between these two VNET's. I have configured vnet peering between two VNET's but we can see that the communication is not happening.
When I add a rule like "Allow port 443 from all networks" on to the NSG of Virtual machines then everything works fine.
Troubleshooting steps are done.
VNET Peering
Got an API Server IP Address from the "kubeconfig" file and added in the NSG of VM's in a diff RG.
But did not resolve an issue. Could you please help me to fix the issue.
AKS Resources are behind the Internal Load Balancer, so peering did not help. I had to use the Public IP Address provisioned during the AKS Creation process in the NSG. After adding PIP(Available in MC_rg-*** resource group) everything started working.
I would suggest to try connecting the VNET's through VPN gateways .
From an Azure virtual network, connecting to another virtual network is essentially the same as connecting to an on premises network via site-to-site (S2S) VPN.
You will need to go through the below listed steps :
Create VNetA and VNetB and the Corresponding Local Networks.
Create the Dynamic Routing VPN Gateways for each virtual network.
Connect the VPN Gateways.
Please find the referred document for implementing the same solution I have mentioned above .
For more information on difference of vnet peering and vnet gateway you can refer this document.

Connect to an on-premise network from an external computer via an Azure VPN Gateway

My goal is to connect from an external computer to both a Azure virtual network as well as a small on-premise network via an Azure VPN Gateway:
The Azure virtual network has the address range 10.1.0.0/16.
The on-premise network has the address range 10.2.0.0/16.
So far, I have done the following:
Set up a virtual gateway on the virtual network.
The virtual gateway is configured as a point-to-site VPN gateway.
The virtual gateway is connected to the on-premise network via a site-to-site connection.
So the topology looks like this:
VPN-client =p2s=> Azure =s2s=> On-premise
I can now dial in via VPN, but I can only ping addresses within the virtual network. On-premise addresses are not reachable.
I have also added the line
ADD 10.2.0.0 MASK 255.255.0.0 default METRIC default IF default
to the routes.txt file on the VPN client, but it's still not working.
This is not possible to achieve this.
Why
First, Azure VNet is a logic isolation and segmentation. Each virtual network is isolated from other virtual network.
When you try to connect the VNet Via P2S VPN, your client can communicate with resources in the VNet. But it cannot direct the traffic out of the VNet.
When you try to connect the VNet via S2S VPN, your site can communicate with the resources in the VNet.But it cannot direct the traffic out of the VNet.
Because they are using different Gateway and have different CIDR and Azure VNet cannot route the inbound traffic to one specify outbound gateway.
For Example
VNetA <peering or VPN gateway> VNetB <peering or VPN gateway> VNetC
But VNetA cannot communicate with VNetC
This is important for Azure VNet to reach isolation and segmentation.

Resources