You can connect a VPC to the public network (internet) in several ways, including public IPs, EIPs, NAT gateways, and CLBs. Please watch the following video to learn more.
Public IP
When creating a Cloud Virtual Machine (CVM) instance, you can choose to allocate a common public IP address. The system will assign an IP address to your CVM, enabling it to access and be accessed by the public network.
Common public IP addresses cannot be dynamically unbound or bound to resources like CVMs. However, you can convert a common public IP address to an Elastic IP (EIP). For detailed instructions, please refer to Converting a Common Public IP to an EIP.
Elastic IP (EIP)
Elastic IP (EIP) is an independently owned IP resource. Unlike public IP addresses, which can only be applied for and released with a Cloud Virtual Machine (CVM), EIPs can be decoupled from the CVM lifecycle and managed as separate cloud resources.
For EIP application, binding, and release operations, please refer to Operation Overview.
EIPs offer the following advantages:
Independent resource ownership
Elastic IPs can be owned independently under your account, without the need to be purchased and bound with a Cloud Virtual Machine. They can be managed as standalone cloud resources.
Flexible bindings
EIPs can be flexibly bound to and unbound from resources such as CVMs at any time, providing high availability.
NAT Gateway
If you have multiple Cloud Virtual Machines that need to access the public network through a single public IP address, a NAT gateway can meet your requirements. NAT gateways provide SNAT and DNAT functionality for Cloud Virtual Machines within a Virtual Private Cloud, making it easy to set up public network egress and offer services.
For NAT gateway configuration and operations, please refer to NAT Gateway - Operation Overview.
NAT gateways offer the following advantages:
Secure public network access:
NAT gateways provide SNAT and DNAT functionality, enabling communication with the public network while concealing the IP addresses of hosts within the VPC, ensuring security.
High Availability:
NAT gateways feature dual-server hot backup and automatic hot switching, supporting up to 5 Gbps forwarding capabilities, providing robust support for your large-scale public network applications.
Flexible configuration
You can modify the NAT gateway specifications as needed at any time.
Cloud Load Balancer
Cloud Load Balancer (CLB) is a service that distributes traffic among multiple Cloud Virtual Machines (CVMs). By distributing traffic, CLB enhances the external service capabilities of application systems and improves their availability by eliminating single points of failure.
For purchasing and configuring Cloud Load Balancer, please refer to Cloud Load Balancer Quick Start.
Cloud Load Balancer offers the following advantages:
High performance
A CLB cluster consists of multiple physical servers, offering an availability of up to 99.95%. Faulty instances are removed automatically to ensure the normal operation of applications on the backend server.
Secure and stable
CLB is combined with Anti-DDoS to defend against most network attacks (such as DDoS attacks). Attacking traffic can be cleansed in seconds, which greatly avoids IP blocking and bandwidth overload.
Public Gateway
A public gateway is a CVM that works as a forwarder. With public gateways in different subnets, CVMs in a VPC can access the internet even if they don't have public IPs. A public gateway translates the source address for public network traffic, which means that when CVMs accessing the internet over the public gateway, their IPs will be translated to the public gateway IPs.
For details on public gateway configuration, see Configuring a Public Gateway.