Skip to content

Instantly share code, notes, and snippets.

@mredar
Last active December 19, 2015 23:18
Show Gist options
  • Save mredar/6033517 to your computer and use it in GitHub Desktop.
Save mredar/6033517 to your computer and use it in GitHub Desktop.
IP addresses for ec2 instance
To determine your instance's IP addresses using instance metadata
Connect to the instance.
Use the following command to access the private IP address:
GET http://169.254.169.254/latest/meta-data/local-ipv4
Use the following command to access the public IP address:
GET http://169.254.169.254/latest/meta-data/public-ipv4
FROM: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#using-instance-addressing-common
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment