Accessing the Public Network from a Container
You can use to enable containers in a VPC to access the public network. NAT Gateway provides source network address translation (SNAT), which translates private IP addresses to an EIP, providing secure and efficient access to the public network. Figure 1 shows the SNAT architecture. SNAT makes it unnecessary to bind an EIP to each pod in a VPC. SNAT supports a large number of concurrent connections, so it is a good fit for applications involving a large number of requests and connections.
To enable pods to access the public network, take the following steps:
- an EIP.
- Log in to the EIP console.
- On the EIPs page, click EIP.
- Configure the parameters.

- a NAT gateway.
- Log in to the NAT Gateway console.
- Click .
- Configure the parameters.

- Configure an SNAT rule and bind the EIP to the subnet.
- Click the name of the NAT gateway for which you want to add the SNAT rule.
- On the SNAT Rules tab, click Add SNAT Rule.
- Configure the parameters.

After the SNAT rule is configured, containers can access the public network.

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.

