0

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

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

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.

Thanks.

Wenbing Li
  • 465
  • 5
  • 10

2 Answers2

3

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.

  • 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
1

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 10.10.10.1 -> associated_to 54.54.54.54 Service2 -> locally_bound_to 10.10.10.2 -> associated_to 54.54.54.55 etc.