Help Center> Cloud Firewall> Best Practices> Using CFW to Protect SNAT> Connecting VPC1 and VPC-NAT to an Enterprise Router
Updated on 2024-05-14 GMT+08:00

Connecting VPC1 and VPC-NAT to an Enterprise Router

This section describes how to connect VPC1 and VPC-NAT to an enterprise router.

Step 1: Add a VPC Connection

For details, see Adding VPC Attachments to an Enterprise Router.

Two connections need to be added. Set their Attached Resource to VPC1 and VPC-NAT, respectively.

Step 2: Create Two Route Tables

  1. Log in to the management console.
  2. Click in the upper left corner of the management console and select a region or project.
  3. In the service list, click Enterprise Router under Networking. Click Manage Route Table.
  4. Create an association route table and a propagation route table, used for connecting to a protected VPC and a firewall, respectively.

    Click the Route Tables tab. Click Create Route Table. For more information, see Table 1.

    Table 1 Route table parameters

    Parameter

    Description

    Name

    Route table name.

    It must meet the following requirements:
    • Must contain 1 to 64 characters.
    • Can contain letters, digits, underscores (_), hyphens (-), and periods (.).

    Description

    Route table description

    Tag

    During the route table creation, you can tag the route table resources. Tags identify cloud resources for purposes of easy categorization and quick search.

    For details about tags, see Tag Overview.

    Create two route tables, to be used as an association route table and a propagation route table, respectively.

Step 3: Set an Association Route Table

  1. In the service list, click Enterprise Router under Networking. Click Manage Route Table.
  2. Create an association between VPC1 and VPC-NAT. On the route table configuration page, click the Associations tab and click Create Association. For more information, see Table 2.

    Figure 1 Creating an association
    Table 2 Association parameters

    Parameter

    Description

    Attachment Type

    Select VPC.

    Attachment

    Select the VPC attachment from the Attachment drop-down list.

    Two associations need to be added. Set their Attachment to VPC1 and VPC-NAT attachments, respectively.

  3. Add a static route to the firewall. Click the Routes tab and click Create Route. For more information, see Table 3.

    Figure 2 Creating a route
    Table 3 Route parameters

    Parameter

    Description

    Destination

    Set it to 0.0.0.0/0.

    Blackhole Route

    You are advised to disable this function. If it is enabled, the packets from a route that matches the destination address of the blackhole route will be discarded.

    Attachment Type

    Set Attachment Type to CFW instance.

    Next Hop

    Select the automatically generated firewall attachment cfw-er-auto-attach.

Step 4: Set a Propagation Route Table

  1. In the service list, click Enterprise Router under Networking. Click Manage Route Table.
  2. Configure associations. On the route table configuration page, select the propagation table, click the Associations tab, and click Create Association. For more information, see Table 4.

    Figure 3 Creating an association
    Table 4 Association parameters

    Parameter

    Description

    Attachment Type

    Set Attachment Type to CFW instance.

    Attachment

    Select the automatically generated firewall attachment cfw-er-auto-attach.

  3. Create a propagation for VPC1. On the route table setting page, click the Propagations tab and click Create Propagation. For more information, see Table 5.

    Figure 4 Creating a propagation
    Table 5 Propagation parameters

    Parameter

    Description

    Attachment Type

    Select VPC.

    Attachment

    Select the VPC1 attachment from the Attachment drop-down list.

  4. Add a static route to VPC-NAT. Click the Routes tab and click Create Route. For more information, see Table 6.

    Table 6 Route parameters

    Parameter

    Description

    Destination

    Set it to 0.0.0.0/0.

    Blackhole Route

    You are advised to disable this function. If it is enabled, the packets from a route that matches the destination address of the blackhole route will be discarded.

    Attachment Type

    Select VPC.

    Next Hop

    Select the VPC-NAT attachment from the drop-down list.