Removing an IPv4 CIDR Block or IPv6 Prefix from a VCN

You can remove an IPv4 CIDR block or IPv6 prefix from a Virtual Cloud Network (VCN), with some restrictions.

  • You can't remove an IPv4 CIDR block if an IP address in that range is in use.
  • While the VCN is being updated, you can't create or update the VCN's subnets, VLANs, local peering gateways (LPGs), or route tables.
  • After you assign an IPv6 prefix to a VCN, the VCN must always have at least one IPv6 prefix assigned to it. Additionally, a VCN must have at least one CIDR block assigned to it.
    1. Open the navigation menu, click Networking, and then click Virtual cloud networks.
    2. Click the name of the VCN that you want to update. You might need to change the compartment to find the VCN that you want.
    3. Under Resources, click CIDR Blocks/Prefixes.
    4. Find the IPv4 CIDR block or IPv6 prefix in the list, click the Actions menu (Actions Menu), and then click Remove CIDR Block.
    5. Click Remove CIDR Block.
    The VCN's state changes to UPDATING. The time to completion can vary depending on the size of the network. Updating a small network could take about a minute, and updating a large network could take up to an hour. You can view work requests to monitor the status of the update.
  • Use the network vcn remove-vcn-cidr command and required parameters to remove an IPv4 CIDR block from a VCN:

    oci network vcn remove-vcn-cidr --cidr-block cidr --vcn-id vcn-ocid [OPTIONS]

    Use the network vcn remove-ipv6-vcn-cidr command and required parameters to remove an IPv6 prefix from a VCN:

    oci network vcn remove-ipv6-vcn-cidr --vcn-id vcn-ocid  [OPTIONS]

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

  • Run the RemoveVcnCidr operation to remove an IPv4 CIDR block from a VCN.

    Run the RemoveIpv6Cidr operation to remove an IPv6 prefix from a VCN.