IndianWebPortal.com

Something Different In Linux

Home » aws » How to find the IP address of an amazon EC2

How to find the IP address of an amazon EC2

Posted by Rishikesh Vispute Categories: aws

Question : How to find the IP address of an amazon EC2 by using linux command

Ans :

If you run “ifconfig –a” on an amazon ec2 instance (linux), it will give you the internal IP address, which is not accessible from outside world. Here is a way to get the public and private IP address for an amazon EC2 instance.

To obtain the IP addresses, issue the following HTTP queries from within the instance:

To obtain the internal IP address:

       curl http://169.254.169.254/latest/meta-data/local-ipv4

To obtain the public IP address:

       curl wgetip.com

 


Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...