Port 27017 closed for security reasons

Hi @Tayyab_Ferozi,

Your original error suggests outbound access to port 27017 is blocked by your hosting provider or instance firewall. Since that is a more straightforward issue to troubleshoot via portquiz.net, I would use it as a test case to resolve with your provider before trying to get your database connection working.

Once you have confirmed that outbound connections are not blocked, I would then test with the mongo shell and make sure you are able to login before trying to debug connectivity from your application code.

If you have temporarily opened up your Atlas IP Access List to allow any host to connect (that isn’t recommended for long term configuration), any remaining connection issues should be local to your environment (network/firewall configuration, or perhaps the driver/application version you are trying to connect with).

A possible interpretation is that they are asking for the IP of the ventralIP instance you want to whitelist for outbound connections. I would ask them how to get your curl example working.

I think it would be unusual for hosts to aggressively block outbound connections without providing an interface for you to self-manage common firewall rules. Does your hosting include cPanel or a similar management interface?

That is correct (and expected behaviour). For the most robust access, you should rely on cluster names rather than IPs.

As noted by @chris, connections to Atlas are only outbound from your deployment.

Regards,
Stennie