Updated on 2024-04-19 GMT+08:00

Step 4: Create VPC Attachments to the Enterprise Router

Scenarios

This section describes how to attach the four VPCs to the enterprise router.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner and select the desired region and project.
  3. Click Service List and choose Networking > Enterprise Router.

    The Enterprise Router homepage is displayed.

  4. Search for the target enterprise router by name.
  5. Go to the Attachments tab using either of the following methods:

    • In the upper right corner of the enterprise router, click Manage Attachment.
    • Click the enterprise router name and click Attachments.

  6. On the Attachments tab, click Create Attachment.

    The Create Attachment dialog box is displayed.

  7. Configure the parameters based on Table 1.

    Table 1 Parameter description

    Parameter

    Setting

    Example Value

    Name

    Specify the name of the VPC attachment. You can change it after the attachment is created.

    er-attach-01

    Attachment Type

    Select VPC. The type cannot be changed after the attachment is created.

    VPC

    Attached Resource

    1. Select the VPC to be attached to the enterprise router from the drop-down list. The VPC cannot be changed after the attachment is created.
    2. Select the subnet to be attached to the enterprise router from the drop-down list. The subnet cannot be changed after the attachment is created.
    • VPC: vpc-demo-01
    • Subnet: subnet-demo-01

    Auto Add Routes

    • If you enable Auto Add Routes when creating a VPC attachment, you do not need to manually add static routes to the VPC route table. Instead, the system automatically adds routes (with this enterprise router as the next hop and 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 as the destinations) to all route tables of the VPC.
    • If an existing route in the VPC route tables has a destination to 10.0.0.0/8, 172.16.0.0/12, or 192.168.0.0/16, the routes will fail to be added. In this case, do not to enable Auto Add Routes. After the attachment is created, manually add routes.
    • Do not set the destination of a route (with an enterprise router as the next hop) to 0.0.0.0/0 in the VPC route table. If an ECS in the VPC has an EIP bound, the VPC route table will have a policy-based route with 0.0.0.0/0 as the destination, which has a higher priority than the route with the enterprise router as the next hop. In this case, traffic is forwarded to the EIP and cannot reach the enterprise router.

    Enable

    Description

    Provide supplementary description about the attachment. You can change it after the attachment is created.

    -

    Tag

    Add tags to help you identify your attachment. You can change them after the attachment is created.

    Tag key: test

    Tag value: 01

  8. Click OK.

    The attachment list is displayed.

  9. Check the attachment status.

    If the status changes from Creating to Normal, the attachment is successfully created.

  10. Repeat 5 to 9 to attach the other three VPCs to the enterprise router.

    In the example given, Default Route Table Association and Default Route Table Propagation are enabled when you create the enterprise router. After the VPCs are attached to the enterprise router, the system will automatically:
    • Associate VPC attachments with the route table of the enterprise router.
    • Propagate VPC attachments to the route table of the enterprise router. The CIDR blocks of the VPCs are propagated to the route table.