How to Resolve Azure Network Configuration Issue for Routing VM Traffic to Internet through another VM

Philippe DA SILVA OLIVEIRA 0 Reputation points
2024-01-28T13:58:06.94+00:00

Hello, I am currently facing a network configuration challenge on Microsoft Azure, and I'm seeking assistance in resolving the issue. I have set up two Windows virtual machines in one subnet, and another Windows virtual machine (VM-Gateway) in a separate subnet. The goal is to route outgoing traffic from the two VM Windows through VM-Gateway to the Internet. I have activated the Routing and Remote Access Service (RRAS) on VM-Gateway, but unfortunately, I haven't been successful in configuring it to achieve the desired routing. I've also configured a User Defined Route (UDR) to redirect all traffic (0.0.0.0/0) to the IP address of VM-Gateway, and the VM-Gateway has been set up with functional Internet access. Despite these efforts, the traffic from the VM Windows does not seem to be passing through VM-Gateway to the Internet as intended. I have reviewed the configurations of VM-Gateway, routes, and Network Security Groups (NSGs), but I'm unable to pinpoint the issue. If anyone has experience with RRAS or insights into what might be causing issues in my configuration, I would greatly appreciate any assistance or advice you could provide. Thank you in advance for your valuable help!

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,772 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Andreas Baumgarten 123.5K Reputation points MVP Volunteer Moderator
    2024-01-28T15:47:25.15+00:00

    Hi @Philippe DA SILVA OLIVEIRA,

    did you select Enable IP forwarding on the VM-Gateway VM in the network settings?

    enter image description here


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten


  2. GitaraniSharma-MSFT 50,096 Reputation points Microsoft Employee Moderator
    2024-01-30T13:26:27.52+00:00

    Hello @Philippe DA SILVA OLIVEIRA ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that you are trying to route traffic from your Azure VMs to Internet via a NVA machine in another subnet but even after adding UDR and enabling IP forwarding, the traffic is not going through.

    You can refer the below tutorial with a similar setup to understand the requirements and how it works:

    https://learn.microsoft.com/en-us/azure/virtual-network/tutorial-create-route-table-portal

    Since you mentioned that the UDR is already in place and the VM-Gateway already has IP forwarding enabled, the only thing I could think of is that IP forwarding is not enabled in the VM's operating system.

    As mentioned in the below doc:

    While IP forwarding is an Azure setting, the VM must also run an application that's able to forward the traffic, such as a firewall, WAN optimization, or load balancing application.

    Refer: https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-network-interface?tabs=azure-portal#enable-or-disable-ip-forwarding

    You mentioned that you've activated the Routing and Remote Access Service (RRAS) on VM-Gateway, but I would request you to validate if the RRAS server has the IPv4 forwarding enabled.

    1. Right-click Routing and Remote Access, and then click Properties.
    2. On the IPv4 tab, select Enable IPv4 Forwarding, and then click OK to save your changes.

    Refer: https://learn.microsoft.com/en-us/archive/msdn-technet-forums/ce1d2eb2-248f-4130-9975-2f8882a8a4f9

    https://forsenergy.com/en-us/rras/html/3fc0d556-8b4c-4dda-af53-f45efe87c91e.htm

    Kindly let us know if the above helps or you need further assistance on this issue.


    Please don’t forget to "Accept the answer" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  3. Philippe DA SILVA OLIVEIRA 0 Reputation points
    2024-02-12T08:48:26.26+00:00

    Hello, Thank you for your assistance. I had indeed enabled the IP forwarding on Windows as well. I solved my issue by adding a second network card to my VM. The configuration on the Routing and Remote Access Service was done automatically, and it now works. Regards, Philippe DA SILVA OLIVEIRA


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.