This topic describes how to use an Express Connect circuit and an IPsec-VPN gateway to connect a data center and Alibaba Cloud networks. This way, end users can establish active/standby connections to access cloud computers over private networks.
Background information
Before you begin, read Access a cloud computer over a private network and familiarize yourself with private networks.
After you complete network settings described in this topic, the following effects are achieved:
If an Express Connect circuit and virtual private network (VPN) connections are normal, traffic generated between the data center and cloud computers is forwarded by using the Express Connect circuit.
If the Express Connect circuit is abnormal, traffic generated between the data center and cloud computers is forwarded by using VPN connections.
Related services:
Express Connect circuits
Express Connect provides a secure and convenient method to connect a data center and Alibaba Cloud. You can lease an Express Connect circuit from a third-party Express Connect partner and use the circuit to connect the data center to an Alibaba Cloud access point. Connections over the Express Connect circuit are not exposed to the Internet. Compared with Internet-based connections, connections over the Express Connect circuit feature higher security and reliability, faster network connection, and lower network latency. For more information, see What is a connection over an Express Connect circuit?
IPsec-VPN gateways
VPN Gateway is an Internet-based service for network connections. You can use the service to establish secure and reliable connections between a data center and an Alibaba Cloud virtual private cloud (VPC) over encrypted channels. For more information, see VPN gateways.
Preparations
Before you begin, read the Access a cloud computer over a private network topic and complete the following preparations:
Create a Cloud Enterprise Network (CEN) instance. For more information, see Create a CEN instance.
Create a VPC and attach it to the CEN instance. For more information, see Create a VPC and a vSwitch or Attach a network instance to a CEN instance.
Create an office network and attach its VPC to the CEN instance. For more information, see Create and manage convenience office networks and Create and manage an enterprise AD office network.
ImportantBefore you create an office network, you must plan the IPv4 CIDR block of the office network to prevent CIDR block conflicts between the office network and the CEN instance or between the office network and your data center. For more information, see Plan a CIDR block.
If you create a convenience office network, attach the convenience office network to the CEN instance.
If you deploy your AD system on an Elastic Compute Service (ECS) instance, you must attach the VPC of the AD server to the CEN instance. If you deploy your AD system on a local server, you must connect the local network to the cloud network. You can create an enterprise AD office network and implement connectivity between the local server and the cloud, and then configure the AD domain.
Create a cloud computer and an account. Then, assign the cloud computer to the account.
For more information about how to create an account, see Create a convenience account or Create and manage an enterprise AD office network.
For more information about how to create and assign cloud computers, see Create cloud computers and Assign cloud computers to users.
Obtain an Alibaba Cloud Workspace terminal to connect to and use cloud computers.
NoteThe Express Connect and IPsec-VPN solution supports the Windows client and macOS client of Alibaba Cloud Workspace.
CIDR block planning
Complete the following network planning and gateway configurations:
Configure routing protocols for a data center and network instances. In this topic, the following routing protocols are used:
Use static routing between a data center gateway and VPN gateway.
Use Border Gateway Protocol (BGP) between the data center gateway and a Virtual Border Router (VBR).
NoteIn scenarios in which a VPN gateway works as a standby connection and an Express Connect circuit works as an active connection, take note of the following items:
If the VPN gateway is associated with an independent VPC, such as a user VPC, the VBR must use the BGP protocol. The VPN gateway can use static routing or the BGP protocol.
If the VPN gateway is associated with a business VPC, such as an office network VPC, the VBR and VPN gateway must use the BGP protocol.
When you plan networks for the data center and network instances, make sure that the CIDR blocks of the data center do not overlap with the CIDR blocks of the network instances. The following table describes sample CIDR blocks. The actual CIDR blocks that you use shall prevail.
Item
CIDR block
Description
Office network VPC
172.16.0.0/12
The IP address of a cloud computer and private gateway.
User VPC
192.168.0.0/24
The CIDR block that is used for the VPC that you created to establish VPN connections.
VBR
10.0.0.1/30
Virtual local area network (VLAN) ID: 0
IPv4 Address (Alibaba Cloud Gateway): 10.0.0.1/30
IPv4 Address (Data Center Gateway): 10.0.0.2/30
BGP Autonomous System Number (ASN): 45104
Data center
192.168.1.1/24
The Alibaba Cloud Workspace client uses this CIDR block to establish connections.
Data center gateway
10.0.0.2/30
Public IP address: 115.XX.XX.154
IP address of the port that is used to connect to an Express Connect circuit: 10.0.0.2/30
BGP ASN: 65001
Check whether the data center gateway supports standard IKEv1 and IKEv2 protocols to connect the data center gateway to the Alibaba Cloud VPN gateway. To check whether the gateway supports the IKEv1 and IKEv2 protocols, contact your gateway manufacturer.
Assign a static public IP address to the data center gateway.
Step 1: Deploy an Express Connect circuit
Create a connection over an Express Connect circuit.
You must apply for an Express Connect circuit in a region. For more information, see Create and manage a dedicated connection over an Express Connect circuit or Overview of hosted connections.
Create a VBR. For more information, see Create and manage a VBR.
Create a BGP group. For more information, see Create a BGP group.
Create a BGP peer. For more information, see Create a BGP peer.
Step 2: Deploy a VPN gateway
Add a destination-based route. You must use the VPN gateway to advertise the route of the data center to the user VPC. For more information, see Create a destination-based route.Create a destination-based route
Load the VPN configurations in the data center gateway.
Log on to the VPC console.
In the left-side navigation pane, choose
.In the top navigation bar, select the region of the IPsec-VPN connection.
On the IPsec Connections page, find the IPsec-VPN connection and click Generate Peer Configuration in the Actions column.
Load the IPsec-VPN connection configurations that you downloaded to the data center gateway.
For more information, see Configure an H3C firewall.
Step 3: Configure a CEN instance
After you configure the VBR and VPN gateway, attach the VBR to the CEN instance to which the office network VPC and user VPC are attached. This way, the data center and the office network VPC are connected.
Log on to the CEN console.
Attach the VBR to a CEN instance.
Make sure that a CEN instance is created and the office network VPC and user VPC are attached to the CEN instance.
On the Instances page, click the ID of the CEN instance that you want to manage.
On the tab, find the transit router that you want to manage and click Create Connection in the Actions column.
On the Connection with Peer Network Instance page, configure parameters and click OK.
Parameter
Description
Network Type
Select Virtual Border Router (VBR).
Region
Select the region where the network instance is deployed.
Transit Router
The transit router in the selected region is displayed.
If no transit router is available in the selected region, the system automatically creates a transit router.
Resource Owner ID
Select the Alibaba Cloud account that owns the network instance.
If the network instance and the transit router that you want to connect belong to the same Alibaba Cloud account, select Current Account.
If the network instance and the transit router that you want to connect belong to different Alibaba Cloud accounts, select Different Account, and enter the ID of the Alibaba Cloud account to which the network instance belongs.
Network Instance
Select the ID of the network instance that you want to connect.
Configure health checks for the Express Connect circuit in the CEN console. For more information, see Configure health checks.
Probe packets are sent during health checks based on the probe interval that you specify. If the specified number of probe packets are consecutively lost within a period of time, the CEN instance routes traffic over VPN connections.
Step 4: Configure the data center gateway
The following sample code is provided only for reference. The configuration commands in the code are subject to device manufacturers.
# Configure BGP dynamic routing, establish a BGP peering connection to the VBR, and then advertise the route of the data center to Alibaba Cloud.
interface GigabitEthernet 0/12 # The port is used to connect the data center gateway to the Express Connect circuit.
no switchport ip address 10.0.0.2 255.255.255.252 # The IP address of the port. The IP address must be the same as the IPv4 address of the data center gateway specified when you configure the VBR.
router bgp 65001 bgp
router-id 10.0.0.2
network 192.168.1.1 mask 255.255.0.0 # The private CIDR block of the data center advertised to Alibaba Cloud.
neighbor 10.0.0.1 remote-as 45104 # The peer relationship with the VBR.
# Configure the priority of the static route pointing to the office network VPC over the VPN gateway. The priority must be lower than that of the BGP route.
ip route 192.168.0.0 255.240.0.0 <Public IP address of the VPN gateway> preference 255
# Configure a backhaul route for probe packets.
ip route <Source IP address for health checks> 255.255.255.255 10.0.0.1
Step 5: Test the network connectivity
Open Command Prompt on a local computer in the data center.
Run the
ping
command to connect to the IP address of a cloud computer in the CIDR block used by the office network VPC. If response packets are returned, the data center is connected to the office network VPC.If no cloud computer is available in the office network, create a cloud computer. For more information, see Create cloud computers.
NoteAfter the cloud computer is created, you can view the IP address of the cloud computer in the IP Address column on the Cloud Computers page.
On the data center gateway, disable the port of the Express Connect circuit and close the Express Connect circuit connection. Run the
ping
command on the Alibaba Cloud Workspace client again to test the network connectivity between the data center and the office network VPC. If response packets are returned, the standby IPsec-VPN connection can work as expected.
Step 6: Configure routing and DNS for cloud services
Configure routing for cloud services.
The CIDR block of the cloud services in Alibaba Cloud that can be accessed over a VPC is 100.64.0.0/10. This CIDR block is a reserved CIDR block defined in RFC 6598. To ensure that you can call the EDS API from the Alibaba Cloud Workspace client as expected, configure a route for the CIDR block 100.64.0.0/10 in the data center network to forward requests destined for the CIDR block to the user VPC in the cloud
(Optional) Before you configure Domain Name System (DNS), run the following command to test whether the domain name can be resolved:
nslookup ecd-vpc.cn-hangzhou.aliyuncs.com
If an IP address is returned, the domain name can be resolved. In this case, you can skip the next step. If no IP address is returned, perform the following step to configure DNS.
(Optional) Configure DNS.
To access cloud computers over a private network, DNS is required to resolve the domain names involved in the EDS API and streaming gateways that reside in the private network. In this example, use the following IP addresses for your DNS server:
100.100.2.136
100.100.2.138
You can use one of the following methods to configure DNS addresses:
Add the preceding DNS addresses to the Dynamic Host Configuration Protocol (DHCP) service of the data center.
Configure transit routers on the DNS server of the data center to route domain name resolution requests that end with
aliyuncs.com
to 100.100.2.136 or 100.100.2.138.
Step 7: Check whether the cloud computer can be connected over a private network
In this section, the Windows client of Alibaba Cloud Workspace V7.2.2 is used as an example to check whether the cloud computer can be connected over the private network. The actual type of the Alibaba Cloud Workspace client that you use shall prevail.
Launch the Windows client.
In the lower part of the logon page, choose
and select Alibaba Cloud VPC.Enter the logon credentials, including an office network ID or organization ID, username, and password, sent to your email address. Then, click the Next icon to proceed.
Find the cloud computer from the resource list. Then, start and connect to it.
NoteIf errors such as network request timeout occur, network connectivity is not established. Check whether the preceding network settings are correctly configured. Then, re-log on to the client and connect to the cloud computer.