Hello,
I’m trying to create two VM (A and B) on Azure and I want the VM A as the gateway of the VM B.

I’ve readed various links to understand the Azure routing but I couldn’t find a way to make it work.

Can you help me to identify a simple and easy how to to test this scenario?

Thank you in advance.

7 Spice ups

Sure you can do this. Create VM A with two NICs - one open either to the internet or to a VPN, the second on a private network. Then create VM B with a vNic in that same vnet. Finally, put some routing software in VM A.

This not really any different from how you would gateway physical systems. You need to define your networks and work out how you want your users to connect to VM A. Also, you need to consider how you service VM B.

1 Spice up

Hello tfl,
I’ve already tried this configuraion.

I’ve configured a Linux VM for the router/gateway with two NIC (VM A) and a Windows Server VM with a single NIC (VM B).
I’ve also configured the subnet and tried also some UDR routing rules.

I’ve also configured a static default route in the VM B via the VM A IP address.

The problem is that everytime a packet from VM B try to go to an IP address outside of the NIC subnet it flows to a default route that is not not the one I set.

For some reason the default route for VM B is always the Azure default route.

Well - what can I tell you. The basic approach I outlined is how you setup routing between two systems. All I can guess is that you have routing setup incorrectly.

If I understand it correctly, you should have set the DG for VM B to be VM a, not to anywhere else.