I am new to using EC2 and have a question which hopefully is easy to answer - I have a public IP and DNS and a private IP and DNS for my EC2 instance. From my laptop workstation , I can ping public-IP , no problem. When I ssh to the public-ip from my laptop ssh ubuntu@public-ip this takes me to the private ip prompt ubuntu@private-ip. I believe the Network Address Translator is coming in the way and translating the public IP to the private IP and ssh's me in to the private IP. An ifconfig there shows me the private ip as expected. The problem is now I cannot do a ping laptop IP from the EC2 instance private IP as expected.
P:S. Here is an excerpt from the amazon.com that may be relevant here:
Each instance that receives a public IP address is also given an external DNS hostname; for example, ec2-203-0-113-25.compute-1.amazonaws.com. We resolve an external DNS hostname to the public IP address of the instance outside the network of the instance, and to the private IPv4 address of the instance from within the network of the instance. The public IP address is mapped to the primary private IP address through network address translation (NAT). For more information about NAT, see RFC 1631: The IP Network Address Translator (NAT).
What I want, is to be able to ssh to the public IP ( the prompt should show ubuntu@public IP instead of ubuntu@private IP ) so I can ping back and forth between my laptop and the EC2 instance.
Any help is greatly appreciated.
best Rohan