Describe public and private IP addresses and virtual NICs

Summary

There are two (2) types of subnets: private; and public. Both can have egress to the Internet. However, only the public subnet can have ingress from the Internet.

References

Public and Private IP Addresses

A private IP address is always allocated. A public IP address can only exist in a public subnet.

Public IP Address

A public IP address allows a resource, load balancer or instance, allows to be connected from the Internet.

There are two (2) types of public IP addresses which can be allocated from OCI's IPv4 allocation:

  1. Ephermal for the lifetime of the instance or load balancer
  2. Reserved exists beyond the lifetime of the resource

Private IP Address

A private IPv4 address is allocated from the subnet's CIDR.

Virtual NICs

The help text for the oci network vnic command says:

A virtual network interface card. Each VNIC resides in a subnet in a VCN. An instance attaches to a VNIC to obtain a network connection into the VCN through that subnet. Each instance has a primary VNIC that is automatically created and attached during launch. You can add secondary VNICs to an instance after it’s launched. For more information, see Virtual Network Interface Cards (VNICs).

Each VNIC has a primary private IP that is automatically assigned during launch. You can add secondary private IPs to a VNIC after it’s created. For more information, see CreatePrivateIp and IP Addresses.

If you are an Oracle Cloud VMware Solution customer, you will have secondary VNICs that reside in a VLAN instead of a subnet. These VNICs have other differences, which are called out in the descriptions of the relevant attributes in the Vnic object. Also see Vlan.