Assigning an Ephemeral Public IP to an Existing Primary Private IP

Assign an ephemeral public IP address to an instance to enable communication with the internet.

Prerequisite: The primary private IP must not have a reserved or ephemeral public IP already assigned to it. If it does, first delete the public ephemeral IP, or unassign the reserved public IP.

    1. Open the navigation menu and click Compute. Under Compute, click Instances.
    2. Click the instance to view its details.
    3. Under Resources, click Attached VNICs to display the primary VNIC and any secondary VNICs attached to the instance.
    4. Click the VNIC that you're interested in.
    5. Under Resources, click IP addresses to display the VNIC's primary private IP and any secondary private IPs.
    6. For the VNIC's primary private IP, click the Actions menu (Actions Menu), and then click Edit.
    7. In the Public IP address section, for Public IP type, select the radio button for Ephemeral public IP.
    8. In the Ephemeral public IP name field, enter an optional friendly name for the public IP. The name doesn't have to be unique, and you can change it later. Avoid entering confidential information.
    9. Click Update.
  • Use the network public-ip create command and required parameters to assign a public IP:

    oci network public-ip create --compartment-id compartment_ID --lifetime EPHEMERAL
     --private-ip-id private_IP_OCID ... [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the CreatePublicIp operation to create a public IP.