1

I just started a new instance and deployed a very simple Java app to try to connect to MongoDB Atlas and the app is not able to connect. The same app is working fine locally. This is a general purpose instance in a VPC and not a classic. Is there a configuration to enable outbound calls? I checked the routing table and there is no rules to block any outbound calls. The attached image also show public IP, but I can't actually ping the server, but I can connect through ssh.

enter image description here

I have also tried assigning Elastic IP to an instance and that didn't work either.

Elastic IP Assigned to Instance


Update:

It turned out the issue was with MongoDB for this case. Based on what I saw online, it let me to thing this was an issue with Amazon VPC, but it was actually an issue with the whitelist on Mongo DB Atlas. I didn't realize that was the case since connection from my local was working even though it's not supposed to.

You DO NOT need a NAT server to send an outbound call.

juminoz
  • 3,168
  • 7
  • 35
  • 52
  • 1
    Sounds like it is in a private subnet. Or maybe you didn't assign a public IP address to the instance. Or perhaps you VPC route to your Internet gateway is missing or incorrect. – Mark B Oct 06 '16 at 01:04
  • I just added a screenshot of the public IP, which I can't actually ping. I can connect to the server using ssh though. – juminoz Oct 06 '16 at 02:44
  • "You DO NOT need a NAT server to send an outbound call" in your case, no as you have a public ip address. If a host has no public ip address then a NAT is required – Vorsprung Oct 06 '16 at 15:33
  • That's correct. However, there are so many posts around the internet stated otherwise. That's what causing the confusion. – juminoz Oct 06 '16 at 16:23

2 Answers2

1

MongoDB Atlas actually now has VPC peering which will no longer require you to whitelist 0.0.0.0/0

https://www.mongodb.com/blog/post/introducing-vpc-peering-for-mongodb-atlas

Jay Gordon
  • 367
  • 2
  • 4
0

Make sure your ACL's for that subnet allow 0.0.0.0/0

Make sure you can ping www.google.com from within the instance

Check your subnet routes and ensure that it has a route for 0.0.0.0/0 to the internet gateway.

Marc Young
  • 3,854
  • 3
  • 18
  • 22