Network access control lists (ACLs) allow you to regulate access control for a virtual private cloud (VPC). You can create network ACL rules and associate a network ACL with a vSwitch. This allows you to control inbound and outbound traffic of Elastic Compute Service (ECS) instances that are associated with the vSwitch.
Feature release and supported regions
|Asia-Pacific||China (Hohhot), China (Ulanqab), China (Heyuan), China (Guangzhou), China (Chengdu), Japan (Tokyo), Singapore (Singapore), Australia (Sydney), Malaysia (Kuala Lumpur), and Indonesia (Jakarta)|
|Europe and Americas||UK (London), US (Silicon Valley), US (Virginia), and Germany (Frankfurt)|
|Middle East and India||India (Mumbai) and UAE (Dubai)|
|Asia-Pacific||China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hangzhou), China (Shanghai), China (Shenzhen), and China (Hong Kong)|
- A network ACL is used to filter inbound and outbound network traffic of ECS instances
that are associated with a vSwitch in a VPC. The network traffic forwarded to ECS
instances by Server Load Balancer (SLB) instances is also filtered.
Note The inbound and outbound network traffic of an ECS instance are not filtered by network ACLs in the following scenario: The ECS instance is associated with a secondary elastic network interface (ENI) and the secondary ENI is assigned an elastic IP address (EIP) in cut-through mode. For more information, see Associate an EIP with a secondary ENI in cut-through mode.
- Network ACLs are stateless. You must set both inbound and outbound rules. Otherwise, the system may fail to respond to requests.
- If you create a network ACL that does not contain a rule, all inbound and outbound access are denied.
- If a network ACL is associated with a vSwitch, the network ACL does not filter the traffic forwarded between ECS instances that are associated with the vSwitch.
Network ACL rules
You can add rules to or delete rules from a network ACL. Changes to the rules are automatically synchronized to the associated vSwitch. By default, an inbound and an outbound rule are automatically added to a newly created network ACL. These rules allow all inbound and outbound network traffic transmitted through the associated vSwitch. You can delete the default rules. The following table lists the default inbound and outbound rules.
- Default inbound rule
Priority Protocol type Source CIDR block Source port range Action Message 1 all 0.0.0.0/0 -1/-1 Allow Custom
- Default outbound rule
Priority Protocol type Destination CIDR block Destination port range Action Message 1 all 0.0.0.0/0 -1/-1 Allow Custom
- Priority: A smaller value indicates a higher priority. The system attempts to match
traffic requests with rules in descending order of priority that starts from the rule
whose priority is 1. If a request matches a rule, the system applies the rule to the
request and ignores the other rules.
For example, the following rules are added and requests destined for IP address 172.16.0.1 are sent from an ECS instance. In the following table, the requests match Rules 2 and 3. Rule 2 has a higher priority than Rule 3. Therefore, the system applies Rule 2. Based on the action of Rule 2, the requests are denied.
Priority Protocol type Destination CIDR block Destination port range Action Message 1 all 10.0.0.0/8 -1/-1 Allow Custom 2 all 172.16.0.0/12 -1/-1 Block Custom 3 all 172.16.0.0/12 -1/-1 Allow Custom
- Policy: specifies whether to allow or block specific traffic.
- Protocol: the protocol. Available options include All, ICMP, GRE, TCP, and UDP.
- Source CIDR block: the source CIDR block from which inbound traffic is transmitted.
- Destination CIDR block: the destination CIDR block to which outbound traffic is transmitted.
- Source port range: the range of source ports to which the inbound rule applies.
- Destination port range: the range of destination ports to which the outbound rule applies.
Comparison between network ACLs and security groups
Network ACLs control data transmitted through associated vSwitches while security groups control data transmitted through associated ECS instances. The following table lists the differences between network ACLs and security groups.
|Network ACL||Security group|
|Applied to vSwitches.||Applied to instances.|
|Stateless: Returned traffic must be allowed by inbound rules.||Stateful: Returned traffic is automatically allowed and not affected by rules.|
|The system attempts to match requests with rules in descending order of priority. Not all rules are matched.||The system matches a request against all rules before a rule is applied.|
|Each vSwitch can be associated with only one network ACL.||Each ECS instance can be added to more than one security group.|
The following figure shows how network ACLs and security groups are applied to ensure network security.
Before you use network ACLs, take note of the following limits.
|Number of network ACLs that can be created in each VPC||200||N/A|
|Number of network ACLs that can be associated with each vSwitch||1|
|Number of rules that can be added to a network ACL||
|VPCs that do not support network ACLs||VPCs that contain ECS instances of the following instance families:
ecs.c1, ecs.c2, ecs.c4, ecs.ce4, ecs.cm4, ecs.d1, ecs.e3, ecs.e4, ecs.ga1, ecs.gn4, ecs.gn5, ecs.i1, ecs.m1, ecs.m2, ecs.mn4, ecs.n1, ecs.n2, ecs.n4, ecs.s1, ecs.s2, ecs.s3, ecs.se1, ecs.sn1, ecs.sn2, ecs.t1, and ecs.xn4.
For more information, see Advanced VPC features.
Upgrade or release an Elastic Compute Service (ECS) instance that does not support advanced network features.
Note If the VPC contains one of the specified ECS instance families and the network ACL feature is enabled, you must upgrade or release the ECS instance for the network ACL to function as expected.
The following flowchart shows how to use a network ACL.