IBM Cloud Docs
Configuring MongoDB networking

Configuring MongoDB networking

IBM Cloud® engineered servers with MongoDB installed are configured to bind MongoDB to the private network IP address. This configuration is recommended gy 10gen, and it serves to minimize the security risks of having an open, accessible MongoDB instance exposed publicly upon deployment.

Changing the bound interface

MongoDB can be configured to bound to any interface by changing the ‘bind_ip’ attribute in the /etc/mongod.conf file in your installation as shown:

        # mongo.conf
        bind_ip = 0.0.0.0

This attribute changes the binding to be on all interfaces, or you can set the specific interface's IP address in this field (available from your deployment details). A restart of the MongoDB instance is required.

Do not expose MongoDB openly to public interfaces without some other security measures in place, such as firewalls or iptables that limit access to the instance.