Help Center > > User Guide> Virtual IP Address> Binding a Virtual IP Address to an EIP or ECS

Binding a Virtual IP Address to an EIP or ECS

Updated at: Sep 02, 2021 GMT+08:00

Scenarios

You can bind a virtual IP address to an EIP so that you can access the ECSs can be deployed in active/standby mode for improve fault tolerance.

You can perform operations on virtual IP addresses through the subnet module. However, the entry to visit the subnet module varies by region.

  • If the subnet module is not decoupled from the VPC module in your selected region, access the subnet module by clicking the Subnets tab on the VPC details page.
  • If the subnet module is decoupled from the VPC module in your selected region, access the subnet module directly after you click Subnets on the navigation pane of the VPC console.

Procedure

  1. Log in to the management console.
  1. Click in the upper left corner and select the desired region and project.
  2. On the console homepage, under Networking, click Virtual Private Cloud.
If you have to visit the subnet module through the VPC details page, perform steps 4 to 7. If you can visit the subnet module directly from the navigation pane on the left, perform steps 8 to 10.
Figure 1 Visiting the subnet module
  1. In the navigation pane on the left, click Virtual Private Cloud.
  2. On the Virtual Private Cloud page, locate the VPC containing the virtual IP address and click the VPC name.
  3. On the Subnets tab, click the name of the subnet that the virtual IP address belongs to.
  4. Click the Virtual IP Addresses tab, locate the row that contains the virtual IP address to be bound to an EIP or ECS, and choose Bind to EIP or Bind to Server in the Operation column.
  5. In the navigation pane on the left, click Subnets.
  6. In the subnet list, click the name of the subnet that the virtual IP address belongs to.
  7. Click the IP Addresses tab, locate the row that contains the target virtual IP address, and click Bind to EIP or Bind to Server in the Operation column.
  8. Select the desired EIP, or ECS and its NIC.
    • If the ECS has multiple NICs, bind the virtual IP address to the primary NIC.
    • Multiple virtual IP addresses can be bound to an ECS NIC.
  9. Click OK.
  1. Manually configure a virtual IP address for an ECS that has been bound with the virtual IP address.

    After a virtual IP address is bound to an ECS NIC, you need to manually configure the virtual IP address on the ECS.

    Linux ECS (CentOS 7.2 64-bit is used as an example here.)
    1. Run the following command to check the NIC to which the virtual IP address is to be bound and the NIC connection:

      nmcli connection

      Figure 2 Checking the NIC and its connection

      In the preceding command output, eth0 in the DEVICE column indicates the NIC to which the virtual IP address is bound, and System eth0 in the NAME column indicates the corresponding connection.

    2. Run the following command to modify the corresponding connection and add the virtual IP address:

      nmcli connection modify "CONNECTION" ipv4.addresses VIP

      Figure 3 Configuring virtual IP address
    3. Restart the ECS and run the ip address command to check whether the virtual IP address has been configured.
      Figure 4 Checking whether the virtual IP address has been configured

      In the preceding command output, 192.168.1.137 is the virtual IP address.

    Windows ECS (Windows 7 is used as an example here.)

    1. Choose Control Panel > Network and Internet > Network Connections. Right-click the corresponding local connection and then click Properties.
    2. On the Network tab page, select Internet Protocol Version 4 (TCP/IPv4).
    3. Click Properties.
    4. Select Use the following IP address and set IP address to the private IP address of the ECS, for example, 192.168.10.41.
      Figure 5 Configuring private IP address
    5. Click Advanced.
    6. On the IP Settings tab, click Add in the IP addresses area.

      Add the virtual IP address. For example, 192.168.10.137.

      Figure 6 Configuring virtual IP address
    7. Click OK.
    8. In the Start menu, open the Windows command line window and run the following command to check whether the virtual IP address has been configured:

      ipconfig /all

      Figure 7 Checking whether the virtual IP address has been configured

      In the preceding command output, IPv4 Address is the virtual IP address 192.168.10.137, indicating that the virtual IP address of the ECS NIC has been correctly configured.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel