I have two Vnets in Azure that both have been configured with Virtual Gateways for Vnet-to-Vnet connectivity. Each Vnet has two subnets: 'Front', where a single VM is located, and 'GatewaySubnet', where the Gateway is located.
As a proof of concept, I want to:
- Configure forced tunneling so that all traffic originating from the VM in Vnet 1 is forced to Vnet 2.
- Configure IP forwarding on the VM in Vnet 2 so that all traffic to and from VM 1 is forwarded correctly.
I am using Azure Resource Manager, and I'm following these instructions to configure my User Defined Routes:
https://azure.microsoft.com/en-us/documentation/articles/virtual-network-create-udr-arm-ps/
Question 1
I understand I need to configure a route for the Front subnet in Vnet 1 such that:
$route = New-AzureRouteConfig -Name vnet1vpngateway -AddressPrefix 0.0.0.0/0 -NextHopType VirtualNetworkGateway
And I also understand I need to configure IP forwarding on VM 2 (located in Vnet 2), such that:
$nicvm2 = Get-AzureNetworkInterface -ResourceGroupName networkingRG -Name NICVM2 $nicvm2.EnableIPForwarding = 1 Set-AzureNetworkInterface -NetworkInterface $nicvm2
As far as routing goes, what else do I need to do?Do I need to add UDR to the Gateway Subnets on Vnet 1 and Vnet 2?
Question 2
When trying to run the following commands in PowerShell to add a routing table to the Front subnet in Vnet 1:
Set-AzureVirtualNetworkSubnetConfig -VirtualNetwork $vnet -name 'Front' -AddressPrefix 0.0.0.0/0 -RouteTable $table Set-AzureVirtualNetwork -VirtualNetwork $vnet
...I get the following error:
I do indeed have a subnet called 'Front' in my testVnet1:
Any idea of what is going on?