I have 2 servers: One is a physical server and another is a private EC2 instance in a VPC on AWS. I need to configure this EC2 instance to allow the physical server to connect to it via port 27017 (Mongo's Default Port). Here is what I did so far:
- Added the domain for the Ec2 instance to the phsyical server's resolver so that there is DNS resolution.
- Add the physical server's public IP the SGs for the private Ec2 instance.
After doing this, the physical server can now resolve the host with it's internal IP (the Ec2 instance) but I can't telnet to the host on 27017 as it times out. I'm assuming there is some form of routing I have to do. So here is how this private instance is set up:
Private Instance is in a private subnet with a NAT'd gateway attached to it. It does have internet access and the public subnets can obviously talk to it.
What else would I need to consider to allow connectivity between the phsyical server and the private EC2 instance? I will try to explain this as best as possible:
VPC-----------------------
| |
IGW NATd Instance
| |
Pub Sub (3 pub subnets) Priv Subnet- (3 private subnets)
| |
Bastion host 3 Mongo Servers one on each subnet