Thursday, February 13, 2014

Get the public / private IP of your EC2 instance via command line

Get the public / private IP of your EC2 instance via command line

It is easy to get the private and public ip address of your instance from EC2 console but for some cases like editing the configuration file it is handy to use command line here is the command :

Private IP address:

curl http://169.254.169.254/latest/meta-data/local-ipv4
Public IP address:
curl http://169.254.169.254/latest/meta-data/public-ipv4

No comments:

Post a Comment