Assigning an Ephemeral Public IP Address to an Instance
On Compute Cloud@Customer, you assign a public IP address to an instance by assigning the public IP address object to a private IP address object.
An ephemeral public IP address is created and assigned in the same step.
An ephemeral public IP address can only be assigned to a primary private IP address: The
value of the is-primary
property of the private IP address object must
be true
. Every VNIC has one primary private IP address.
For secondary private IP addresses (the value of the is-primary
property
of the private IP address object is false
), assign reserved public IP
addresses.
An ephemeral public IP address can't be unassigned and can't be moved to a different private IP address.
An ephemeral public IP address object is deleted in the following cases:
-
Its private IP address object is deleted.
-
Its VNIC is detached or deleted.
-
Its instance is deleted.
Avoid entering confidential information in names.
- In the Compute Cloud@Customer Console navigation menu, click Compute, then click Instances.
- At the top of the page, select the compartment that contains the instance for which you want to assign a public IP address.
-
Click the name of the instance.
The instance detail page is displayed.
-
Under Resources, click Attached VNICs.
-
Click the name of the VNIC for which you want to assign a public IP address.
-
On the VNIC details page, under Resources, click IP Addresses. The primary private IP address and any secondary private IP addresses, and as any attached public IP addresses, are shown in the table.
-
If the primary private IP address doesn't already have a public IP address assigned, click the Actions menu () for the primary private IP address, and then click Edit Public IP.
-
In the dialog box, click Ephemeral Public IP.
-
(Optional) Give the ephemeral public IP address a name.
-
Click Reserve Public IP.
You might need to refresh the page to see the new public IP address.
The new public IP address is displayed in the IP Addresses table in Resources, in the Primary IP Information column for the VNIC, and in the Instance Access column of the Networking tab of the instance.
Use the oci network public-ip create command and required parameters to create a public IP. Use the lifetime property to specify whether it’s an ephemeral or reserved public IP.
oci network public-ip create [OPTIONS]
For a complete list of CLI commands, flags, and options, see the Command Line Reference.
Use the CreatePublicIp operation to create a public IP.
For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface.