This topic provides multiple methods for enabling public bandwidth for an Elastic Compute Service (ECS) instance based on your business requirements. When public bandwidth is enabled for an ECS instance, the instance can access the Internet.
Enable IPv4 public bandwidth
Method | Applicable scenario | Benefit | References |
Assign a static public IP address to the ECS instance | This method is suitable for scenarios in which the ECS instance must retain a static public IP address (also known as auto-assigned or system-assigned public IP address) to access the Internet for an extended period of time. Example: The ECS instance provides continuous services. |
|
|
Associate an elastic IP address (EIP) with the ECS instance | This method is suitable for scenarios in which Internet access requirements or network configuration requirements have temporary or dynamic changes or for scenarios that have other special requirements for access to the Internet. Examples:
|
| |
Associate an Anycast EIP with the ECS instance | This method is suitable for services that are deployed in specific regions outside the Chinese mainland. For more information, see the Components section of the "What is Anycast EIP?" topic.
|
| |
Use a NAT gateway to translate network addresses | This method is suitable for scenarios in which multiple ECS instances need to access the Internet or share public bandwidth or for scenarios that have special access requirements. Examples:
|
| |
Distribute Internet traffic by using Server Load Balancer (SLB) | This method is suitable for large-scale high-concurrency Internet applications, such as red envelope snatching during Chinese New Year, Double 11 promotions, and large-scale online IoT applications.
| You can associate multiple backend servers with an SLB instance in multiple zones to distribute traffic (IPv4 and IPv6) to different backend servers to increase the service throughput of the application system, eliminate single points of failure (SPOFs) in the system, and improve the availability of the application system. For more information, see What is SLB? |
Enable IPv6 public bandwidth
Method | Applicable scenario | Benefit | References |
Assign an IPv6 address for which public bandwidth is enabled to the ECS instance | This method is suitable for applications or services that support IPv6.
| Compared with the traditional IPv4 scheme, IPv6 provides more sufficient address space and more advanced network features. Support direct access to the IPv6 Internet. | |
Distribute Internet traffic by using SLB | This method is suitable for large-scale high-concurrency Internet applications, such as red envelope snatching during Chinese New Year, Double 11 promotions, and large-scale online IoT applications.
| You can associate multiple backend servers with an SLB instance in multiple zones to distribute traffic (IPv4 and IPv6) to different backend servers to increase the service throughput of the application system, eliminate SPOFs in the system, and improve the availability of the application system. For more information, see What is SLB? |
References
You can flexibly modify bandwidth configurations or change billing methods for static public IP addresses and EIPs. For more information, see Modify bandwidth configurations.
For information about billing for services in this topic, see Public bandwidth, Billing overview of EIPs, Billing rules of Anycast EIPs, Billing overview of NAT Gateway, Billing rules of IPv6 gateways, and SLB billing.
If you want to host multiple applications on one ECS instance and each application exposes an independent public IP address, you can associate multiple EIPs with the ECS instance by using secondary elastic network interfaces (ENIs). For more information, see Associate multiple EIPs with an ECS instance in NAT mode.