skip to Main Content

For example if my EC2-1 machine have the ip of 192.162.10.2 and the EC2-2 machine have the ip of 192.168.10.150 let say,

How can I achive this, Thank you

I’m try to connect to EC2 instance in the same network, I’m new in the cloud services.

2

Answers


  1. Amazon EC2 instances in the same VPC can communicate with each other.

    Just make sure that the Security Groups associated with the instances permit the communication.

    For example, let’s say one EC2 instance is running a web application and the other is running a database. You might then create two security groups:

    • A security group on the web server (Web-SG) that permits inbound traffic on port 80 and 443, plus all Outbound traffic
    • A security group on the database server (DB-SG) that permits inbound traffic from Web-SG on the database port, plus all Outbound traffic

    That is, DB-SG can specifically refer to Web-SG in its rules. This way, any EC2 instance that is associated with Web-SG will be permitted to access DB-SG. This is better than hard-coding IP addresses in security group rules.

    Login or Signup to reply.
    1. Make sure both EC2 instances are launched within the same VPC. By default, instances launched in the same VPC can communicate with each other.

    2. Make sure both EC2 instances are in the same subnet within the VPC.

    3. Ensure that the security group allows traffic between instances within the same security group.

    4. Make sure both instances are running and accessible (eg using SSH)

    And then try to ping one EC2 from another by their private IP-address.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search