How to get the external network IP of AWS EC2 instance

Send a request on the EC2 instance: http://169.254.169.254/latest/meta-data/public-ipv4

 

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

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

curl http://169.254.169.254/latest/meta-data/public-hostname

For details, please see: https://blog.csdn.net/Swallow_he/article/details/105711779

Guess you like

Origin blog.csdn.net/Swallow_he/article/details/105687804