edit-icon download-icon

ECS Windows

Last Updated: May 16, 2018

Currently, ApsaraDB for MongoDB is only accessible through ECS intranet. If you want to locally access ApsaraDB for MongoDB by the public network, you can use netsh on the ECS Windows server for port mapping.

Procedure

  1. Log on to the ECS Windows server and run the following command in the CMD.

    1. netsh interface portproxy add v4tov4 listenaddress=public IP address of ECS listenport=3717 connectaddress=connection address of ApsaraDB for MongoDB connectport=3717

    And, netsh interface portproxy show all can be used to view mappings on the current server.

  2. 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 1.1.1.1, then set telnet 1.1.1.1 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.

  3. 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=3717 can be used to delete unnecessary mappings.

Thank you! We've received your feedback.