Use IPAM to plan and create a VPC

更新时间:
复制 MD 格式

IP Address Manager (IPAM) automates CIDR block assignment and conflict detection when you create virtual private clouds (VPCs). Without it, manually coordinating address ranges across teams and environments risks overlaps that are costly to fix after deployment.

This tutorial walks through a common enterprise scenario: a company with multiple business departments that each require isolated VPCs for production and testing. You will create an IPAM pool hierarchy, then use it to allocate a CIDR block automatically when creating VPC1 in the production environment.

不同业务分配给VPC.png

Prerequisites

Before you begin, ensure that you have:

  • An Alibaba Cloud account with permissions to create VPC and IPAM resources

  • Access to the IPAM console and the VPC console

How it works

IPAM organizes address space in a hierarchy:

  1. IPAM — the top-level container that defines the effective regions where address management applies.

  2. Top-level pool — holds the full CIDR block available for your organization (for example, 192.168.0.0/16).

  3. Subpool — a slice of the top-level pool assigned to a specific environment or department (for example, 192.168.0.0/20 for production).

  4. VPC — allocated a CIDR block from a subpool at creation time.

In this tutorial, the production subpool holds 192.168.0.0/20 (4,096 addresses). VPC1 receives a /26 block (64 addresses) from that subpool, consuming 1.6% of the pool.

Step 1: Create an IPAM

  1. Log on to the IPAM console. In the top navigation bar, select the region where you want to create the IPAM.

  2. On the IPAM page, click Create IPAM and set the Effective Region. Keep other parameters at their defaults, or adjust them as needed.

    Select at least one effective region. The region where the IPAM is hosted must be included and cannot be removed after the IPAM is created.

    image

Step 2: Create a top-level pool

  1. In the left-side navigation pane, click IPAM Pool.

  2. On the IPAM Pool page, click Create IPAM Pool and configure the parameters below. Keep other parameters at their defaults. For the full parameter reference, see Create and manage IPAM pools.

    ParameterDescription
    IPAM ScopeOnly private IPAM scopes are supported.
    CIDR RangeSelect IPAM to create a top-level pool.
    Effective RegionMust fall within the effective region of the IPAM. Cannot be changed after creation.
    Automatically Import Discovered ResourceWhen enabled, IPAM continuously scans for VPCs through resource discovery and automatically imports any unallocated resources within this pool's CIDR range.
    Provision CIDR BlockClick Add CIDR Block to add one or more CIDRs. Only IPv4 is supported. For this tutorial, add 192.168.0.0/16.
    Allocate RuleSet Minimum Mask Length, Default Mask Length, and Maximum Mask Length for resources allocated from this pool.

    image

Step 3: Create a subpool

  1. On the IPAM Pool page, click Create IPAM Pool and configure the parameters below to create a subpool for the production environment. Keep other parameters at their defaults. For the full parameter reference, see Create and manage IPAM pools.

    ParameterDescription
    IPAM ScopeOnly private IPAM scopes are supported.
    CIDR RangeSelect IPAM Pool to create a subpool, then select the top-level pool created in Step 2 as the Source IPAM Pool.
    Effective RegionInherited from the parent pool automatically. No separate configuration is needed.
    Automatically Import Discovered ResourceWhen enabled, IPAM continuously scans for VPCs through resource discovery and automatically imports any unallocated resources within this subpool's CIDR range.
    Provision CIDR BlockClick Add CIDR Block. Only IPv4 is supported. For this tutorial, add 192.168.0.0/20.
    Allocate RuleSet Minimum Mask Length, Default Mask Length, and Maximum Mask Length for resources allocated from this subpool.

    image

  2. After creation, the pool hierarchy looks like this:

    image

Step 4: Create VPC1 and allocate a CIDR block

  1. Log on to the VPC console.

  2. In the top navigation bar, select the region set as the Effective Region of the subpool.

  3. On the VPC page, click Create VPC and configure the parameters below, then click OK. For the full parameter reference, see Create and manage a VPC.

    ParameterDescription
    IPv4 CIDR BlockSelect IPv4 CIDR block allocated by IPAM.
    IPv4 PoolSelect the subpool created in Step 3.
    Network MaskThe system selects the first available CIDR block that meets the allocation rules. Alternatively, specify a CIDR block from the provisioned ranges in the subpool.
    IPv4 CIDR Block (vSwitch)Must fall within the IPv4 CIDR block allocated by IPAM.

    image

  4. After the VPC is created, open the Details tab of the subpool to review address usage.

    The subpool CIDR is 192.168.0.0/20, which provides 4,096 addresses. With a /26 network mask, 64 addresses are allocated to VPC1, equal to 1.6% of the pool (64 / 4,096 = 1.6%).

    image

  5. Open the Allocate tab to view the specific addresses assigned to VPC1.

    image

What's next