Buying a VPN

Overview

This section applies to regions where the old VPN edition is available.

By default, ECSs in a VPC cannot communicate with your data center or private network. A VPN can help you enable communications between them. Create a VPN in your VPC and update the security group rules.

IPsec VPN Topology

In Figure 1, the VPC has subnets 192.168.1.0/24 and 192.168.2.0/24. Your on-premises data center has subnets 192.168.3.0/24 and 192.168.4.0/24. You can use VPN to enable subnets in the VPC to communicate with those in your data center.

Figure 1 IPsec VPN

Currently, both site-to-site and hub-and-spoke VPNs are supported. Set up VPNs both in your data center and your VPC to establish the VPN connection.

When setting up a VPN, the IKE and IPsec policies configured on your on-premises VPN device must be the same as that on the cloud. Your on-premises VPN devices should comply with IPsec standards and protocols.

Scenarios

You need a VPN that sets up a secure, isolated communication tunnel between your data center and cloud services.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select the desired region and project.
  3. Click Service List in the upper left corner. Under Networking, select Virtual Private Network.
  4. On the Virtual Private Network page, click Buy VPN.
  5. Configure the parameters as prompted and click Next.

    Table 1, Table 2, and Table 3 lists the parameters and their descriptions.

    Table 1 Basic parameters

    Parameter

    Description

    Example Value

    Region

    Regions are geographic areas that are physically isolated from each other. The networks inside different regions are not connected to each other, so resources cannot be shared across different regions. For lower network latency and faster access to your resources, select the nearest region.

    eu-de

    Billing Mode

    VPNs are billed on a pay-per-use basis.

    Pay-per-use

    Name

    The VPN name.

    VPN-001

    VPC

    The VPC name.

    VPC-001

    Local Subnet

    The VPC subnets that will access your on-premises network through a VPN

    192.168.1.0/24,

    192.168.2.0/24

    Remote Gateway

    The public IP address of the gateway in your data center or on the private network. This IP address is used for communicating with your VPC.

    N/A

    Remote Subnet

    The subnets of your on-premises network that will access a VPC through a VPN. The remote and local subnets cannot overlap with each other. The remote subnet cannot overlap with CIDR blocks involved in existing VPC peering connections created for the VPC.

    192.168.3.0/24,

    192.168.4.0/24

    PSK

    The pre-shared key, a private key shared by two ends of a VPN connection for negotiation

    PSKs configured at both ends of the VPN connection must be the same.

    The PSK can contain 6 to 128 characters.

    Test@123

    Confirm PSK

    Enter the pre-shared key again.

    Test@123

    Advanced Settings

    • Default: Use default IKE and IPsec policies.
    • Custom: Custom IKE and IPsec policies. For details, see Table 2 and Table 3.

    Custom

    Table 2 IKE policy

    Parameter

    Description

    Example Value

    Authentication Algorithm

    The hash algorithm used for authentication, which can be SHA1, SHA2-256, SHA2-384, SHA2-512, or MD5

    The default algorithm is SHA2-256.

    SHA2-256

    Encryption Algorithm

    The encryption algorithm, which can be AES-128, AES-192, AES-256, or 3DES

    3DES is not recommended because it is not strong enough to protect data.

    The default algorithm is AES-128.

    AES-128

    DH Algorithm

    The Diffie-Hellman key exchange algorithm, which can be Group 2, Group 5, or Group 14

    The default algorithm is Group 14.

    Group 14

    Version

    The version of the IKE protocol, which can be v1 or v2

    The default version is v2.

    v2

    Lifecycle (s)

    The lifetime of the SA, in seconds

    The SA will be renegotiated if its lifetime expires.

    The default lifecycle is 86400 seconds.

    86400

    Negotiation Mode

    If the IKE policy version is v1, the negotiation mode can be set to Main or Aggressive.

    The default mode is Main.

    Main

    Table 3 IPsec policy

    Parameter

    Description

    Example Value

    Authentication Algorithm

    The hash algorithm used for authentication, which can be SHA1, SHA2-256, SHA2-384, SHA2-512, or MD5

    The default algorithm is SHA2-256.

    SHA2-256

    Encryption Algorithm

    The encryption algorithm, which can be AES-128, AES-192, AES-256, or 3DES

    3DES is not recommended because it is not strong enough to protect data.

    The default algorithm is AES-128.

    AES-128

    PFS

    The perfect forward secrecy (PFS), which is used to configure the IPsec tunnel negotiation.

    The PFS algorithm can be DH group 2, DH group 5, or DH group 14.

    The default algorithm is DH group 14.

    DH group 14

    Transfer Protocol

    The security protocol used for IPsec to transmit and encapsulate user data, which can be AH, ESP, or AH-ESP

    The default protocol is ESP.

    ESP

    Lifecycle (s)

    The lifetime of the SA, in seconds

    The SA will be renegotiated if its lifetime expires.

    The default lifecycle is 3600 seconds.

    3600

    The IKE policy specifies the encryption and authentication algorithms to be used in the negotiation phase of an IPsec tunnel. The IPsec policy specifies the protocol, encryption algorithm, and authentication algorithm to be used in the data transmission phase of an IPsec tunnel. The IKE and IPsec policies in your VPC and your on-premises data center must be the same. If they are different, the VPN establishment will fail.

    For security reasons, the following algorithms are not recommended.

    • Authentication Algorithm: SHA1 and MD5
    • Encryption Algorithm: 3DES
    • DH algorithm: Group 1, Group 2, and Group 5.
  6. Click Submit.

    After the IPsec VPN is created, a public IP address is assigned to the VPN. The IP address is the local gateway address of the created VPN. When configuring the remote tunnel in your data center, you must set the remote gateway address to this IP address.

  7. Due to the symmetry of the tunnel, you also need to configure the IPsec VPN on your router or firewall in the data center.