Creating a VCN

Create a VCN that instances, load balancers, and other resources can use to connect to each other and the internet. After you create a VCN, you must then manually create subnets, gateways, routing rules, and security settings before the VCN can connect to the internet or your on-premises network.

A virtual cloud network  (VCN) is a software-defined network that you set up in the Oracle Cloud Infrastructure data centers in a particular region .

For more information about VCNs, refer to Overview of VCNs and Subnets.

After you create a VCN, see Creating a Subnet.

Note

For a quick procedure that creates a VCN that you can try out immediately (that is, with subnets and an internet gateway), see the information about the "VCN with Internet Connectivity" wizard in Virtual Networking Wizards or see Scenario A: Public Subnet.

    1. Open the navigation menu, click Networking, and then click Virtual cloud networks.
    2. Under List Scope, select a compartment that you have permission to work in.The page updates to display only the resources in that compartment. If you're not sure which compartment to use, contact an administrator. For more information, see Access Control.
      Note

      To create any new resource the service limit for that resource must not already have been reached. Once the service limit for a resource type has been reached, you can either remove unused resources of that type or request a service limit increase.
    3. Click Create VCN.
    4. Enter the following information:
      • Name: A descriptive name for the VCN. It doesn't have to be unique, and it can't be changed later in the Console (but you can change it with the API or CLI). Avoid entering confidential information.
      • Create in Compartment: Leave as is.
      • IPv4 CIDR Blocks: Specify up to five but at least one nonoverlapping IPv4 CIDR blocks for the VCN. For example: 172.16.0.0/16. You can add or remove CIDR blocks later. See Allowed VCN Size and Address Ranges. If necessary, use a CIDR calculator.
      • Use DNS Hostnames in this VCN: This option is required to assign DNS hostnames to hosts in the VCN, and required if you plan to use the VCN's default DNS feature (called the Internet and VCN Resolver). If you select this option you can specify a DNS Label for the VCN, or you can allow the Console to generate one for you. The dialog box automatically displays the corresponding DNS Domain Name for the VCN (<VCN_DNS_label>.oraclevcn.com). For more information, see DNS in Your Virtual Cloud Network.
      • IPv6 prefixes: You can request that a single Oracle-allocated IPv6 /56 prefix is assigned to this VCN. Alternately, you can assign a BYOIPv6 prefix or ULA prefix to the VCN. This option is available for all commercial and government regions. For more information on IPv6, see IPv6 Addresses.
      • Add tags to organize your resources: If you have permissions to create a resource, then you also have permissions to apply free-form tags to that resource. To apply a defined tag, you must have permissions to use the tag namespace. For more information about tagging, see Resource Tags. If you're not sure whether to apply tags, skip this option or ask an administrator. You can apply tags later.
      • Add Security Attributes to lock down your resources: If you have permissions to create a resource, then you might also have permissions to apply security attributes to that resource. To apply a security attribute, you must have permissions to use the security attribute namespace. For more information about security attributes and security attribute namespaces, see Zero Trust Packet Routing. If you're not sure whether to apply security attributes, skip this option or ask an administrator. You can apply security attributes later.
    5. Click Create VCN.
    The VCN is then created and displayed on the Virtual Cloud Networks list page in the compartment that you chose.
  • Use the network vcn create command and required parameters to create a VCN:

    oci network vcn create --compartment-id compartment_id [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the CreateVcn operation to create a VCN.