Editing a subnet
Use one of the methods below to edit settings for a subnet.
You can change these characteristics of a subnet:
- Size of the assigned CIDR blockNote
- The CIDR block IP range you specify must be completely within one of the VCN's CIDR block ranges.
- The new range must use the same network address as the previous range. For example, the previous and new ranges could be 10.0.0.0/25 and 10.0.0.0/24.
- If you are reducing the CIDR range, ensure that no IP addresses outside of the reduced range are in use.
- The new CIDR range's broadcast address (last IP address of CIDR range) must not be an IP address in use in the previous CIDR range.
- You cannot create VNICs or private IPs for this subnet while a CIDR block update is in progress.
- After the CIDR block update is complete, the DHCP lease for each host within the subnet must be renewed. Renewal happens automatically within 24 hours. To renew the lease immediately, refer to the applicable operating system documentation for guidance on how to renew the lease manually.
- Ensure that you adjust your secondary VNICs and secondary IPs as applicable to match your updated VCN configuration.
- Once you have assigned an IPv6 prefix to a VCN, it must always have at least one IPv6 prefix assigned to it.
- Which set of DHCP options the subnet uses
- Which route table the subnet uses
- Which security lists the subnet uses
- Open the navigation menu, click Networking, and then click Virtual cloud networks.
- Click the name of the VCN you're interested in.
- Click Subnets.
- Click the subnet you're interested in.
- Click Edit.
- Make your changes. Avoid entering confidential information.
- Click Save Changes.
The changes take effect within a few seconds.
Use the network subnet update command and required parameters to edit a subnet:
oci network subnet update --subnet-id ocid ... [OPTIONS]
For a complete list of flags and variable options for CLI commands, see the Command Line Reference.
Run the UpdateSubnet operation to edit the settings for a subnet.