Skip to main content

Create a subnet

Contributors netapp-aoife netapp-barbe netapp-aherbin netapp-thomi

You can create a subnet to allocate specific blocks of IPv4 or IPv6 addresses to be used later when you create LIFs for the SVM.

This enables you to create LIFs more easily by specifying a subnet name instead of having to specify IP address and network mask values for each LIF.

Before you begin

You must be a cluster administrator to perform this task.

The broadcast domain and IPspace where you plan to add the subnet must already exist.

About this task
  • All subnet names must be unique within an IPspace.

  • When adding IP address ranges to a subnet, you must ensure that there are no overlapping IP addresses in the network so that different subnets, or hosts, do not attempt to use the same IP address.

  • If you specify a gateway when defining a subnet, a default route to that gateway is added automatically to the SVM when a LIF is created using that subnet. If you do not use subnets, or if you do not specify a gateway when defining a subnet, then you will need to use the route create command to add a route to the SVM manually.

Procedure

The procedure you follow depends on the interface that you use—​System Manager or the CLI:

System Manager

Beginning with ONTAP 9.12.0, you can use System Manager to create a subnet.

Steps
  1. Select Network > Overview > Subnets.

  2. Click add icon to create a subnet.

  3. Name the subnet.

  4. Specify the subnet IP address.

  5. Set the subnet mask.

  6. Define the range of IP addresses that comprise the subnet.

  7. If useful, specify a gateway.

  8. Select the broadcast domain to which the subnet belongs.

  9. Save your changes.

    1. 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?

    2. When you click OK, the existing LIF will be associated with the subnet.

CLI

Use the CLI to create a subnet.

Steps
network subnet create -subnet-name subnet_name -broadcast-domain <broadcast_domain_name> [- ipspace <ipspace_name>] -subnet <subnet_address> [-gateway <gateway_address>] [-ip-ranges <ip_address_list>] [-force-update-lif-associations <true>]
  • subnet_name is the name of the layer 3 subnet you want to create.

    The name can be a text string like "Mgmt" or it can be a specific subnet IP value like 192.0.2.0/24.

  • broadcast_domain_name is the name of the broadcast domain where the subnet will reside.

  • ipspace_name is the name of the IPspace that the broadcast domain is part of.

    The "Default" IPspace is used unless you specify a value for this option.

  • subnet_address is the IP address and mask of the subnet; for example, 192.0.2.0/24.

  • gateway_address is the gateway for the default route of the subnet; for example, 192.0.2.1.

  • ip_address_list is the list, or range, of IP addresses that will be allocated to the subnet.

    The IP addresses can be individual addresses, a range of IP addresses, or a combination in a comma-separated list.

  • The value true can be set for the -force-update-lif-associations option.

    This command fails if any service processor or network interfaces are currently using the IP addresses in the specified range. Setting this value to true associates any manually addressed interfaces with the current subnet, and allows the command to succeed.

The following command creates subnet sub1 in broadcast domain Default-1 in the Default IPspace. It adds an IPv4 subnet IP address and mask, the gateway, and a range of IP addresses:

network subnet create -subnet-name sub1 -broadcast-domain Default-1 -subnet 192.0.2.0/24 - gateway 192.0.2.1 -ip-ranges 192.0.2.1-192.0.2.100, 192.0.2.122

The following command creates subnet sub2 in broadcast domain Default in the "Default" IPspace. It adds a range of IPv6 addresses:

network subnet create -subnet-name sub2 -broadcast-domain Default -subnet 3FFE::/64 - gateway 3FFE::1 -ip-ranges "3FFE::10-3FFE::20"
After you finish

You can assign SVMs and interfaces to an IPspace using the addresses in the subnet.

If you need to change the name of an existing subnet, use the network subnet rename command.