edit-icon download-icon

Activate the backend service

Last Updated: Apr 11, 2018

To avoid conflicting with the public IP such as Elastic IP address of the bound ECS instance, Global Acceleration establishes a connection using the public IP address of the Global Acceleration instance and the private IP address of the backend service.

Because the ECS instance in the VPC network only has one private network NIC with its own private IP address, it cannot receive packets sent from the Global Acceleration instance to the private IP address of the backend service. Backend service activation is intended to enable the ECS instance to receive packets from the Global Acceleration instance by adding a network sub-interface on the ECS instance.

The activation includes the following two steps:

  1. Obtain the backend service IP address that the Global Acceleration instance allocates to the ECS instance.

    For more information, see Obtain the backend service IP address.

  2. Add a network interface on the ECS instance using the obtained IP address.

    For more information, see Add a NIC subinterface.

Prerequisite

Bind an ECS instance

Step 1 Obtain the backend service IP address

You can obtain the allocated backend service IP address from the console or using the API:

  • Obtain from the console

    Follow these steps to obtain the IP address:

    1. Log on to the VPC console.

    2. In the left-side navigation pane, click Global Acceleration.

    3. Select the region of the target Global Acceleration instance and view the backend service IP address in the Backend Service Details column of the target instance.

      Activate

  • Obtain by using API

    You can call the DescribeGlobalAccelerationInstances API to view the backend service address. The returned value of the ServerIpAddress parameter is the backend service IP address.

    The following is an example.

    1. $ python api.py DescribeGlobalAccelerationInstances RegionId=ap-southeast-1
    2. =====Request URL======
    3. https://vpc.aliyuncs.com/?SignatureVersion=1.0&Format=json&TimeStamp=2017-07-20T09%3A17%3A04Z&RegionId=ap-southeast-1&AccessKeyId=qVqq8LSARLRGcAos&SignatureMethod=HMAC-SHA1&Version=2016-04-28&Signature=NwD7BioJoza%2FYdMgxxxxxx%2FeAZ0%3D&Action=DescribeGlobalAccelerationInstances&SignatureNonce=3257c5a6-6d2c-11e7-8338-34363b739ac0
    4. =====Request URL end======
    5. ====== Got Response ======
    6. {
    7. "GlobalAccelerationInstances": {
    8. "GlobalAccelerationInstance": [
    9. {
    10. "BackendServers": {
    11. "BackendServer": [
    12. {
    13. "RegionId": "ap-northeast-1",
    14. "ServerId": "i-6we1ge5qfxxxxxx",
    15. "ServerIpAddress": "172.16.x.xxx"
    16. }
    17. ]
    18. },
    19. "Bandwidth": "10",
    20. "ChargeType": "PostPaid",
    21. "CreationTime": "2017-07-20T08:39:33Z",
    22. "Description": "My first GlobalAcceleration instance",
    23. "ExpiredTime": "",
    24. "GlobalAccelerationInstanceId": "ga-t4nluhu6n4xxxxxxxx",
    25. "InternetChargeType": "PayByBandwidth",
    26. "IpAddress": "47.88.xxx.xx",
    27. "Name": "MyGa",
    28. "OperationLocks": {
    29. "LockReason": []
    30. },
    31. "RegionId": "ap-southeast-1",
    32. "ServiceLocation": "asia-pacific",
    33. "Status": "InUse"
    34. }
    35. ]
    36. },
    37. "PageNumber": 1,
    38. "PageSize": 10,
    39. "RequestId": "AB99DA7A-BCCA-4563-89C0-90AC64329EA6",
    40. "TotalCount": 1
    41. }

Step 2 Add a network sub-interface

Instead of adding a new NIC (network interface card), you have to add a sub-interface onto the NIC of the ECS instance.

  • Configure a Linux ECS instance

    The configuration varies by system versions. Take Ubuntu 16.04 64-bit as an example, follow these steps to add a sub-interface.

    1. Run the following command to open the interface configuration file:

      1. sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0:1
    2. Add the following contents to the configuration file:

      1. DEVICE=eth0:1
      2. IPADDR=172.16.1.209
      3. NETMASK=255.255.255.255
      4. ONBOOT=yes

      where:

      • DEVICE is the interface name.

      • IPADDR is the backend service IP address.

    3. Run the following command to enable the new sub-interface:

      1. ifup eth0:1
  • Configure a Windows ECS instance

    Note: A sudden spikes in the network traffic will occur during the configuration.

    Follow these steps to add a sub-interface:

    1. Log on to the ECS instance and run the ipconfig command to view the IP address of the instance.

    2. Run the following command to create an Ethernet interface:

      netsh interface ipv4 set address name=<EthernetAdapterName> source=static address=<backendServiceIPaddress> mask=<netmask> gateway=<defaultGateway>

      Example:

      netsh interface ipv4 set address name="local connection 4" source=static address=172.16.x.xxx mask=255.255.255.255

    3. Run the following command to add a sub-interface:

      netsh interface ipv4 add address <EthernetAdapterName> <backendServiceIPAddress> <netmask>

      Example:

      netsh interface ipv4 add address "local connection 4" 172.16.x.xxx 255.255.255.255

Thank you! We've received your feedback.