This document describes how to obtain the public IP address through console, API, or Instance metadata.
Note:
The public IP address is mapped to the private IP address through NAT. If you view the network interface attributes from within the instance (such as by using commands such as
ifconfig (Linux)
oripconfig (Windows)
), the public IP address is not displayed. To obtain the public IP from within the instance, please see Obtaining a Public IP Address of the Instance Using Instance Metadata.
Please see DescribeInstances.
curl http://metadata.tencentyun.com/meta-data/public-ipv4
If the returned value is in the following structure, you can view the public IP address:
Was this page helpful?