Scenarios
This document guides you to obtain the public IP address through the console, API, and instance metadata.
Operation Steps
Obtaining via the Console
- Log in to the CVM Console.
- On the instance management page, move the mouse to Primary IPv4 column, and
will be displayed. - Click
to copy the IP address.Note:Because the public IP address is mapped to the private IP address through NAT, if you view the attributes of the network API within the instance (for example, through
ifconfig(Linux) oripconfig(Windows) command), the public IP address will not be displayed. For details about how to obtain the public IP address of an instance within the instance, see Use Instance Metadata to Obtain.
Obtaining via the Instance Metadata
Log in to the Cloud Virtual Machine instance.
For specific log-in methods, see Logging In to Linux Instances and Logging In to Windows Instances.You can access metadata using the cURL tool or GET request of HTTP to obtain the public IP address.
curl http://metadata.convergecloud.com/meta-data/public-ipv4
For more information, see Querying Instance Metadatas.
will be displayed.