All Products
Search
Document Center

ApsaraDB for MongoDB:Configure an IP address whitelist

Last Updated:Jun 03, 2026

After you create an ApsaraDB for MongoDB instance, configure an IP address whitelist or security group to allow external access. By default, the whitelist contains only 127.0.0.1, which blocks all external access.

Prerequisites

Important

Instance endpoints appear on the Basic Information and Database Connections pages only after you configure a whitelist.

  • An ApsaraDB for MongoDB instance

  • The instance ID and region

Usage notes

Procedure

  1. Go to the Replica Set Instances or Sharded Cluster Instances page.

  2. In the top navigation bar, select the region and resource group, and then click the instance ID.

  3. In the left-side navigation pane, choose Data Security > Whitelist Settings.

  4. Click Create Whitelist.

  5. In the Create Whitelist panel, configure the following settings:

    1. Enter a whitelist name.

      The name must be 2-32 characters long, start with a lowercase letter, end with a lowercase letter or digit, and contain only lowercase letters, digits, and underscores (_).

    2. Select the IPv4 or IPv6 tab.

      Note

      IPv6 is available only for MongoDB 4.2 instances.

    3. In the IP Whitelist field, add IP addresses.

      Separate multiple entries with commas (,). Up to 1,000 entries per whitelist.

      IP version

      Supported formats

      Example

      IPv4

      Individual IP addresses

      10.23.12.24

      IPv4

      CIDR blocks (prefix length: 1 to 32)

      10.23.12.24/24

      IPv6

      Individual IP addresses

      --

      Warning

      If the whitelist contains only 0.0.0.0/0 or is empty, all IP addresses can access the instance, which poses a security risk. Proceed with caution.

  6. Click OK.

Related topics

Delete an IP address whitelist