1Z0-1072-25 Question 62
Single answerYou are deploying a web server on Oracle Cloud Infrastructure (OCI) that must be publicly accessible from the internet, and it also needs to connect securely to a private database within the same Virtual Cloud Network (VCN). You have created a public subnet for the web server and assigned it both a private IP address and a public IP address. Which statement accurately describes how VNICs and IP addresses should be configured for this scenario?
- A
You must create a separate VNIC exclusively for the public IP address; a single VNIC cannot have both public and private IP addresses.
- B
A compute instance� primary VNIC can have a private IP address that optionally has a public IP assigned for external access.
- C
When a private IP is converted to a public IP, the subnet must be switched from private to public, requiring a subnet re-deployment.
- D
A public IP can be assigned only to a secondary private IP, never to the primary private IP of a VNIC.
Show answer and explanation
Correct answer: B
Explanation
In OCI, a compute instance typically has at least one VNIC, which comes with a primary private IP address. You can optionally assign a public IP to that primary private IP if the instance resides in a public subnet and you want direct internet access. This approach is commonly used for web-facing applications that also connect privately to resources (like databases) within the same Virtual Cloud Network. For more details, refer to the OCI documentation on managing VNICs and IP addresses.
- A. Incorrect.
Incorrect. A single VNIC can have both a private IP address and an associated public IP. You do not need separate VNICs for each type of address. This is a common misconception.
- B. Correct.
Correct. By default, an OCI compute instance� primary VNIC has a private IP address. You can assign a public IP (ephemeral or reserved) to that private IP, allowing inbound and outbound internet access while still retaining the private IP for internal communication.
- C. Incorrect.
Incorrect. You do not need to recreate or re-deploy the subnet to convert a private IP into one with an assigned public IP. Instead, you must ensure the subnet is configured as a public subnet with an Internet Gateway route for outbound traffic, but no re-deployment is required.
- D. Incorrect.
Incorrect. You can assign a public IP to either the primary or secondary private IP addresses on a VNIC. There is no restriction that limits public IPs only to secondary addresses.