Skip to content

Commit bf5a239

Browse files
authored
Merge pull request #267737 from asudbring/subnet-prefixes
New article for preview of configuration of multiple prefixes on a subnet in an Azure Virtual Network
2 parents e5494aa + e5b4739 commit bf5a239

File tree

3 files changed

+174
-0
lines changed

3 files changed

+174
-0
lines changed
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
---
2+
title: Create multiple prefixes for a subnet - Preview
3+
titleSuffix: Azure Virtual Network
4+
description: Learn how to configure multiple prefixes for a subnet in an Azure Virtual Network to increase address space capacity.
5+
author: asudbring
6+
ms.author: allensu
7+
ms.service: virtual-network
8+
ms.topic: how-to
9+
ms.date: 05/06/2024
10+
11+
#customer intent: As a network administrator, I want to configure multiple prefixes on a subnet in my Azure Virtual Network so that I can expand my address space capacity.
12+
13+
---
14+
15+
# Create multiple prefixes for a subnet in an Azure Virtual Network - Preview
16+
17+
Large deployments of multiple scale apps within a virtual network are at risk of subnet address space exhaustion. Subnets in your virtual networks can host many applications that need the ability to scale out. This feature `AllowMultipleAddressPrefixesOnSubnet` allows you to scale your virtual machines and Azure Virtual Machine Scale Sets in subnets with ease. The feature eliminates the need to remove all resources from a subnet as a prerequisite for modifying its address prefixes.
18+
19+
Currently, Virtual Machine Scale Sets allows you to specify only one subnet. There isn't capability to extend subnet space or cross subnet boundaries. Virtual Machine Scale Sets can now take advantage of multiple address spaces when scaling up. If the first subnet is full, extra virtual machines spill over to subsequent subnets.
20+
21+
The following limitations apply during the public preview:
22+
23+
- The feature only supports virtual machines and virtual machine scale sets and doesn't support Bare Metal or SWIFT resources. Any delegated subnet can't use this feature.
24+
25+
- This feature doesn't support multiple customer address (CA) configurations. When using multiple prefixes on a subnet, you're only able to use a single customer address (CA) configuration. A single IPv4 (Internet Protocol version 4) and single IPv6 (Internet Protocol Version 6) address per NIC (network interface card) is supported.
26+
27+
> [!IMPORTANT]
28+
> Multiple prefix support for Azure Virtual Network subnets is currently in public preview.
29+
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
30+
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
31+
32+
## Prerequisites
33+
34+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
35+
36+
# [PowerShell](#tab/powershell)
37+
38+
- Azure PowerShell installed locally or Azure Cloud Shell.
39+
40+
- Sign in to Azure PowerShell and ensure you select the subscription with which you want to use this feature. For more information, see [Sign in with Azure PowerShell](/powershell/azure/authenticate-azureps).
41+
42+
- Ensure your `Az.Network` module is 4.3.0 or later. To verify the installed module, use the command Get-InstalledModule -Name `Az.Network`. If the module requires an update, use the command Update-Module -Name `Az.Network` if necessary.
43+
44+
If you choose to install and use PowerShell locally, this article requires the Azure PowerShell module version 5.4.1 or later. Run `Get-Module -ListAvailable Az` to find the installed version. If you need to upgrade, see [Install Azure PowerShell module](/powershell/azure/install-Az-ps). If you're running PowerShell locally, you also need to run `Connect-AzAccount` to create a connection with Azure.
45+
46+
- To access the multiple subnet prefix preview feature you'll need to register it in your Azure subscription. For more information about registering preview features in your subscription, see [Set up preview features in Azure subscription](/azure/azure-resource-manager/management/preview-features).
47+
48+
- Azure Feature Exposure Control (AFEC) is available through the Microsoft.Features namespace. For this feature, two AFEC flags will need to be registered in your subscription:
49+
50+
- **Microsoft.Features/providers/Microsoft.Network/features/AllowMultipleAddressPrefixesOnSubnet**
51+
52+
- **Microsoft.Features/providers/Microsoft.Network/features/AllowDeletionOfIpPrefixFromSubnet**
53+
54+
- To register the feature, use the following commands:
55+
56+
```azurepowershell
57+
Register-AzProviderFeature -FeatureName AllowMultipleAddressPrefixesOnSubnet -ProviderNamespace Microsoft.Network
58+
59+
Register-AzProviderFeature -FeatureName AllowDeletionOfIpPrefixFromSubnet -ProviderNamespace Microsoft.Network
60+
```
61+
62+
# [CLI](#tab/cli)
63+
64+
- The how-to article requires version 2.31.0 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
65+
66+
- To access the multiple subnet prefix preview feature you'll need to register it in your Azure subscription. For more information about registering preview features in your subscription, see [Set up preview features in Azure subscription](/azure/azure-resource-manager/management/preview-features).
67+
68+
- Azure Feature Exposure Control (AFEC) is available through the Microsoft.Features namespace. For this feature, two AFEC flags will need to be registered in your subscription:
69+
70+
- **Microsoft.Features/providers/Microsoft.Network/features/AllowMultipleAddressPrefixesOnSubnet**
71+
72+
- **Microsoft.Features/providers/Microsoft.Network/features/AllowDeletionOfIpPrefixFromSubnet**
73+
74+
- To register the feature, use the following commands:
75+
76+
```azurecli
77+
az feature register --namespace Microsoft.Network --name AllowMultipleAddressPrefixesOnSubnet
78+
79+
az feature register --namespace Microsoft.Network --name AllowDeletionOfIpPrefixFromSubnet
80+
```
81+
82+
---
83+
84+
## Create a subnet with multiple prefixes
85+
86+
In this section, you create a subnet with multiple prefixes.
87+
88+
# [PowerShell](#tab/powershell)
89+
90+
1. Use [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup) to create a resource group named **test-rg** in the **eastus2** location.
91+
92+
```azurepowershell
93+
$rg = @{
94+
Name = 'test-rg'
95+
Location = 'eastus2'
96+
}
97+
New-AzResourceGroup @rg
98+
```
99+
100+
1. Use [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig) to create a subnet with multiple prefixes.
101+
102+
```azurepowershell
103+
$subnet = @{
104+
Name = 'subnet-1'
105+
AddressPrefix = '10.0.0.0/24', '10.0.1.0/24'
106+
}
107+
$subnetConfig = New-AzVirtualNetworkSubnetConfig @subnet
108+
```
109+
110+
1. Use [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork) to create a virtual network with the subnet.
111+
112+
```azurepowershell
113+
$net = @{
114+
Name = 'vnet-1'
115+
ResourceGroupName = 'test-rg'
116+
Location = 'eastus2'
117+
AddressPrefix = '10.0.0.0/16'
118+
Subnet = $subnetConfig
119+
}
120+
New-AzVirtualNetwork @net
121+
```
122+
123+
# [CLI](#tab/cli)
124+
125+
1. Use [az group create](/cli/azure/group#az_group_create) to create a resource group named **test-rg** in the **eastus2** location.
126+
127+
```azurecli
128+
az group create \
129+
--name test-rg \
130+
--location eastus2
131+
```
132+
133+
1. Use [az network vnet create](/cli/azure/network/vnet#az_network_vnet_create) to create a virtual network.
134+
135+
```azurecli
136+
az network vnet create \
137+
--name vnet-1 \
138+
--resource-group test-rg \
139+
--location eastus2 \
140+
--address-prefix 10.0.0.0/16
141+
```
142+
1. Use [az network vnet subnet create](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_create) to create a subnet with multiple prefixes.
143+
144+
```azurecli
145+
az network vnet subnet create \
146+
--name subnet-1 \
147+
--vnet-name vnet-1 \
148+
--resource-group test-rg \
149+
--address-prefixes 10.0.0.0/24 10.0.1.0/24
150+
```
151+
---

articles/virtual-network/network-overview.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,27 @@ This table lists the methods that you can use to create a virtual network and su
108108
| [Azure CLI](../virtual-network/quick-create-cli.md) | The subnet and the virtual network are created at the same time. Provide a **`--subnet-name`** parameter to [az network vnet create](/cli/azure/network/vnet) with the subnet name. |
109109
| [Template](../virtual-network/template-samples.md) | For more information on using a template to create a virtual network and subnets, see [Virtual Network with two subnets](https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.network/vnet-two-subnets). |
110110

111+
### Multiple address prefixes on a subnet
112+
113+
Multiple address prefixes on a subnet is a feature that offers the ability to modify IP address spaces on a subnet. With this solution, customers using virtual machines and virtual machine scale sets can add and remove IP address prefixes to meet their scaling requirements.
114+
115+
**Limitations**:
116+
117+
- Customers can only use a single customer address (CA) configuration per NIC.
118+
119+
- Customers can only use on VM and Virtual Machine Scale Sets subnets. Delegated subnets aren't supported.
120+
121+
**Pricing**: Multiple address prefixes on a subnet is offered free of charge.
122+
123+
We welcome you to share your feedback about this feature in this [quick survey](https://aka.ms/multiple-prefixes-feedback).
124+
125+
> [!IMPORTANT]
126+
> Multiple prefix support for Azure Virtual Network subnets is currently in public preview.
127+
> This preview version is provided without a service level agreement, and it's not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
128+
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
129+
130+
For more information about how-to configure multiple address prefixes on a subnet, see [Create multiple prefixes for a subnet](how-to-multiple-prefixes-subnet.md).
131+
111132
## Network security groups
112133

113134
A [network security group (NSG)](../virtual-network/network-security-groups-overview.md) contains a list of Access Control List (ACL) rules that allow or deny network traffic to subnets, NICs, or both. NSGs can be associated with either subnets or individual NICs connected to a subnet. When an NSG is associated with a subnet, the ACL rules apply to all the VMs in that subnet. Traffic to an individual NIC can be restricted by associating an NSG directly to a NIC.

articles/virtual-network/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@
138138
href: manage-route-table.yml
139139
- name: Manage NICs
140140
href: virtual-network-network-interface.md
141+
- name: Create a subnet with multiple prefixes
142+
href: how-to-multiple-prefixes-subnet.md
141143
- name: Manage virtual network
142144
href: manage-virtual-network.yml
143145
- name: Manage subnets

0 commit comments

Comments
 (0)