My client is a Windows 10 Education and my server is a Windows Server 2022. My client IP is 192.168.1.222 and my server IP is 192.168.1.163. I am using the default port 27017 for my connection, but I cannot connect to my MongoDB server. I have no idea what’s going on. I am following every guide out there and nothing has been able to fix my issue.
Here is my mongo.cfg
from the server:
storage:
dbPath: C:\Program Files\MongoDB\Server\6.0\data
journal:
enabled: true
systemLog:
destination: file
logAppend: true
path: C:\Program Files\MongoDB\Server\6.0\log\mongod.log
net:
port: 27017
bindIp: 0.0.0.0
security:
authorization: enabled
I run ipconfig
on my client and I get this:
Windows IP Configuration
Unknown adapter ProtonVPN TUN:
Media State . . . . . . . . . . . : Media disconnected
Connection-specific DNS Suffix . :
Ethernet adapter vEthernet (Ethernet):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::8eba:157b:5e9c:976%42
IPv4 Address. . . . . . . . . . . : 172.18.0.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
Ethernet adapter vEthernet (VirtualBox Host):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::6e20:d83d:b51e:fa3b%47
IPv4 Address. . . . . . . . . . . : 172.21.64.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
Ethernet adapter Ethernet:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.1.222
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1
I run ipconfig
on my server and I get this:
Windows IP Configuration
Ethernet adapter vEthernet (Broadcom NetXtreme Gigabit Ethernet - Virtual Switch):
Connection-specific DNS Suffix . :
Link-local IPv6 Address. . . . : fe80::151f:aad0:9a3:2dd1%15
IPv4 Address . . . . . . . : 192.168.1.163
Subnet Mask. . . . . . . . : 255.255.255.0
Default Gateway . . . . . . : 192.168.1.1
The firewall on my client has an outbound rule for port 27017 and the firewall on my server has an inbound rule for port 27017. The connection string that I use to connect is: mongodb://192.168.1.163:27017/?tls=true