Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

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.

share|improve this answer
    
Thanks. I don't realise that security group will play the role if access via public IP. –  Bruce Li Feb 12 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 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 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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