VPN Gateway provides a secure and stable private connection between your data center and Alibaba Cloud. Use a VPN to mount a NAS file system on an on-premises server or on an ECS instance in a different region without exposing traffic to the public internet.
Use cases
VPN Gateway connects your data center to a VPC and connects VPCs across regions. You can mount a file system in the following ways:
-
Mount a file system on an ECS instance across regions
-
If a VPN gateway is already deployed on an ECS instance in one VPC, create another VPN gateway in the other VPC. Mount a file system across regions when one VPN gateway is deployed.
-
Without an existing VPN gateway, create VPN gateways in both VPCs. For more information, see Mount a file system across regions when no VPN gateway is deployed.
-
Mount a file system on an on-premises server
-
Create a file system and a mount target.
-
Log on to the NAS console.
-
Create a file system. Create a General-purpose NAS file system using the console.
-
Create a mount target in the VPC. For more information, see Create a mount target.
-
-
Establish a connection between the VPC and your data center. Establish a connection between a VPC and a data center.
-
Verify that on-premises servers can connect to ECS instances or mount targets in the VPC.
Log on to an ECS instance in the VPC that has no public IP address. Run the ping command to ping the private IP address of a server in your data center.
-
After verification, mount the VPC file system on the on-premises server. Mount a file system.
Mount a file system on an ECS instance across regions
Mount a file system across regions when one VPN gateway is deployed
The following example uses two VPCs (VPC1 and VPC2) in different regions.
-
Create a file system and a mount target.
-
Log on to the NAS console.
-
Create a file system. Create a General-purpose NAS file system using the console.
-
Create a mount target in a VPC. For more information, see Create a mount target.
The mount target is created in VPC1.
-
-
In VPC2, set up a VPN gateway on an ECS instance to serve as the customer gateway.
Note-
The ECS instance requires a public IP address to connect to the VPN gateway in VPC1.
-
To set up a VPN gateway on an ECS instance, follow Install a strongSwan IPsec-VPN Server on CentOS 7.
-
-
Establish a connection between the VPN gateways in VPC1 and VPC2.
-
Log on to the VPC console.
-
Create a VPN connection between the VPN gateways in VPC1 and VPC2 (the customer gateways that you created in Step 2). Create an IPsec-VPN connection.
-
-
Add a route to the route table of VPC2. Configure routes for a VPN gateway.
Set Destination CIDR Block to the private CIDR block of VPC1, and set Next Hop to the ECS instance in VPC2 that is acting as the VPN gateway.
-
Verify connectivity between ECS instances or mount targets in VPC1 and VPC2.
Log on to an ECS instance in VPC1 and ping the IP address of an ECS instance in VPC2.
-
After verification, mount the VPC1 file system on the ECS instances in VPC2. Mount a file system.
Mount a file system across regions when no VPN gateway is deployed
The following example uses two VPCs (VPC1 and VPC2) in different regions.
-
Create a file system and a mount target.
-
Log on to the NAS console.
-
Create a file system. Create a General-purpose NAS file system using the console.
-
Create a mount target in a VPC. For more information, see Create a mount target.
The mount target is created in VPC1.
-
-
Establish a connection between the VPN gateways in VPC1 and VPC2.
-
Log on to the VPC console.
-
Create VPN gateways in VPC1 and VPC2. Create a VPN gateway.
-
Create customer gateways in VPC1 and VPC2. Create a customer gateway.
IP Address refers to the IP addresses of the VPN gateways in VPC1 and VPC2.
-
Add routes to the route tables of VPC1 and VPC2. Configure routes for a VPN gateway.
-
When adding a route for the VPN Gateway in VPC1, set Destination CIDR Block to the private CIDR block of VPC2, and set Next Hop to the customer gateway in VPC1.
-
When adding a route for the VPN Gateway in VPC 2, set the Destination CIDR Block to the private CIDR block of VPC 1 and the Next Hop to the customer gateway in VPC 2.
-
-
-
Verify connectivity between ECS instances or mount targets in VPC1 and VPC2.
Log on to an ECS instance in VPC1 and ping the IP address of an ECS instance in VPC2.
-
After verification, mount the VPC1 file system on the ECS instances in VPC2. Mount a file system.