This topic describes how to use network access control lists (ACLs) to manage communication between a data center and a virtual private cloud (VPC).
Prerequisites
- A VPC and a vSwitch are created. For more information, see Create and manage a VPC and Work with vSwitches.
- Elastic Compute Service (ECS) instances are created in the vSwitch. For more information, see Create an instance by using the wizard.
- The ECS instances are added to a security group that allows the HTTP services on the ECS instances to be accessed over the Internet. For more information, see Security group rules for websites to provide web services.
Background information
A company has created an Internet-facing Server Load Balancer (SLB) instance and ECS instances. Static pages are hosted on the ECS instances. A listener has been configured for the SLB instance, and the ECS instances are added as backend servers for the SLB instance. By default, Data Center 1 and Data Center 2 can access the static pages through the public IP address of the SLB instance. To meet business requirements, the company wants to allow Data Center 1 to access the static pages, and deny access from Data Center 2 to the static pages.
Network | Public IP address |
---|---|
Data Center 1 | 111.XX.XX.111 |
Data Center 2 | 222.XX.XX.222 |
SLB instance | 33.XX.XX.33 |

You can associate a network ACL with the vSwitch to which the ECS instances belong. Then, you can configure network ACL rules to control inbound and outbound network traffic transmitted through the vSwitch.

Step 1: Create a network ACL
Step 2: Associate the network ACL with a vSwitch
- Log on to the VPC console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select the region where the network ACL is created.
- On the Network ACL page, find the network ACL that you want to manage and click its ID.
- On the Resources tab, click Associate vSwitch.
- In the Associate vSwitch dialog box, select the vSwitch and click OK.
Step 3: Add rules to the network ACL
Add inbound and outbound rules to the network ACL.
Step 4: Test the connectivity
To test the connectivity between the data centers and the SLB instance, perform the following steps: