Classic VPNs are quick and easy to configure, and understanding how they work will help prepare you to set up production-grade HA VPNs. In this short article, we will demonstrate how to create a Classic VPN tunnel from GCP to Anypoint Platform.
In this first phase, we will set up a classic VPN in GCP. To learn more about Classic VPN, please check the official documentation. For the sake of brevity, this article will cover only the basics regarding the creation of a VPN, starting with our "Create a VPN" screen:
Choose VPC
Next, we choose a VPC to expose via this VPN. In my case, it's gke-vpc with CIDR 10.101.0.0/22. Then we reserve a Static IP for our VPN, as illustrated below.
Tunnel Configuration
Next, we need to configure our tunnels by filling in as much information in the form below as possible:
To finish filling in the form above, we will need some information from the Anypoint Platform. So, let's switch to Anypoint Platform now.
VPN Setup in Anypoint Platform
For the sake of simplicity, I have mapped the information from the Anypoint Platform to the tunnel configuration form as shown in the screenshot below. This will help you understand which information corresponds to each field.
Get Tunnel Configs
The diagram below shows you how to fill in all of the necessary configurations.
Now click CREATE. If everything is correctly filled out, your tunnel will be created.
So now let's test everything by pinging from both sides.
Ping from Worker (Anypoint Platform) to VM (GCP)
To test the configuration, I created a Mule API to run almost all Linux commands available in the worker.
Check out the result below, which shows that I can successfully ping the VM in GCP:
Ping from VM (GCP) to Worker (Anypoint Platform)
And now we need to test it from the VM to Anypoint Platform:
Hurray! It also pinged. So, our tunnel is working perfectly.
In this brief article, I have shown how to create a tunnel from the Anypoint Platform to GCP in a classic way. The overall scenario is illustrated in the following diagram.
In the next article, I will explain how to create an HA VPN in GCP and make a tunnel to the Anypoint Platform.