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 click Compute. Under Compute, click Instances.
- Click the instance to view its details.
- Under Resources, click Attached VNICs to display the primary VNIC and any secondary VNICs attached to the instance.
- Click the VNIC that you're interested in.
- Under Resources, click IP addresses to display the VNIC's primary private IP and any secondary private IPs.
- For the VNIC's primary private IP, click the , and then click Edit.
- In the Public IP address section, for Public IP type, select the radio button for 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.
- 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.