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.
- Open the navigation menu and select Compute. Under Compute, select Instances.
- On the Networking tab, go to the Attached VNICs section and select the VNIC that you're interested in.
- Select the IP administration tab to display the VNIC's primary private IP and any secondary private IPs.
- For the VNIC's primary private IP, select the , and then select Edit.
- Under Public IP type, select Ephemeral public IP.
- 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.
- Select 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.