I am trying to make a kind of proxy using elastic IPs on my Amazon EC2 instance. My question is, say I associate an elastic IP to my Amazon instance, and then I make an outbound connection from my EC2 instance to a server, say www.yahoo.com.

What IP address will www.yahoo.com see, the original Amazon EC2 server IP or the elastic IP I have associated to it?

Sorry if this is a basic question, but this is all new to me.


If an elastic IP is associated with an EC2 instance, that's the instance's external IP.

You can demonstrate this by doing curl canhazip.com in the command line.

| improve this answer | |
  • 8
    +1 for canhazip.com – mgorven Feb 20 '13 at 20:50
  • Also +1 for canhazip.com – chrskly Feb 21 '13 at 0:01
  • Does this apply to VPC's? My outgoing IP does not appear to be the same as the Elastic IP applied to the main interface. – John McKim Sep 17 '14 at 7:51
  • @JohnMcKim Yes, it applies to VPCs. The only caveat is sometimes you'll have your VPC subnet going through a NAT instance rather than directly. – ceejayoz Sep 17 '14 at 12:47
  • 2
    @flickerfly Yes, you'd be showing up as the NAT instance's EIP. – ceejayoz Jun 23 '17 at 1:03

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.