Obtaining the Public IP Address

Last Updated At: 2025-11-26 15:44:38

Scenarios

This document guides you to obtain the public IP address through the console, API, and instance metadata.

Operation Steps

Obtaining via the Console

  1. Log in to the CVM Console.
  2. On the instance management page, move the mouse to Primary IPv4 column, and will be displayed.
  3. 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) or ipconfig (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

  1. 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.

  2. 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.