Assigning a Reserved Public IP to a Private IP

Assign a reserved public IP object to a private IP address in Oracle Cloud Infrastructure.

The VNIC's private IP address must not have an ephemeral or reserved public IP object already assigned to it. If it does, first either delete the public ephemeral IP, or unassign the reserved public IP.

Note

IP CIDR addresses don't support assigning a public IP address.

    1. Open the navigation menu  and select Compute. Under Compute, select Instances.
    2. Select the compartment that contains the instance using the private IP address to which you want to assign a public IP object.
    3. Select the name of the instance to view its details.
    4. On the Networking tab, go to the Attached VNICs section and select the name of the VNIC that uses a private IP.
    5. Select the IP administration tab to display the VNIC's primary private IP address and any secondary private IP addresses.
    6. For the private IP address to which you want to assign a public IP object, select the Actions menu (three dots), and select Edit.
    7. Under Public IP type, select Reserved public IP.
    8. Select one of the following options:
      • Select Existing Reserved IP Address: If you select this option, next select the reserved public IP from the Reserved IP Address in <compartment> list, changing the compartment as needed.
      • Create new Reserved IP Address: If you select this option, enter the following information:
        • Public IP Name: A descriptive name for the reserved public IP object. The name doesn't have to be unique, and you can change it later. Avoid entering confidential information.
        • Create in Compartment: The compartment in which you want to create the reserved public IP, which could be different from the compartment you're currently working in.
        • IP Address Source: (Optional) The IP pool that the IP address is drawn from. If necessary, change the compartment to find the IP address source you want. If you don't select a pool that you've created, the default Oracle pool is used.
    9. Select Update.
  • Use the network public-ip update command and required parameters to assign a reserved public IP address to a private IP:

    oci network public-ip update --public-ip-id public_IP_OCID --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 UpdatePublicIp operation to assign a reserved public IP address to a private IP address.