how to enable routing between three virtual machines in same subnet

Rohan Aluguri 5 Reputation points
2023-10-16T14:29:12.4366667+00:00

I have three virtual machines in the same subnet in Azure. One VM acts as the source, the other as a router, and the other as the destination. I need to send traffic from source to destination and the router should forward the traffic to destination. I have implemented IP tables in the VM acting as a router, configured it according to my requirements, and added routes in the source and destination vm's for communication between them. When PING is used to send traffic, the traffic is directly reaching the destination instead of it being forwarded by the router.

Can anyone give me a solution to overcome this problem.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,586 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Monalla-MSFT 12,846 Reputation points
    2023-10-16T15:12:49.1366667+00:00

    @Rohan Aluguri - Welcome to Microsoft Q&A and thanks for reaching out to us.

    From what you have explained, the most possible reason could be that IP forwarding is disabled on the virtual appliance VM. IP forwarding allows a VM to receive incoming traffic that is not addressed to itself and forward it to other destinations.

    If you haven't enabled it yet, please do so by navigating to virtual appliance VM, click on Networking and then click on network interface associated with the VM. Under IP configurations, click on the IP configuration associated with network interface, and under IP forwarding select "Enabled".

    Or there could be other reasons like:

    1. Check the routing table on the source and destination VMs to ensure that the routes are correctly configured.
    2. Check the IP tables on the virtual appliance VM to ensure that they are correctly configured.
    3. Use a packet capture tool like Wireshark to capture the traffic between the source and destination VMs and analyze the packets to see if they are being forwarded by the virtual appliance VM.

    Hope this helps. and please feel free to reach out if you have any further questions.


    If the above response was helpful, please feel free to "Accept as Answer" and click "Yes" so it can be beneficial to the community.