Adding the IP Address of an On-Premises Server as a Backend Server of a Dedicated Load Balancer
Scenarios
You can use Direct Connect or VPN to connect on-premises servers to Huawei Cloud, and then add the IP addresses of on-premises servers as backend servers of a dedicated load balancer. In this way, the load balancer can distribute traffic to these servers.
Solution Architecture

In this practice, a Direct Connect connection is required to connect on-premises servers to a VPC and a dedicated load balancer is required to route requests to on-premises servers.
- Dedicated load balancer ELB-Test is running in a VPC named VPC-Test-01 (172.16.0.0/12).
- An on-premises server (IDC-IP-Test) is deployed in the on-premises data center.
- The IP address of IDC-IP-Test is added to the backend server group of ELB-Test.
Resource Planning
In this practice, you need to create a VPC, dedicated load balancer, EIP, Direct Connect connection, ECS, and on-premises server. For details about the resource planning, see Table 1.
This practice uses public network access as an example. You can also use a load balancer to route client requests over a private network.
Resource Type |
Quantity |
Description |
---|---|---|
VPC and subnet |
One VPC and two subnets |
|
Load balancer |
1 |
The load balancer that is used to distribute client requests.
|
Direct Connect connection |
1 |
The connection that is used to connect the on-premises data center to a VPC. |
ECS |
1 |
ECS-client, which is used to access the on-premises server. |
EIP |
2 |
|
On-premises server |
1 |
IDC-IP-Test, which is deployed in the on-premises data center. |
Preparations
- Purchase an ECS (ECS-client) as the client and bind an EIP to it. For details about how to purchase an ECS, see Purchasing and Using a Linux ECS (New Edition).
- Create a VPC (VPC-Test-01) with two subnets (subnet-frontend and subnet-backend). For details, see Creating a VPC and Subnet.
- Create a dedicated load balancer, enable IP as a Backend, and bind an EIP to the load balancer. For details, see Buying a Dedicated Load Balancer and Binding an IPv4 EIP.
Step 1: Connect an On-Premises Data Center to a VPC Using Direct Connect
You can create a Direct Connect connection on the console to connect your on-premises data center or on-premises private network to a VPC.
For details, see Using Direct Connect to Connect an On-Premises Data Center to the Cloud.
Step 2: Deploy a Service on the On-Premises Server
Deploy Nginx on the on-premises server IDC-IP-Test to verify network connectivity.

Step 3: Create a Backend Server Group and Add the IP Address of the On-Premises Server as a Backend Server
- Go to the backend server group list page.
- Click Create Backend Server Group in the upper right corner.
- Configure the parameters based on Table 2. Retain the default values for other parameters.
Table 2 Parameters required for configuring a backend server group Parameter
Example Value
Description
Name
server_group
Specifies the name of the backend server group.
Type
Dedicated
Specifies the type of the load balancer that can use the backend server group.
Load Balancer
Associate existing
Specifies whether to associate a load balancer now.
Click Associate existing and select a load balancer you have created.
Backend Protocol
HTTP
Specifies the protocol that backend servers in the backend server group use to receive requests from the listeners.
Select HTTP.
Load Balancing Algorithm
Weighted round robin
Specifies the load balancing algorithm used by the load balancer to distribute traffic.
Weighted round robin: Requests are routed to different servers based on their weights. Backend servers with higher weights receive proportionately more requests, whereas equal-weighted servers receive the same number of requests.
For more information, see Load Balancing Algorithms.
- Click Next to add backend servers and configure health check.
- Switch to the IP as Backend Servers tab and click Add IP as Backend Server.
- On the displayed page, add the IP address of the on-premises server as a backend server and set the parameters as follows:
- IP Address: Set it to 10.1.0.56 in this example, which is the private IP address of the on-premises server IDC-IP-Test.
- Backend Port: Set this parameter based on service requirements. In this practice, port 80 is used.
- Weight: Retain the default value 1.
- Click OK.
- Enable health check and retain the default values for other health check parameters.
- Click Next.
- Confirm the configurations and click Create Now.
Step 4: Add a Listener and Select the Created Backend Server Group
- Go to the load balancer list page.
- Locate the target load balancer and click Add Listener in the Operation column.
- On the Add Listener page, set Frontend Protocol to HTTP and Frontend Port to 80. Retain the default values for other parameters.
- Click Next: Configure Request Routing Policy and select Use existing for Backend Server Group.
Select the backend server group created in Step 3 and click Next: Confirm.
- Confirm the configurations and click Submit.
Step 5: Verify Request Routing to the On-Premises Server
- Use the client to access the on-premises server to verify network connectivity.
- Remotely log in to ECS_client.
Multiple methods are available for logging in to an ECS. For details, see Logging In to an ECS.
- Run the curl -v http://<IP-address>:<port> command to test network connectivity.
In this practice, run the following command:
curl -v http://<EIP-of-the-load-balancer>:<Listening-port>
If the default Nginx welcome page is displayed, ELB successfully forwards the client request to the on-premises server.
- Remotely log in to ECS_client.
- Use a browser to verify the network connectivity.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot