Azure , connecting two virtual machines without using virtual network gateway? - azure

How to connect two virtual machines without using virtual network gateway in azure??
(The two vm's have been created in two different virtual networks)

Well, This are different Connectivity scenarios for Vnet to Vnet in Azure, and then you can connect your VMs from each other:
VNets are in a same location: Create a virtual network peering. It can work on different deployment models and subscriptions, but except different locations. Peering doesn't need Vnet gateway.
VNets are in different locations:Create a VPN Gateway to connect different VNets. This work on all different Vnets from different deployment models , subscriptions, locations.This need to create VPN gateway.
VNets are in different locations:You can use VPN software on your VM to connect each other if your VMs are in different location. This also doesn't need Vnet gateway.
VNets are in different locations:You can also add IIS service on your VMs, and you can connect VMs from public traffic.
If your Vnets are in same location , creating Vnet peering is best choice.

Related

How to Create Network Connection between two existing VM in Azure Portal

I have Two Azure VMs which has been created for about 6 months now. The VMs are in use by different members of the same project teams, now I want to know how I can network the VMs together (for direct transfer of large files) without having to delete and recreate them.
#faruq bello If the VMs are in the same Virtual Network you should be able connect them without any additional configuration, if not please check the NSG rules or firewall on the VMs to see if it is blocking any connectivity.
If they are not in the same virtual network I think you can establish connectivity by using Virtual network peering in this scenario. If the VMs are in the same Azure region you can use Virtual network peering and across Azure region you can use Global virtual network peering. Please be aware of constraints for globally peered virtual networks.

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.

Routing traffic in Azure VPN

I have 3 VNets, 3 Point-2-Site VPN Gateways, one for each Vnet, and VNet peering is setup as below image.
What I want to achieve is:
If I use VPN1, I can ping all VMs in all 3 VNets.
If I use VPN2, I can only ping VMs in VNet 2 and 1.
If I use VPN3, I can only ping VMs in VNet 3 and 1.
As I understand, to achieve 1, I have to allow forwarded traffic in both peering. But then, 2 and 3 cannot be fulfilled - I can ping all VMs regardless what VPN I use. Is that correct?
What should be the right way to do this?
Update: For more details, here's my use case:
In VNet 1, I have an Intranet server, which should be available for everyone.
In VNet 2, I have a development server.
In VNet 3, I have a test server.
A manager should be able to access all servers --> VPN1.
A developer should be able to access the Intranet and the Dev server --> VPN2
A tester should be able to access the Intranet and the Test server --> VPN3
For your requirements, I believe you could achieve it via configuring VPN gateway transit for virtual network peering a hub-and-spoke network architecture. In this network architecture, you need to deploy one VPN gateway in the VNet1(as the hub) and peer with the other two VNets(as the spoke) instead of deploying VPN gateways in every spoke virtual network. Routes to the gateway-connected virtual networks or on-premises networks will propagate to the routing tables for the peered virtual networks using gateway transit.
The following diagram shows how gateway transit works with virtual network peering.
In this case, you could configure the VNet1 peers with VNet2 and VNet1 peers with VNet3 each other.
On the peering from VNet1 to VNet2 and VNet1 to VNet3, enable the Allow gateway transit option. On the peering from VNet2 to VNet1 and VNet3 to VNet1, set the Use remote gateways option.

Azure Virtual Network Gateway - Access resources in other resource groups

Let's take the following scenario:
I have a resource group in the East Region with 1 VM
I have a resource group in the West Region with 1 VM
Both of these VMs are only accessible via Private IP addresses. RDP via Public IP address is not an option. One would assume that in order for me to RDP to these machines, I would have to VPN into Azure's gateway first. However, I don't want to create a virtual gateway in every single resource group.
Is it possible for me to vpn into one resource (in one resource group), and access all of the machines in all other resource groups?
Yes, It's possible to do this with VNet peering(connecting VNets within the same Azure region). You could follow this to implement a hub-spoke network topology in Azure. In this case, the hub VNet is a peering VNet with allow gateway transit enabled and the spoke VNet is a peering VNet with use remote gateways enabled.
please note that you cannot use remote gateways or allow gateway transit with global peering(connecting VNets across Azure regions). Refer to requirements and constraints about global peering.
To use remote gateways or allow gateway transit, peered virtual
networks in must be in the same region.
so you have to move the peering VNets in the same region if the two VNets in each resource group are not in the same region.
Another option will create a separate VPN gateway in another resource group but this is not your expectation. Note that
A Point-to-Site client can only connect to resources in the VNet in
which the virtual network gateway resides.
Refer to VPN gateway FAQ.
You can use vnet peering with Use remote gateways checkbox enabled. You need to peer the vnets together and check use remote gateways on the second vnet (one without gateway).
Reading:
https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/hybrid-networking/hub-spoke
https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-peering-overview

Can't Access Azure Application Gateway through peered VNET

I have two peered VNETs in Azure and I also have an Application Gateway in one of them. I have a couple VMs inside both VNETs and I want to access the Application Gateway from the VMs by its private IP (which is set up). This works from the VNET that the gateway resides in but I can't access it from the other peered network. I can access all the VMs between the networks by their private IPs no problem. What can I be missing? (I am not really that familiar with networking, so it can be something basic...).
Thank you for any suggestion!
You can check if the two peered virtual networks are located in a different region.
If you are using a Global Vnet peering(Vnet to Vnet region is different), there are some limitations that you can not use Global Vnet peering to communicate with VIPs of load balancers in another region. Application Gateway is actually a layer-7 load balancer.
Resources in one virtual network cannot communicate with the IP
address of an Azure internal load balancer in the peered virtual
network. The load balancer and the resources that communicate with it
must be in the same virtual network.
References: How to setup Global VNet peering in Azure
APIM is a service based on Azure Load balancer. For Stv1 APIM Azure uses Basic Load balancer which does not allow traffic via global peering.
[Refer this][1]
In order to facilitate traffic via global peering need to use stv2 APIM.[Refer this][2]
[1]: https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-manage-peering?tabs=peering-portal#requirements-and-constraints
[2]: https://learn.microsoft.com/en-us/azure/api-management/virtual-network-concepts?tabs=stv1#network-resource-requirements

Resources