Here is an example, I have an Linux instance , say, private IP is, public IP is

Inside the instance, I could successfully ping it's private IP( and localhost. However, I cannot access it's public IP(

The reason I need to use it's public IP instead of localhost is because it's the same IP configuration which I will be used for this server as well as for other servers.

I can imagine it's related with part which how public IP associate with private IP. Therefore, the inbound and outbound traffic is somehow lost. But I would really want to know more details.



I don't see an issue pinging my own public ip from inside the instance. make sure you add a rule in the security groups associated with the instance.

| improve this answer | |
  • Thanks. I don't realise that security group will play the role if access via public IP. – Wenbing Li Feb 12 '15 at 21:36
  • You shouldn't do this, by the way -- you can be subject to bandwidth charges for the extra network overhead you create when accessing an ec2 instance on its public or elastic IP, from within ec2 and there's not really any definitive reason why that wouldn't apply to traffic that leaves the instance and returns, on the same IP. – Michael - sqlbot Feb 13 '15 at 13:26

Your elastic IP is not present on any local interfaces. If you want to bind a local service to an IP address, bind it to the private one and associate your EIP to it. If you need to bind different instances of your service to different public EIP's, just use the same number of private IP's associated to them. So you will end up with:

Service1 -> locally_bound_to -> associated_to Service2 -> locally_bound_to -> associated_to etc.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.