Azure Virtual network gateway - azure

We have successfully setup the VPN Tunnel from our On-premise DC to Azue Vnet (Let say VNet1) and now we are trying to access another VNet (Let say VNet2) which is connected to VNet1 via peering but we are unable to access VNet2 from our On-premise N/w. Please let me know if you have any solution for this.

You can enable "Allow transit" when within create VNet peering.
Please see following site:
Azure Virtual Networks - Transit Routing - Between IPsec & VNet Peering
https://social.technet.microsoft.com/wiki/contents/articles/35830.azure-virtual-networks-transit-routing-between-ipsec-vnet-peering.aspx
VNet Peering and Gateway Transit with S2S VPN
http://www.deployazure.com/network/virtual-network/vnet-peering-and-gateway-transit-with-s2s-vpn/

Related

Advertise Spoke Routes to on-prem via Azure ExpressRoute in a Hub and Spoke Topology

I have a hub VNET peered to a spoke VNET in a hub and spoke topology with the hub connected to on-prem via an expressroute connection:
allow_forwarded_traffic = true
allow_gateway_transit = true
Connectivity from the hub vnet to the on-prem network is fine.
The problem is I can only see the On-premise and Hub VNET Routes in the ExpressRoute Circuit Route table but not the spoke routes.
This means on-prem will not know of the spoke networks as they gradually get added to the hub.
What must be done to automatically have the VNET address space for the spoke networks get advertised down to on-prem via the ER Gateway ?
As mentioned in the ExpressRoute FAQ doc,
The ExpressRoute gateway will advertise the Address Space(s) of the Azure VNet, you can't include/exclude at the subnet level. It's always the VNet Address Space that is advertised. Also, if VNet Peering is used and the peered VNet has "Use Remote Gateway" enabled, the Address Space of the peered VNet will also be advertised.
You have mentioned that: allow_forwarded_traffic = true & allow_gateway_transit = true --> these options are for the Hub Vnet peering
I would request you to validate the spoke Vnet peering configuration. It should have:
allow_forwarded_traffic = true & Use_Remote_Gateways = true.
If you have created the peering via Azure Portal, please make sure that "Use the remote virtual network's gateway or Route Server" option is selected on the spoke Vnet peering as below:
Refer: https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-peering-gateway-transit
If you have created the peering via Azure PowerShell or Azure CLI, please make sure that "-UseRemoteGateways/--use-remote-gateways" have been added on the spoke Vnet peering.
Refer: https://learn.microsoft.com/en-us/powershell/module/az.network/add-azvirtualnetworkpeering?view=azps-9.2.0
https://learn.microsoft.com/en-us/cli/azure/network/vnet/peering?view=azure-cli-latest#az-network-vnet-peering-create
Once the "Use Remote Gateway" option is enabled on the spoke Vnet peering, the ExpressRoute gateway should advertise the spoke Vnet address space to your on-prem.
If this option is already enabled and still the spoke Vnet range is not advertised, I would recommend you to delete and re-create the Vnet peering between the Hub Vnet and Spoke Vnet with the gateway transit and remote gateway options.

Make request to on-prem service through "transit" vNet

I have an Azure vNet A that is peered to the on-prem network. I want to make a TCP request to on-prem service from another vNet B. Is it possible to use vNet A as "transit" network to redirect traffic to the on-prem service? The restriction is vNet B cannot use peering, virtual kubelet doesn't support it.
If you can't use VNET peering try to deploy Virtual Network Gateway in vNetB. Then connect
vNetA and vNetB gateways using VNet-2-VNet connection type.

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.

Question concerning forward traffic on Azure Virtual Networks

I have a routing problem which I am struggling to solve in the Azure cloud platform concerning traffic that needs to be routed from one vnet to another vnet via another vnet and two VPN tunnels.
Here is a description of the set-up:
I do have two Azure Virtual Networks (VNET1 and VNET2) that each one has its own route-based Azure VPN Gateway and one 3rd party virtual network (VNET3) which is connected to the first Azure virtual network VNTE1 via an IPsec VPN tunnel. Below are the address spaces of all 3 virtual networks.
VNET1 10.20.0.0/16 (Azure vnet)
VNET2 10.30.0.0/16 (Azure vnet)
VNET3 10.0.0.0/12 (3rd party vnet)
Here is what I can do:
The VNET1 is connected via an IPsec VPN tunnel with the VNET3. Thus I am able to ping from a VM in the VNET1 10.20.10.5 a VM in the VNET3 10.0.0.1 and they can ping me back.
The VNET1 is connected via an IPsec VPN tunnel with VNET2. Thus, I am able to ping from a VM in the VNET1 10.20.10.5 a VM in the VNET2 10.30.10.5
Here what i cannot do:
I cannot ping from a VM in the VNET2 10.30.10.5 the VM in VNET3 10.0.0.1.
Here is what I tried to do to solve the problem without any success so far:
My assumption is that the network VNET2 does not know how to route the traffic to the network VNET3. Thus, I created an Azure Route table and I assigned the route table to the subnet 10.30.10.0/24 and I created the rule that all the traffic to the network 10.0.0.0/12 should be routed to the VPN GateWay of the VNTE2. My expectation is that once the traffic will go to the GW it will reach the VNET1 which knows how to route it to the VNET3. This didn't work.
Although I think is not needed since VNET1 already knows how to route the traffic to the VNET3 I have also created a routing table for 10.0.0.0/12 similar to the one above. This didn't help either.
Am I missing a route somewhere, If so which rule and where? Or do I even need to have a VM acting as a router? (I hope not)
I think your issue is the limitation of Azure Virtual Gateway:
The on-premises networks connecting through policy-based VPN devices with this mechanism can only connect to the Azure virtual network; they cannot transit to other on-premises networks or virtual networks via the same Azure VPN gateway.
https://learn.microsoft.com/en-us/azure/vpn-gateway/vpn-gateway-connect-multiple-policybased-rm-ps
So, even if you use the same VPN Gateway to connect with VNET 3 and VNET 2, by design VNET 3 and VNET 2 cannot communicate.
To resolve this issue, I recommend to use peering. Your configuration is similar to classic Hub-Spoke topology. Your VNET1 is Hub, VNET2 is Spoke, VNET3 is kind of "on-prem".
No changes needed to configuration between VNET1 and VNET3. You need to establish peering between VNET1 and VNET2 and backwards and apply following configuration:
Configure the peering connection in the hub to allow gateway transit.
Configure the peering connection in each spoke to use remote gateways.
Configure all peering connections to allow forwarded traffic.
https://learn.microsoft.com/en-us/azure/architecture/reference-architectures/hybrid-networking/hub-spoke
In this case, VNET3 will be able to communicate with HUB (VNET1) and all spokes (VNET2 and any others connected to VNET1). VNET2 can communication with HUB (VNET1) and on-prem (VNET3) when the tunnel is up.
Warning: Spokes are not able to communicate between each other without a forwarding gateway in HUB, i.e. if you add VNET4 with peering to and from VNET1, VNET4 will not able to ping VMs in VNET2. But they could communicate with HUB and on-prem without any additional appliances.

Accessing resources from connected Azure VNETS via VPN

I have two virtual networks that each have their own virtual network gateway (VNET1 and VNET2). I have connected them with VNET to VNET connections. All resources in each VNET can see each other via PING as well as RDP so I know the VNET to VNET connection is working properly.
I also have a Point to Site configuration setup on VNET1 which allows me to VPN from my onsite premise. When I start up the VPN connection, I can see everything in VNET1, but I cannot see anything in the other VNET (VNET2).
Shouldn't I be able to see resources from both VNETs regardless of which VNET I've established my VPN connection with since they are connected to each other?
For your issue, you can use connect VNET1 to on-premise with VPN, and connect VNET1 to VNET2 with peering, but if you want to connet VNET2 from on-premise through VPN, you have to set up gateway transit in both VNET.
You can finish you work following the document Configure VPN gateway transit for virtual network peering and you will get what you want.

Resources