Choosing Whether an Ephemeral Public IP Is Assigned at Instance Creation

You can choose whether to assign an ephemeral public IP address to an instance when you create it.

  • When you create an instance into a public subnet, there's an Automatically assign a public IPv4 address option inn the Networking step of the Create compute instance page workflow. By default, the option is selected, and the instance gets an ephemeral public IP.

    If you don't want an ephemeral public IP assigned, you can either clear the option (switch off the toggle) or delete the ephemeral public IP after instance creation.

  • Use the network public-ip create command and required parameters to assign a public IP:

    oci network public-ip create --compartment-id compartment_OCID --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.