[PYTHON] How to set up a VPN gateway to establish a connection between Alibaba Cloud and AWS

This article provides step-by-step instructions on how to configure VPN Gateway on both ** Alibaba Cloud ** and Amazon Web Services for multi-cloud solutions.

Solutions Architect Evan Wong

Multi-cloud is one of the most sought after architectural designs to bridge the benefits of having multiple technologies and avoid vendor lock-in. There are several options for allowing Alibaba Cloud to connect to various cloud providers. One is to connect via the public internet via a VPN gateway. This article focuses on a step-by-step guide to setting up a VPN Gateway (https://www.alibabacloud.com/en/product/vpn-gateway) on both Alibaba Cloud and Amazon Web Services.

image.png

The following articles provide step-by-step instructions on how to set up a VPN Gateway to establish a connection to AWS.

Prerequisites

Before proceeding to the guide, you need the following elements:

1, computer or laptop 2, web browser, Google Chrome recommended 3, internet, 5Mbps recommended 4, Alibaba Cloud Account

Step 1: Create VPN Gateway on Alibaba Cloud

Select your region, VPC, peak bandwidth, and billing method.

image.png

After purchase, you should see the new VPN Gateway in the console.

Please name it:

image.png

Creating a customer gateway

Next, create a customer gateway. Click Create Customer Gateway and enter your name and IP address.

image.png

Once created, it should appear on the console. Then go to the VPN connection page.

image.png

Creating a VPN connection

Provide the VPN connection name and select the correct VPN and customer gateway, local and remote networks, and pre-shared keys.

image.png

Check the connection status. The status should be "Phase 2 of IKE Tunnel Negotiation Succeeded".

image.png

Add route entry

After successfully establishing the VPN Gateway, the next step is to add a route entry to your VPC to allow ECS to communicate with EC2 on AWS.

Go to the VPC-> VRouters page. Click Add Route Entry.

image.png

Enter the CIDR Block from AWS, select VPN Gateway as the Next Hop Type, and select the VPN Gateway you just created.

image.png

If you check again on the VRouter info page, you should see a list of new route entries.

image.png

Step 2: Create a VPN Gateway with Amazon Web Services

Go to your virtual private cloud and click Create Virtual Private Gateway.

image.png

Key in the name and click Create Virtual Private Gateway.

When you're done, attach your VPC.

image.png

Create a customer gateway on Amazon Web Services

Go to Customer Gateway and create a new Customer Gateway.

image.png

Enter the name of the customer gateway and the IP address of the Alibaba Cloud VPN gateway.

image.png

Create a VPN connection with Amazon Web Services

Select the correct VPN gateway and select the existing customer gateway you created earlier. Select the static routing option and enter the static IP prefix that is the subnet of your VPC.

image.png

image.png

Add route table in Amazon Web Services

Before you can grant access to your AWS EC2 instance, you need to add a route table for Alibaba Cloud to connect to AWS.

image.png

Step 3: Test connectivity

Make sure you need to add a similar route entry on the AWS side as well. Then create ECS and EC2 or ping test using an existing instance.

image.png

Conclusion

This VPN gateway solution allows customers using services on both Alibaba Cloud and AWS to securely connect between the two sites over the Internet.

related products

1、VPN Gateway 2、Virtual Private Cloud 3、Elastic Compute Service

Recommended Posts

How to set up a VPN gateway to establish a connection between Alibaba Cloud and AWS
How to set up a jupyter notebook on ssh destination (AWS EC2)
How to set up a local development server
How to set up a Python environment using pyenv
How to deploy a Django application on Alibaba Cloud
How to set up and compile your Cython environment
How to set up WSL2 on Windows 10 and create a study environment for Linux commands
How to set a shortcut to switch full-width and half-width with IBus
Overview of how to create a server socket and how to establish a client socket
How to set up and use OMC Log Analytics --Linux version -
How to deploy a web application on Alibaba Cloud as a freelancer
Set up a VPN server on AWS so that you can make a VPN connection from your Linux laptop
How to split and save a DataFrame
How to set up SVM using Optuna
The road to fighting the connection between Nginx, Django and uwsgi and winning a little
How to install Fast.ai on Alibaba Cloud GPU and run it on Jupyter notebook
Install and configure PyFilter client to monitor SSH connection to Alibaba Cloud Ubuntu server
I set up TensowFlow and was addicted to it, so make a note
How to set up Random forest using Optuna
How to set up Random forest using Optuna
Easy connection between Raspberry Pi and AWS IoT
How to switch between Linux and Mac shells
How to set up a Google Colab environment with Coursera's advanced machine learning courses
How to set up public key authentication in ssh
PySpark: Set up PySpark on your Alibaba Cloud CentOS instance
How to set layer on Lambda using AWS SAM
Set up a free server on AWS in 30 minutes
How to use argparse and the difference between optparse
How to set up a simple SMTP server that can be tested locally in Python
Steps to set up Pipenv, create a CRUD app with Flask, and containerize it with Docker