-1

I have an instance called "abc" created under accountX on AWS. I have another instance "def" created under accountY on AWS. "abc" is where I have installed my test tool which will run scripts on an application installed in "def".

When I ping "def" from "abc" I get this error: "ping: unknown host "

Content of my /etc/hosts file in "abc"

>ubuntu@ip-'ip for abc':~$ more /etc/hosts
>127.0.0.1 localhost
>
># The following lines are desirable for IPv6 capable hosts
>::1 ip6-localhost ip6-loopback
>fe00::0 ip6-localnet
>ff00::0 ip6-mcastprefix
>ff02::1 ip6-allnodes
>ff02::2 ip6-allrouters
>ff02::3 ip6-allhosts
>
>127.0.0.1 ip-'ip for abc'

Content of my /etc/resolv.conf file in "abc":

>nameserver 'ip for def'

Please assist. Thanks.

ratha
  • 1
  • Are they in the same VPC? Did you open the security group appropriately in the security groups for each instance? If they are in the same VPC, are you using the internal IP addresses? – Mark B Nov 06 '17 at 11:50
  • Can you ping def's IP address? Is def your DNS server? – sborsky Nov 06 '17 at 14:23
  • If folks are interested in creating a venue for these types of questions, follow the proposal for a [dedicated Cloud Computing site on StackExchange](https://area51.stackexchange.com/proposals/110490/cloud-computing-aws-azure-google-openstack-etc?referrer=Gtut7wQSWPk88jFJz_zqMg2) and up-vote some sample questions. – John Rotenstein Nov 07 '17 at 01:57
  • Are you connecting to the Public IP address or the Private IP address of the other instance? Is there VPC Peering between the VPCs? – John Rotenstein Nov 07 '17 at 01:58

2 Answers2

0

Are both machines on the same VPC (or at least reachable from each other)?

If both machines are in the same VPC then you could try putting the internal IPs of each of the machines in the other's /etc/hosts file and try.

Just to test that this isn't happening because of a firewall rule you might want create a security group to allow all internal traffic and apply them to both hosts.

Also ping might not work out of the box - this question has answers that will help you with the ping issue.

Cannot ping AWS EC2 instance

subbu
  • 61
  • 7
0

Your machines are in different VPC's and will not be able to communicate unless you peer the two VPCS:

Check this out for info how to do so: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/peer-with-vpc-in-another-account.html

If you still cannot contact them you may have issues with your Security groups rules. The following answer may be helpful in that case: Cannot ping AWS EC2 instance

Will Evers
  • 934
  • 9
  • 17