Help Center/ Elastic IP/ FAQs/ Product Consultation/ What Are the Differences Between EIP, Private IP Address, and Virtual IP Address?
Updated on 2024-10-30 GMT+08:00

What Are the Differences Between EIP, Private IP Address, and Virtual IP Address?

Different types of IP addresses have different functions.

Figure 1 IP address architecture
Table 1 Functions of different IP address types

IP Address Type

Description

Example Value

Private IP address

Private IP addresses come with your ECSs and belong to the VPC subnets of the ECSs. They are used for private communication on the cloud.

  • Private IP address of ECS-A-01: 172.16.0.84
  • Private IP address of ECS-B-01: 172.16.1.12

Virtual IP address

A virtual IP address is a private IP address that can be independently assigned from and released to a VPC subnet. You can:
  • Bind one or more virtual IP addresses to a cloud server so that you can use either the virtual IP address or private IP address to access the server. If you have multiple services running on a cloud server, you can use different virtual IP addresses to access them.
  • Bind a virtual IP address to multiple cloud servers. You can use a virtual IP address and an HA software (such as Keepalived) to set up a high-availability active/standby cluster. If you want to improve service availability and eliminate single points of failure, you can deploy cloud servers in the active/standby pair or deploy one cloud server and multiple standby cloud servers. In this case, the cloud servers can use the same virtual IP address. If the active cloud server goes down, the standby cloud server becomes the active server and continues to provide services.

For more information about virtual IP addresses, see Virtual IP Address Overview. For details about how to set up a high availability cluster, see Using a Virtual IP Address and Keepalived to Set Up a High-Availability Web Cluster.

Bind virtual IP address (172.16.0.2) both ECS-A-01 and ECS-A-02. The active/standby switchover of ECS-A-01 and ECS-A-02 can be implemented by using Keepalived.

EIP

EIPs allow cloud resources to access the Internet. They can be flexibly bound to or unbound from instances.

  • You can bind an EIP to a virtual IP address to enable the ECSs with the virtual IP address bound to access the Internet.
  • You can also bind an EIP to the ECSs to enable them to access the Internet.

For more information, see EIP Overview.

  • Bind EIP (122.9.9.85) to virtual IP address (172.16.0.2) to enable ECS-A-01 and ECS-A-02 to access the Internet.
  • Bind EIP (122.9.9.87) to ECS-B-01 to enable ECS-B-01 to access the Internet.