☁️How to Connect VPCs Across Regions with VPN
Introduction
In this article , we will explore the steps involved in connecting VPCs across regions with VPN . We will start by learning the basics of VPNs.
What is Virtual Private Network?
Virtual Private Network (VPN) allows you to establish an encrypted , Internet-based communications tunnel between your on-premises data center and a VPC , so you can access resources in the VPC remotely . VPN tunnels support three protocols : PPTP , L2TP and IPsec .
Components
· VPN gateway: is a virtual gateway of a VPN on Huawei Cloud. It establishes secure private connections with a customer gateway in your on-premises network or data center.
· Customer gateway: is a resource that provides information to Huawei Cloud about your customer gateway device, which can be a physical device or software application in your on-premises data center.
· VPN connection: is a secure channel between a VPN gateway and a customer gateway. VPN connections use the Internet Key Exchange (IKE) and Internet Protocol Security (IPsec) protocols to encrypt the transmitted data.
Service Detail
Now let’s make a practice. Let’s connect the VPCs in Singapore and Hong Kong with a VPN. We’ll follow the steps below while doing this.
1.Create VPC and ECS
2.Create VPN Gateway
3.Create Customer Gateway
4. Create VPN Connection
1.Create VPC and ECS
We create 2 subnets in 1 VPC for each region. At this point, the IP addresses of the VPCs and subnets in different regions should be different.We create 1 ECS for each VPC .
2.Create VPN Gateway
We create a separate VPN gateway for each region. The Interconnection and the Local subnet need to have different IP addresses. So we create 2 subnets for each VPC.
And the VPN gateways we create are operating normally.
3.Create Customer Gateway
When creating a Customer Gateway for the Hong Kong region, we need to enter the Gateway IP Address that we have created in the Singapore region.
When creating a Customer Gateway for the Singapore region, we need to enter the Gateway IP Address that we have created in the Hong Kong region.
4. Create VPN Connection
In this step, we create VPN Connection each for region . We enter the subnet IP address where the ECS is installed as the Customer Subnet.
A pre-shared key (PSK) is a key configured for a VPN connection on the cloud. It is used for IKE negotiation between VPN devices at both ends of a VPN connection. Ensure that the PSK configurations at both ends of the VPN connection are the same. Otherwise, the IKE negotiation will fail. So the same PSK should be set for both region .
Singapore region ;
At the finally , VPN Connection we create are successfully .
Conclusion
Now let’s check the VPN Connection by ping on the Private IP.
The VPN Connection is working successfully. In this way, we have provided two VPCs connections in different regions.
Huawei Cloud is rapidly growing cloud computing service offered by Huawei Technologies, a global leader in the technology industry. It offers a wide range of cloud-based products and services, including IaaS, PaaS and SaaS solutions.
Huawei Cloud has a global network of data centers , providing businesses with the flexibility to choose the locations that best meet their needs and enabling them to scale their operations quickly and easily.
If you’re interested in getting hands-on experience with Huawei Cloud Services , you can register and explore KooLabs , Huawei’s online interactive and free learning platform , as well as Huawei Cloud Developer Forum , where you can connect with other developers and gain insights into Huawei’s Cloud computing solutions.
You can reach me from my Linkedin account for all your questions and requests.
Hope to see you in my next article…