Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can an Amazon EC2 Instance access another Instance by Private IP?

Tags:

amazon-ec2

I have two separate instances in my test scenario

  1. Web Server Instance
  2. Database Server Instance

So far the only way I can get from 1st to 2nd Instance is by having Elastic IP's configured and using the Public DNS (or IP) reference. I can limit unwanted access by configuring the Security Group for 2nd to only take Port 1433 traffic only from 1st.

It seems like Instances within the same Amazon AWS zone should be able to talk to each other more efficiently than first going out and then coming back in.

Is there a way to go directly from 1st to 2nd instance using just the Private DNS (or IP)?

like image 520
cusman Avatar asked Sep 09 '25 21:09

cusman


1 Answers

If you are using the Amazon Public DNS name, Amazon makes sure that all internal traffic gets routed internally only. So there is no problem in using the public DNS names. Have a look at this question and this article for more details.

like image 98
j0nes Avatar answered Sep 13 '25 17:09

j0nes