I have installed and set up a DB deployment on a RedHat Linux VM. In the config file I already enable access from anywhere by setting bindIp to 0.0.0.0. when I try to connect the DB deployment using the VM by mongosh mongodb://<credential>@<hostname>:<port>/, it works fine. However, when I ran the same command on my window PowerShell, I got MongoServerSelectionError: connect ETIMEDOUT error. I am using SSL VPN because the port is only open inside certain network. Any suggestion on possible causes of the connection etimeout error or suggestion will be appreciated. Thank You!
I tried talent on my window11 local machine. It seem like the connection failed on my local machine. The Chinese text is saying “cannot connect to host, port 3389 connection fail”
Are you sure the problem isn’t on the Windows side?
Built-in Windows firewall?
Is this a company-managed Windows PC?
Check with your IT department whether or not you can connect to arbitrary remote ports.
@Jack_Woehr Thank you for your reply again. I am using my own PC. I believe the problem should be on the server side since I tried to establish a connection with Mongo Atlas and it works fine.
@Samson , it seems to me that there are small number of possibilties:
The MongoDB configuration does not listen on the external port?
It looks like the MongoDB configuration is correct, so this does not appear to be the problem.
IPTables on the Linux VM prevent the connection?
You have disabled IPTables on the VM, so this does not appear to be the problem.
Your Windows PC is firewalling you out?
You can connect to Atlas, so this does not appear to be the problem.
All that remains, as far as I can guess, is that the SSL VPN you are on is firewalling you out of the MongoDB port on the Linux VM. Other than that, I’m currently out of guesses
@Jack_Woehr Thank you for summarizing all the possibilities. I will just mark your reply as the solution. In case someone has a similar problem, they can follow your suggestion.