Configure a VPC firewall for an Enterprise Edition transit router
If your network instances, such as Virtual Private Clouds (VPCs), Virtual Border Routers (VBRs), Express Connect gateways, and VPN gateways, are connected through an Enterprise Edition transit router (TR) in a Cloud Enterprise Network (CEN), you can deploy a VPC firewall to protect traffic between the instances and improve the security of your assets. This topic describes how to create and manage a VPC firewall for an Enterprise Edition transit router.
How it works
The VPC firewall uses a traffic redirection architecture. It creates a dedicated firewall VPC instance that acts as a traffic inspection center. Traffic between network instances, such as VPCs, VBRs, Express Connect gateways, VPN gateways, and transit routers (TRs), is redirected to the firewall VPC, where access control policies and the intrusion prevention system (IPS) provide protection.
As traffic passes through the firewall VPC, Cloud Firewall performs the following actions:
Access control: Allows or denies network connection requests based on predefined policies.
IPS protection: Uses an intrusion prevention system to detect and block malicious traffic in real time.
After inspection and processing, compliant traffic is forwarded back to the destination network instance, providing unified security management for your network.
Prerequisites
You have subscribed to the Enterprise, Ultimate, or pay-as-you-go edition of Cloud Firewall. The Premium subscription edition does not support the VPC firewall. For more information, see Feature comparison and edition selection.
You have purchased a Cloud Enterprise Network (CEN) instance and use an Enterprise Edition transit router to connect your VPCs or to link your cloud and on-premises networks.
All network instances within the CEN must be in regions that support the VPC firewall. Otherwise, you cannot enable the VPC firewall. For more information, see Supported regions.
Limitations
The automatic traffic redirection mode is not supported in the following scenarios:
The route table of the Enterprise Edition transit router contains static routes, except for routes to the 100.64.0.0/10 CIDR block and its subnets.
A network instance, such as a VPC, VBR, or TR, can be added to only one traffic redirection scenario.
The use of a Basic Edition transit router in the traffic redirection mode.
The route table of the Enterprise Edition transit router contains route conflicts, prefix list routes, or blackhole routes.
The VPC firewall does not protect traffic from a VPN gateway, such as an IPsec-VPN or SSL-VPN gateway, that is directly connected to a VPC. However, it does protect traffic when an IPsec-VPN connection is attached to a transit router. For more information, see Get started with transit router attachments.
The VPC firewall does not protect IPv6 traffic.
Traffic destined for the cloud service CIDR block (100.64.0.0/10) and traffic on routes with a 32-bit subnet mask are not redirected to the VPC firewall for protection.
You must maintain the following configurations:
Routing policies in the route table of the CEN transit router, such as the route priority policy for a VBR in the TR route table of the VPC firewall.
Static routes for the cloud service CIDR block (100.64.0.0/10).
Route learning configurations in the system route table.
Impact on your business
Instance creation: Creating a VPC firewall instance does not affect your services.
Enable Traffic Redirection: This step modifies route tables and may cause transient interruptions to long-lived connections. We recommend that you perform this operation during off-peak hours.
Automatic mode: Route modification takes 5 to 30 minutes, depending on the number of route entries.
Manual mode: You must configure the routes. The duration of service impact depends on how long the operation takes.
Create a VPC firewall and redirect traffic
Log on to the Cloud Firewall console. In the left-side navigation pane, click Firewall.
On the Firewall page, click VPC Firewall.
On the VPC Firewall tab, click CEN (Enterprise Edition).
Find the target CEN instance and click Create in the Actions column.
If the target instance is not in the asset list, click Synchronize Assets, wait for the synchronization to complete, and then refresh the page.
In the Precheck step, select a traffic redirection mode. The following modes are supported:
Automatic (Recommended): This mode is suitable for most scenarios and automatically configures routes. For VPC firewall instances created with a pay-as-you-go Cloud Firewall subscription or with a subscription with the elastic pay-as-you-go feature enabled (a feature included in all current subscription editions), Cloud Firewall covers the cost of traffic that the VPC firewall processes and returns to the Enterprise Edition transit router. You are not charged for this traffic, and this mode does not consume your VPC specification quota.
Manual: This mode is suitable for scenarios where the automatic mode is not supported. For more information, see "Limitations". You must manually configure the CEN transit router and VPC network instances to route traffic to Cloud Firewall. This process is complex, and Cloud Firewall cannot automatically synchronize newly added network segments. You must maintain the configurations.
NoteIn Manual mode, if you select Custom VPC as the firewall VPC, you are charged for the transit router traffic that the VPC firewall processes and sends back to the Enterprise Edition transit router.
If you select Managed VPC, for a pay-as-you-go Cloud Firewall subscription or a VPC firewall instance created after the elastic pay-as-you-go feature is enabled for a subscription (a feature included in all current subscription editions), Cloud Firewall covers the related traffic costs. You are not charged.
Complete the following configurations based on the selected redirection mode.
Automatic
On the Precheck page, click Check Now. After the check passes, click Next. You can skip the check if you are familiar with the rules.
In the Create VPC Firewall panel, complete the following configurations and click Start Creation.
Parameter
Description
Firewall Basic Information
Firewall Name and Description: Set an easy-to-identify name and description for the VPC firewall.
VPC Configurations of Firewall
VPC CIDR Block of Firewall and Firewall vSwitch Zone: Configure a CIDR block and zone for the firewall's VPC. Assign a CIDR block with a /27 prefix or smaller address space that does not conflict with your existing network plan. This firewall VPC is managed by the system and is not displayed in the console of your Alibaba Cloud account.
Firewall High Availability Mode: Active-Active and Primary/Standby modes are supported.
Active-Active: The system automatically selects the Firewall Zone. No configuration is required.
Primary/Standby: Manually select a Primary Zone and a Secondary Zone.
Transit Router Connection Zone: Set the zone for the firewall VPC's transit router connection.
Access Control
Configure the ACL Engine Mode. This mode applies to all VPCs in the current CEN.
Standard Mode (Strict Mode): This mode is recommended. After you configure domain or application policies, traffic from unidentified applications or domains is strictly matched against the policies. If the traffic matches a deny policy, the unidentified traffic is blocked from accessing the business.
Loose Mode: After you configure domain or application policies, traffic from unidentified applications or domains is allowed to pass without policy matching to prioritize business continuity.
IPS
Select a policy for the intrusion prevention system (IPS) module. This policy applies to all VPCs in the current CEN.
IPS Mode: Select a mode based on your business sensitivity and protection needs.
Monitor Mode: Only records and generates alerts for attacks, without performing interception.
Block Mode: Intercepts malicious traffic to block intrusions. It is available in three levels of strictness: Blocking Mode - Loose, Blocking Mode - Medium, and Blocking Mode - Strict. You can choose the level that meets your business requirements.
IPS Capabilities: The following two capabilities are supported. We recommend that you select both.
Basic Rules: Provides foundational protection, including blocking brute-force attacks and command execution vulnerabilities, and controlling connections to command and control (C&C) servers after an infection.
Virtual Patching: Provides real-time protection against popular and high-risk application vulnerabilities.
On the Create Firewall page, wait for the instance creation to complete and then click Next.
NoteOn the Create Firewall page, the system performs the following operations:
Creates a firewall VPC to redirect traffic between your business VPCs. This VPC is not displayed in the console of your Alibaba Cloud account. You cannot and do not need to manage it manually.
Creates a network connection in the transit router and attaches the firewall VPC to the transit router.
Creates a custom transit router route table to serve as the firewall route table (trusted route table). The route table is named
Cloud_Firewall_ROUTE_TABLEand reserved for future use. At this step, the system configures only the forwarding association between the firewall route table and the firewall VPC. No other network instances are associated, and no traffic is redirected.
On the Enable Traffic Redirection page, complete the following configurations. This step modifies the route table configuration. If you cannot configure traffic redirection at the moment, you can close this page and configure it later. On the CEN (Enterprise Edition) tab, find the target VPC firewall instance, click Firewall Status in the Configure Now column, and then click Immediately Create Traffic Redirection Scenario on the Traffic Redirection Scenario tab.
Parameter
Description
Basic Information
Template Name and Description: Set an easy-to-identify name and description for the redirection template.
Select a scenario
Based on the diagram, select the type of scenario to be protected by the VPC firewall.
A network instance is a network resource connected by using a transit router. A network instance can be a VPC, Express Connect Router (ECR), VPN Gateway, Virtual Border Router (VBR), or transit router (TR).
Interconnected Instances: Manages traffic between multiple network instances. This scenario is suitable for full-mesh network topologies.
Instance-Instance: Manages traffic between two network instances. This scenario is suitable for simple network topologies.
Instance to Instances: Manages traffic between one network instance and multiple network instances. This scenario is suitable for hub-spoke network topologies. You can select ALL for the secondary redirection instances to redirect all traffic to the primary instance through Cloud Firewall. If a custom deny route policy exists in the route table of the transit router, the point-to-multipoint redirection scenario is not supported. In this case, we recommend that you use the multi-point interconnection scenario.
Select Traffic Redirection Instance
Select redirection objects based on their instance names and IDs.
Click OK. The system automatically configures traffic redirection. This process is expected to take 5 to 30 minutes.
NoteDuring this step, the system performs the following operations:
Creates a custom transit router route table to serve as the business route table (untrusted route table). The route table is named
Please_Do_Not_Edit_Cloud_Firewall_Route_Table.Migrates the forwarding associations of the business VPCs from the original system route table to the new business route table and creates route entries to redirect traffic between the business VPCs to the firewall VPC.
Creates route entries in the firewall route table to forward traffic processed by the firewall VPC back to the business VPCs.
After the configuration is complete, take note of the following items:
The system has created and configured two route tables in the transit router: a business route table and a firewall route table. You can view the configurations in the CEN console. Do not modify or delete the configurations.
To add or remove protected network instances, go to the CEN (Enterprise Edition) tab, find the target VPC firewall instance, click Details in the Actions column, and then Edit the redirection scenario on the Traffic Redirection Scenario tab.
After you edit a redirection scenario, the system reconfigures the redirection routes. This process is expected to take 5 to 30 minutes.
Editing a redirection scenario involves route changes. We recommend that you perform this operation during off-peak hours.
Manual
In the Create VPC Firewall panel, complete the following configurations and click Start Creation.
Parameter
Description
Firewall Basic Information
Firewall Name and Description: Set an easy-to-identify name and description for the VPC firewall.
Configuration Mode: Custom VPC and Managed VPC modes are supported.
Custom VPC: Manually select a VPC that is already attached to the transit router as the firewall VPC. We recommend that you use a VPC that is isolated from your business VPCs. Select the Associated VPC and Firewall vSwitch.
NoteIf you select Custom VPC, its network architecture must support the subnet routing feature. You can enable this feature by creating a custom route table in the target VPC.
Managed VPC: Use a system-managed VPC. Assign a non-conflicting CIDR block with a /27 prefix or a smaller address space. This VPC is not displayed in the console of your Alibaba Cloud account. You must set the VPC CIDR Block of Firewall, Firewall vSwitch Zone, and Transit Router Connection Zone.
Firewall High Availability Mode: Active-Active and Primary/Standby modes are supported.
Active-Active: The system automatically selects the Firewall Zone. No configuration is required.
Primary/Standby: Manually select a Primary Zone and a Secondary Zone.
Access Control
Configure the ACL Engine Mode. This mode applies to all VPCs in the current CEN.
Standard Mode (Strict Mode): This mode is recommended. After you configure domain or application policies, traffic from unidentified applications or domains is strictly matched against the policies. If the traffic matches a deny policy, the unidentified traffic is blocked from accessing the business.
Loose Mode: After you configure domain or application policies, traffic from unidentified applications or domains is allowed to pass without policy matching to prioritize business continuity.
IPS
Select a policy for the intrusion prevention system (IPS) module. This policy applies to all VPCs in the current CEN.
IPS Mode: Select a mode based on your business sensitivity and protection needs.
Monitor Mode: Only records and generates alerts for attacks, without performing interception.
Block Mode: Intercepts malicious traffic to block intrusions. It is available in three levels of strictness: Blocking Mode - Loose, Blocking Mode - Medium, and Blocking Mode - Strict. You can choose the level that meets your business requirements.
IPS Capabilities: The following two capabilities are supported. We recommend that you select both.
Basic Rules: Provides foundational protection, including blocking brute-force attacks and command execution vulnerabilities, and controlling connections to command and control (C&C) servers after an infection.
Virtual Patching: Provides real-time protection against popular and high-risk application vulnerabilities.
On the Create Firewall page, wait for the instance to be created and click Next until the process is complete. Then, close the Create VPC Firewall page and proceed to manually configure your routes. We recommend that you modify routes during off-peak hours.
Go to the CEN console to configure the Route Table. For detailed steps, see Configure route entries for a network instance. We recommend that you follow these best practices based on your business requirements:
Plan your route table architecture (dual-table isolation recommended)
We recommend that you create two custom route tables in the transit router to logically isolate the traffic redirection and return paths:Redirection route table: In the association settings, attach all network instances that require protection, such as business VPCs and VBRs.
Return route table: In the association settings, attach the Cloud Firewall VPC connection.
Configure the redirection route table
In the redirection route table, add custom route entries to direct business traffic to the firewall:Destination CIDR Block: Enter the specific private network segments that require protection, for example,
10.0.0.0/8,172.16.0.0/12, and192.168.0.0/16.Note: Do not configure the
0.0.0.0/0route because this can misroute traffic destined for the internet to the VPC firewall and cause service disruptions.Next Hop: Select the Cloud Firewall VPC connection.
Configure the return route table
In the return route table, add custom route entries to ensure that traffic processed by the firewall is correctly routed back to the destination network:
Destination CIDR Block: Enter the private network segments of all business VPCs. These segments must cover all destination CIDR blocks in the redirection route table.
Next Hop: Select the corresponding business VPC connection or VBR connection.
After the configuration is complete, take note of the following items:
Clean up routes before you delete the firewall instance: To prevent service disruptions, you must manually delete the route entries that point to the VPC firewall from the transit router before you delete the firewall instance.
Renew subscription instances in a timely manner: If you use a subscription-based Cloud Firewall, renew the subscription before it expires. Otherwise, your network may be disconnected.
Next steps
Configure access control policies: By default, a VPC firewall has no access control policies configured. To control traffic, you must create these policies. For more information, see Configure an access control policy for a VPC firewall.
View inter-VPC traffic: After you enable the VPC firewall, you can use the VPC Traffic feature to view traffic between your VPCs. For more information, see VPC traffic.
View traffic logs: For more detailed traffic logs, use the Log Analysis feature to view traffic logs. For more information, see Log Analysis.
Routine O&M
On the CEN (Enterprise Edition) tab, you can perform the following O&M operations on the VPC firewall.
Manage traffic redirection scenarios (automatic mode only): Find the target firewall instance, click Actions in the Details column, and go to the Traffic Redirection Scenario tab.
View route details: Click Route Details on a scenario card to view the redirection routes automatically configured by Cloud Firewall.
Edit a traffic redirection scenario: Click Edit on a scenario card to modify the scenario.
Enable or disable a traffic redirection scenario: Use the switch on a scenario card to enable or disable it. When you disable a scenario, two route modification modes are available:
Roll Back Route: This mode is suitable for scenarios where you did not modify the CEN transit router routes before you disable the scenario. The system deletes the redirection route table created by Cloud Firewall and restores traffic to the original route table. This process takes about 1 minute.
Withdraw Route: This mode is suitable for scenarios where you modified the CEN transit router routes before you disable the scenario. The system deletes only the route entries created by Cloud Firewall but does not delete the route table. The time required depends on the number of route entries.
ImportantEditing, enabling, or disabling redirection scenarios involves route modifications that take 5 to 30 minutes. We recommend that you perform these operations during off-peak hours.
Delete a traffic redirection scenario: Click Delete on a scenario card. You must disable the scenario before you can delete it.
Modify IPS configurations: Find the target firewall instance and click Actions in the Configure IPS column. Go to the IPS Configuration page to configure IPS. For more information, see IPS configuration.
Delete the VPC firewall: Find the target firewall instance and click Delete in the Actions column.
ImportantManual mode: Before you delete the instance, you must manually delete the route entries in the transit router that point to the VPC firewall to prevent service disruptions.
Automatic mode: If the firewall is enabled, you must delete all traffic redirection scenarios before you can delete the VPC firewall instance.