IP addresses are used to connect to ECS instances or their deployed services. 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 over the internal network between ECS instances within the same LAN
  • Communication over the internal network between an ECS instance and other cloud services such as OSS and ApsaraDB RDS within the same LAN

You can use the ECS console to modify the private IP addresses of ECS instances within VPCs. For more information, see Change the private IP address of an 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: the public IP addresses assigned by the ECS system.
  • Elastic IP address (EIPs). For more information, see What is an EIP?

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

Item NatPublicIP address EIP
Scenarios You may want the system to automatically assign a public IP address to an ECS instance when you create the instance. However, you do not want the public IP address to be retained when the instance is released. In this case, use a NatPublicIP address. If you want to retain a public IP address to use with other ECS instances deployed within the same region, use an EIP. Each EIP can be associated with or disassociated from different ECS instances. After an instance is released, its associated EIP is retained.
Method to obtain an address If you select Assign Public IP Address when you create an ECS instance within a VPC, a NatPublicIP address is assigned to the instance. An EIP is created and associated with an ECS instance that is not assigned a NatPublicIP address. For more information, see Apply for new EIPs.
Maximum number of public IP addresses that can be assigned to or associated with a single ECS instance An ECS instance can only be assigned a single NatPublicIP address. Multiple EIPs can be associated with a single ECS instance in multi-EIP to ENI mode. For more information, see Associate EIPs with secondary ENIs in multi-EIP-to-ENI mode.
Method to disassociate an address After a NatPublicIP address is assigned to an ECS instance, the address can be only released and cannot be disassociated from the instance. See Disassociate an EIP from a cloud resource.
Method to release an address See Release an EIP.
Method to view the MAC address ECS instances within VPCs are connected to the Internet by using the mapping of public IP addresses to internal network interface controllers (NICs). Therefore, the public NICs of ECS instances within VPCs cannot be located regardless of whether the instances are assigned NatPublicIP addresses or associated with EIPs.

Billing

You are billed only for outbound Internet traffic. For more information, see Public bandwidth.