How to route traffic between two cloud networks
Written by
Updated at November 27, 2023
Scenario description
You need to link two VPC networks.
Solution
There are several solutions to this issue:
We can suggest several solutions:
- Internet routing: Create, in each subnet, a VM with an external IP address and attach routing tables referencing these external addresses to the subnets.
- Creating a VPN tunnel from one network to another: Create, in one of the subnets, a VM with an external IP address, and set up a VPN server on it. In the other subnet, configure a connection to this server on a web-enabled VM, then attach routing tables to these subnets via the VPN tunnel. On our marketplace, we have ready-made solutions for OpenVPN and IPSec.
- Using special VM routers: Certain images allow creating VMs with multiple interfaces that can be linked with different cloud networks. The easiest solution is to use a NAT instance from the marketplace. In the documentation, you can find a scenario for using such an image to enable online access. You may use it as a blueprint. Please note that you will need to add a second interface with an address in the desired subnet to the VM and add specific routes to the routing tables instead of the default route.
- If you are familiar with CISCO or Mikrotik solutions, you can use their virtual routers. Their images can also be downloaded from the marketplace; however, they require licenses for full-scale operation. You can also create multiple network interfaces on such VM instances, but you need to configure them yourself.