All Products
Search
Document Center

Elastic Compute Service:Create a prefix list

Last Updated:Oct 12, 2023

A prefix list is a set of one or more network prefixes (CIDR blocks). You can reference prefix lists to configure network rules for other network resources. This topic describes how to create a prefix list.

Prerequisites

If Resource Access Management (RAM) users are used, the RAM users are granted permissions on prefix lists. For more information, see Grant a RAM user permissions on prefix lists.

Procedure

Create a prefix list in the ECS console

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Network & Security > icon1 > Prefix Lists.

  3. In the upper-left corner of the top navigation bar, select a region. 地域

  4. On the Prefix List page, click Create Prefix List.

  5. In the Create Prefix List dialog box, configure the parameters described in the following table.

    创建前缀列表

    Parameter

    Description

    Name

    Enter a name for the prefix list.

    Description

    Enter a description for the prefix list. We recommend that you describe the intended purpose of the prefix list.

    Address Family

    Select IPv4 or IPv6. After you create a prefix list, you cannot modify its address family.

    • If you select IPv4, you can specify only IPv4 CIDR blocks in the entries of the prefix list.

    • If you select IPv6, you can specify only IPv6 CIDR blocks in the entries of the prefix list.

    Max Entries

    Specify the maximum number of entries in the prefix list. After you create a prefix list, you cannot modify the maximum number of entries in the prefix list.

    Valid values: 1 to 200.

    Entries

    Specify CIDR blocks as entries for the prefix list. You can click Add Entries to add a CIDR block and enter a description for the CIDR block.

    The following limits apply to entries in a prefix list:

    • The total number of entries cannot exceed the value set for Max Entries.

    • You can enter multiple CIDR blocks at a time. Separate the CIDR blocks with spaces or commas (,).

    • The address type of a CIDR block in each entry is determined by the Address Family parameter. You cannot combine IPv4 and IPv6 CIDR blocks in a single prefix list.

    • CIDR blocks within entries in a prefix list must be unique. For example, you cannot specify 192.168.1.0/24 twice in the entries of the prefix list.

    • You can specify an IP address. The system automatically converts the IP address to a CIDR block.

      For example, if you specify 192.168.1.100, the system automatically converts the IP address to 192.168.1.100/32.

    • If an IPv6 CIDR block is specified, the system automatically converts it to the zero compression format.

      For example, if you specify 2001:0DB8:0000:0000:0000:0000:0000:0000/32, the system converts it to 2001:db8::/32.

  6. Click Create.

Create a prefix list by calling an API operation

Call the CreatePrefixList operation with parameters configured to create a prefix list.

What to do next

After the prefix list is created, you can perform the following operations: