Not able to login and connect database locally while using wifi router

I am encountering an issue while attempting to connect to a database locally using a MongoDB Atlas link in my Node.js project. The problem arises when I connect my laptop to my WiFi router. Interestingly, when I switch to my mobile hotspot, I can successfully connect to the database in VS Code and access my data.

However, when connected to my WiFi router, I receive a “connection timed out” error, and sometimes, I encounter the following message:

“Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you’re trying to access the database from an IP that isn’t whitelisted. Make sure your current IP address is on your Atlas cluster’s IP whitelist: MongoDB Atlas Security Whitelist.”

This issue is entirely new to me, as I’ve never faced it before. I have already ensured that the IP is set to “allow from anywhere.”

I have attempted to resolve the problem using multiple MongoDB accounts, but the issue persists.

I intend to seek assistance from the MongoDB community. Please advise.

Hi @Hilton_N_A, Welcome to the MongoDB community forum,

The case might be the Internet service provider (ISP) blocks the port of the MongoDB connection,

Follow these topics:

And this: