Assigning an Ephemeral Public IP When Creating a Secondary VNIC

When you add a secondary VNIC to an instance, you choose whether the primary private IP on the new VNIC gets an ephemeral public IP.

For more information, see https://docs.oracle.com/iaas/Content/Network/Tasks/managingvnics_tasks-attach.htm

This choice is available only if the secondary VNIC is in a public subnet.

  • On the Create VNIC page, the Automatically assign public IPv4 address option is not selected by default, which means that the secondary VNIC doesn't get an ephemeral public IP address. You must select Automatically assign public IPv4 address.

    .

  • 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.