How to connect an EC2 linux instance to another Linux instance?

0 votes
How to access another Linux server from a Linux server by configuring the security group (firewall)?
Jul 15, 2019 in AWS by code_ninja
• 6,230 points
122 views

1 answer to this question.

0 votes

AWS EC2 instances are more like a server which provide the hosting platform 

As your concern is how to connect two EC2 instances then try this way:

1) Go to EC2 console and note down IP and security ID of both the linux instances 

2) Select any one instance and open network and security option 

3) Select your instance's security group and click on edit

4) In the next popup window click on “Add Rule” button 

5) Now Select All ICMP-ipv4 under Type drop-down, set source tab to custom and in the next box enter the security group id of the other instance (which is “sg-d0e7d4b9” )click on save button.

6) Now open CLI connect to instance and try to ping to other instance

  • [root@ip-172-31-25-150 ~]# ping 172.31.23.137

7)To make the communication open from other instance as well, follow the steps 1 to 3 for other security group “sg-d0e7d4b9” and in the step 4 enter below details and click save button.

8) After above configuration we are now able to ping the first instance via second instance

  • [root@ip-172-31-23-137 ~]# ping 172.31.25.150
  • PING 172.31.25.150 (172.31.25.150) 56(84) bytes of data.

This way two Ec2 instances connect to each other. In case of other ports or service please select particular service such as ssh, http or even NFS make sure you open the source with custom mentioning the security group id of the other server.

                                                                  

answered Jul 15, 2019 by ArchanaNagur
• 2,320 points

Related Questions In AWS

0 votes
1 answer

How to launch an EC2 instance with IAM-Role?

The credentials you are using from your ...READ MORE

answered Sep 3, 2018 in AWS by Archana
• 4,150 points
668 views
0 votes
1 answer

how to connect my ec2 instance to a registered domain?

Hard to troubleshoot on here- but I ...READ MORE

answered Sep 24, 2018 in AWS by Priyaj
• 57,530 points
68 views
0 votes
1 answer

How to recover lost private key of an EC2 instance?

I'm afraid it's not possible When you launch ...READ MORE

answered Sep 25, 2018 in AWS by Archana
• 4,150 points
1,502 views
0 votes
1 answer

How to safely upgrade an Amazon EC2 instance from t1.micro to large?

Using AWS Management Console: Right-Click on the instance Instance ...READ MORE

answered Oct 8, 2018 in AWS by Priyaj
• 57,530 points
91 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Does it make sense to have an Amazon Elastic Load Balancer with just one EC2 instance?

Well you are right Elastic Load Balancer is mainly ...READ MORE

answered Mar 20, 2019 in AWS by ArchanaNagur
• 2,320 points
73 views