This topic describes how to configure a whitelist for a sharded cluster instance after you create the instance. Only the devices whose IP addresses are added to the whitelists of the instance are allowed access to the instance. The default whitelist only contains the IP address 127.0.0.1, which indicates that no devices can connect to the instance.
Procedure
- Log on to the ApsaraDB for MongoDB console.
- In the left-side navigation pane, click Sharded cluster instance.
- In the upper-left corner of the page, select the resource group and region to which the instance belongs.
- On the page that appears, find the instance that you want to manage and click its ID.
- In the left-side navigation pane of the instance details page, choose .
- In the Create Whitelist section, use one of the following methods to configure a whitelist for the instance.
- Manually add IP addresses to an instance whitelistNote
- An IP address can be specified in one of the following formats:
- A single IP address. Example: 10.23.12.24.
- 0.0.0.0/0
- A CIDR block. For more information about CIDR blocks, see FAQ. Example: 10.23.12.24/24. 24 indicates that the prefix of the CIDR block is 24 bits in length. You can replace 24 with a value within the range of 1 to 32.
- Separate multiple IP addresses with commas (,).
- If you specify only 0.0.0.0/0 in a whitelist or left the whitelist empty, the instance can be accessed by all IP addresses. In this situation, the instance databases are at high security risk. Proceed with caution.
- Click in the Actions column and select Manually Modify.
- In the Manually Modify panel, enter IP addresses or CIDR blocks in the IP Whitelist text box.
- Click OK.
- An IP address can be specified in one of the following formats:
- Load IP addresses of ECS instances to an instance whitelist
- Click Import ECS Intranet IP in the Actions column.
- In the IP Whitelist list of the Import ECS Intranet IP panel, select the Elastic Compute Service (ECS) internal IP addresses that you want to add to the whitelist.
- Click .
- Click OK.
- Manually add IP addresses to an instance whitelist
Related operations
Common connection scenarios
- Connect to an ApsaraDB for MongoDB instance over the Internet
- Connect an ECS instance to an ApsaraDB for MongoDB instance when their network types are different
- How to connect an ECS instance to an ApsaraDB for MongoDB instance when they are in different regions
- Connect an ECS instance with an ApsaraDB for MongoDB instance in another Alibaba Cloud account