IP addresses are used for access to ECS instances or to the services deployed on the instances. ECS instances within VPCs can be assigned two types of IP addresses: private IP addresses and public IP addresses.

Private IP addresses

Each new ECS instance within a VPC is assigned a private IP address based on the VPC and CIDR block of the VSwitch to which the instance is connected. Private IP addresses can be used in the following scenarios:
  • Load balancing
  • Communication between ECS instances within the internal network
  • Communication between an ECS instance and other cloud services such as OSS and ApsaraDB for RDS within the internal network

You can use the ECS console to modify the private IP addresses of ECS instances within VPCs based on your business needs. For more information, see Change the private IP of an ECS instance. For more information about internal network communication, see Intranet.

Public IP addresses

ECS instances within VPCs support the following types of public IP addresses:
  • NatPublicIP addresses, which are the public IP addresses assigned by the ECS system
  • Elastic IP addresses (EIPs). For more information, see What are Elastic IP Addresses.

The following table lists the major differences between the two types of public IP addresses.

Item NatPublicIP address EIP
Scenarios If you want to assign a public IP address to an ECS instance during instance creation but do not want the public IP address to be retained when the instance is released, use a NatPublicIP address. If you want to retain a public IP address to be used with other ECS instances located within the same region, use an EIP. Each EIP can be associated or unassociated with different ECS instances. After an instance is released, its associated EIP will be retained.
Method to obtain an address If you select Assign Public IP Address when creating an ECS instance within a VPC, a NatPublicIP address is assigned to the instance. Create an EIP, and associate it to an ECS instance that is not assigned a NatPublicIP address. For more information, see Create an Elastic IP address.
Maximum number of public IP addresses that can be assigned or associated to a single ECS instance An ECS instance can only be assigned a single NatPublicIP address. Multiple EIPs can be associated to a single ECS instance in multi-EIP to ENI mode. For information about how to configure the multi-EIP to ENI mode, see Set the multi-EIP to ENI mode.
Method to unassociate an address After a NatPublicIP address is assigned to an ECS instance, the address can be released only and cannot be unassociated from the instance. See Unbind an Elastic IP address from a cloud instance.
Method to release an address
  • When ECS instances are released, their assigned NatPublicIP addresses are also released.
  • During the lifecycle of an ECS instance, you can release its NatPublicIP address by setting the public bandwidth of the instance to 0 Mbit/s. For information about how to modify the public bandwidth of a pay-as-you-go ECS instances, see Change bandwidth of Pay-As-You-Go instance.
See Release An EIP.
Method to view the MAC address ECS instances within VPCs access the Internet through the mapping of public IP addresses to internal NICs. Therefore, you cannot find public NICs inside ECS instances within VPCs regardless of whether the instances are assigned NatPublicIP addresses or associated with EIPs.

Billing

You are only billed for outbound Internet traffic. For more information, see Billing methods of Internet bandwidth.