Add or remove IP addresses from a subnet
You can add IP addresses when initially creating a subnet, or you can add IP addresses to a subnet that already exists. You can also remove IP addresses from an existing subnet. This enables you to allocate only the required IP addresses for SVMs.
The procedure you follow depends on the interface that you use—System Manager or the CLI:
Beginning with ONTAP 9.12.0, you can use System Manager to add or remove IP addresses to or from a subnet
-
Select Network > Overview > Subnets.
-
Select > Edit beside the subnet you want to change.
-
Add or remove IP addresses.
-
Save your changes.
-
If the IP address or range entered is already used by an interface, the following message is displayed:
An IP address in this range is already in use by a LIF. Associate the LIF with this subnet?
-
When you click OK, the existing LIF will be associated with the subnet.
-
Use the CLI to add or remove IP addresses to or from a subnet
When adding IP addresses, you will receive an error if any service processor or network interfaces are using the IP addresses in the range being added. If you want to associate any manually addressed interfaces with the current subnet, you can set the -force-update-lif-associations
option to true
.
When removing IP addresses, you will receive an error if any service processor or network interfaces are using the IP addresses being removed. If you want the interfaces to continue to use the IP addresses after they are removed from the subnet, you can set the -force-update-lif-associations
option to true
.
Add or remove IP addresses from a subnet:
If you want to… |
Use this command… |
---|---|
Add IP addresses to a subnet |
network subnet add-ranges |
Remove IP addresses from a subnet |
network subnet remove-ranges |
For more information about these commands, see the man pages.
The following command adds IP addresses 192.0.2.82 through 192.0.2.85 to subnet sub1:
network subnet add-ranges -subnet-name <sub1> -ip-ranges <192.0.2.82-192.0.2.85>
The following command removes IP address 198.51.100.9 from subnet sub3:
network subnet remove-ranges -subnet-name <sub3> -ip-ranges <198.51.100.9>
If the current range includes 1 through 10 and 20 through 40, and you want to add 11 through 19 and 41 through 50 (basically allowing 1 through 50), you can overlap the existing range of addresses by using the following command. This command adds only the new addresses and does not affect the existing addresses:
network subnet add-ranges -subnet-name <sub3> -ip-ranges <198.51.10.1-198.51.10.50>