When you have created your VNet, you can manage and create its subnets with the following command:
az network vnet subnet
When using the Azure portal, you can also create a specific type of a VNet called a gateway subnet. This kind of subnet is designed particularly for VPN gateways, which you used in the Creating and configuring a VNet-to-VNet connection section.
To create a new subnet, use the following command:
$ az network vnet subnet create -g "azureadministrator-euw-rg" --vnet-name "vnetforsubnets" -n "Subnet1" --address-prefix "10.0.0.1/29"
The preceding command contains two important parameters:
- --vnet-name: Identifies the VNet in which a subnet will be created.
- --address-prefix: The address space of a subnet presented as CIDR block.
In the case that any errors are found, Azure will tell you what needs to be fixed before attempting to create it again. The preceding command is quite simple, but of course...