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.
- Open the navigation menu, click Networking, and then click Virtual cloud networks.
- 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.
- Under Resources, click CIDR Blocks/Prefixes.
- Find the IPv4 CIDR block or IPv6 prefix in the list, click the Actions menu, and then click Remove CIDR Block.
- 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 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 flags and variable options for CLI commands, see the Command Line 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.