Using CFW to Protect Outbound SNAT Traffic
Scenarios
When there is a large number of ECSs running in a VPC, assigning an EIP to each of them reduces management efficiency and raises exposure to potential scans and attacks.
You can use a public NAT gateway to centrally manage the Internet ingress and egress of ECSs, reducing security risks. Cloud Firewall (CFW) is a next-generation cloud native firewall that protects Internet and VPC borders on the cloud. This section describes how to use CFW to protect private IP addresses against attacks when they access the Internet through an SNAT rule of a NAT gateway.
Preparations
- Create an enterprise router. For more information, see What Is an Enterprise Router?
- Create a firewall. For more information, see Creating a Firewall.
Constraints
- Only the CFW professional edition supports access control by private IP address.
- By default, CFW supports standard private CIDR blocks. To configure other CIDR blocks, modify the CIDR blocks or submit a service ticket to expand the CIDR blocks.
Networking for SNAT Protection

The request traffic and response traffic are transmitted over the same path.
Configuration Suggestions
- Create an independent VPC for the NAT gateway. To avoid affecting access control, do not deploy ECSs or other instances in this VPC.
- If the existing network is complex or improperly configured (for example, VPC CIDR blocks overlap, the NAT gateway has complex configurations, or east-west communication has been configured using VPC Peering), fully evaluate risks in network connectivity, route loops, and route conflicts.
- Test firewall configurations before applying them to a network. You can create a test server, configure the destination address route in the VPC route table, and use the test server in the VPC to check whether the entire service flow runs properly and whether the configured rules are effective. Switch the service flow over to the live network after the configurations pass the test.
- Before configuring blocking rules after CFW is enabled, check whether workloads are normal after traffic passes through the firewall. Gradually add rules and verify them in a timely manner. Once a problem is detected, disable protection in a timely manner to avoid affecting workloads.
- SNAT EIPs do not allow inbound access from the external network. Their outbound access control rules use the Internet border protection capabilities. Do not enable protection for EIPs bound to SNAT rules on the EIPs page because doing so may interrupt rule implementation and logging.
Configuration Process
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot