Currently, ApsaraDB for MongoDB is only accessible through ECS intranet. If you must locally access ApsaraDB for MongoDB by the public network, you can use netsh on the ECS Windows server for port mapping.
Log on to the ECS Windows server and run the following command in CMD.
netsh interface portproxy add v4tov4 listenaddress=public IP address of ECS listenport=3717 connectaddress=connection address of ApsaraDB for MongoDB connectport=3717
netsh interface portproxy show allcan be used to view mappings on the current server.
Perform a verification test after configuration is complete.
Run the MongoDB shell command locally to connect to the ECS Windows server and verify by performing read and query operations. For example, if the IP address of the ECS Windows server is 126.96.36.199, then set
telnet 188.8.131.52 3717.
After completing the preceding steps, you can use a local PC or server to connect to Port 3717 of the ECS Windows server to access ApsaraDB for MongoDB through the public network.
Note: portproxy is provided by Microsoft rather than open-source. If you have any issues, see the netsh documentation on portproxy or consult Microsoft engineers. Or you can use another scheme to do the same, for example, use portmap to configure proxy mappings.
After finishing the related operations, if you need to delete the public network forwarding,
netsh interface portproxy delete v4tov4 listenaddress=public IP address of ECS listenport=3717can be used to delete unnecessary mappings.