You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-network/how-to-multiple-prefixes-subnet.md
+79-14Lines changed: 79 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,41 +1,39 @@
1
1
---
2
-
title: Create multiple prefixes for a subnet - Preview
2
+
title: Create multiple prefixes for a subnet
3
3
titleSuffix: Azure Virtual Network
4
4
description: Learn how to configure multiple prefixes for a subnet in an Azure Virtual Network to increase address space capacity.
5
5
author: asudbring
6
6
ms.author: allensu
7
7
ms.service: azure-virtual-network
8
8
ms.topic: how-to
9
-
ms.date: 05/06/2024
9
+
ms.date: 08/29/2025
10
10
11
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
12
13
13
# Customer intent: "As a network administrator, I want to configure multiple address prefixes on a subnet in my virtual network so that I can efficiently manage address space and scale my applications without downtime."
14
14
---
15
15
16
-
# Create multiple prefixes for a subnet in an Azure Virtual Network - Preview
16
+
# Create multiple prefixes for a subnet in an Azure Virtual Network
17
17
18
-
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
+
Application deployments that need dynamic scaling 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. The `Multiple Address Prefixes on Subnet` capability 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.
19
19
20
-
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
+
Currently, there isn't a capability to extend subnet space or cross subnet boundaries, which limits the Virtual Machine Scale Set to the available address space in a subnet. But with this feature, Virtual Machine Scale Sets can now take advantage of additional subnet address spaces when scaling up. If the first subnet is full, additional virtual machines or Virtual Machine Scale Sets can spill over to the new address space prefix within the same subnet.
21
21
22
-
The following limitations apply during the public preview:
22
+
The following limitations still apply as of now:
23
23
24
-
- The feature only supports virtual machines and virtual machine scale sets and doesn't support Bare Metal or VNet injection for Containers, especially PodSubnet IPAM mode in AKS clusters. Any delegated subnet can't use this feature.
24
+
- The feature only supports virtual machines and virtual machine scale sets and doesn't support Bare Metal or VNet injection for Containers, especially PodSubnet IPAM mode in AKS clusters. Any delegated subnet can't use this feature (except for GatewaySubnets delegated to VPN Gateway and ExpressRoute Gateway services).
25
25
26
26
- 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.
27
27
28
-
> [!IMPORTANT]
29
-
> Multiple prefix support for Azure Virtual Network subnets is currently in public preview.
30
-
> 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.
31
-
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
28
+
- This feature is only available currently via command line (PowerShell, CLI) or Azure Resource Manager Templates. Azure portal support is limited. Once additional address prefixes are added, under the `Subnets` blade, you'll be able to see the correct count of `Available IPs` from all the prefixes, but only the first prefix is listed.
29
+
- You can get the details of subnet configuration and all subnet prefixes by navigating to Virtual Network `Overview` page and selecting `JSON View`.
32
30
33
31
## Prerequisites
34
32
35
33
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
36
34
37
35
> [!CAUTION]
38
-
> Subnet properties "addressPrefixes" and "addressPrefix" are not to be used interchangeably. For best results, use only "addressPrefixes" for both a single address prefix and for multiple address prefixes. If you are already using "addressPrefix" in your workflows, continue to use this property.
36
+
> Subnet properties **addressPrefixes** and **addressPrefix** aren't to be used interchangeably. For best results, use only **addressPrefixes** for both a single address prefix and for multiple address prefixes. If you're already using **addressPrefixes** in your workflows, continue to use this property.
39
37
40
38
# [PowerShell](#tab/powershell)
41
39
@@ -166,7 +164,11 @@ In this section, you add a second prefix on an existing subnet to expand the add
1. Use [Set-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/set-azvirtualnetworksubnetconfig) to add a second address prefix to subnet configuration. Specify both the existing and new address prefixes in this step.
167
+
1. Use [Set-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/set-azvirtualnetworksubnetconfig) to add a second address prefix to subnet configuration. Specify both the existing and new address prefixes in this step
168
+
169
+
> [!IMPORTANT]
170
+
> You must not skip listing the existing subnet prefixes in this step.
171
+
> Only the address prefixes specified here will be applied in next step, all others will be removed if not in use, or result in an error if those are referenced by existing network interfaces.
@@ -190,7 +192,11 @@ In this section, you add a second prefix on an existing subnet to expand the add
190
192
191
193
# [CLI](#tab/cli)
192
194
193
-
1. Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_update) add a second address prefix to subnet configuration and apply the new configuration to the virtual network.
195
+
1. Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_update) to add a second address prefix to subnet configuration and apply the new configuration to the virtual network.
196
+
197
+
> [!IMPORTANT]
198
+
> You must not skip listing the existing subnet prefixes in this step.
199
+
> Only the address prefixes specified here will be applied to subnet, all others will be removed if not in use, or result in an error if those are referenced by existing network interfaces.
194
200
195
201
```azurecli
196
202
az network vnet subnet update \
@@ -201,3 +207,62 @@ In this section, you add a second prefix on an existing subnet to expand the add
201
207
```
202
208
---
203
209
210
+
## Remove a prefix from the subnet
211
+
212
+
You can also remove the address prefixes from the subnet that aren't being actively used, that is, no existing network interfaces are referencing these address prefixes. In this section, you'll remove an `unused` address prefix.
213
+
214
+
# [PowerShell](#tab/powershell)
215
+
216
+
1. Use [Get-AzVirtualNetwork](/powershell/module/az.network/get-azvirtualnetwork) to retrieve the target virtual network configuration in a variable.
1. Use [Get-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/set-azvirtualnetworksubnetconfig) to list all the address prefixes on the target subnet.
1. Use [Set-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/set-azvirtualnetworksubnetconfig) to update the list of address prefixes and remove the ones that aren't used.
229
+
230
+
> [!IMPORTANT]
231
+
> Only the address prefixes specified here will be applied in next step, all others will be removed if not in use, or result in an error if those are referenced by existing network interfaces.
1. Use [Set-AzVirtualNetwork](/powershell/module/az.network/set-azvirtualnetwork) to apply the updated virtual network configuration.
239
+
240
+
```azurepowershell
241
+
$vnet | Set-AzVirtualNetwork
242
+
```
243
+
244
+
1. Use [Get-AzVirtualNetwork](/powershell/module/az.network/get-azvirtualnetwork) and [Get-AzVirtualNetwork](/powershell/module/az.network/get-azvirtualnetwork) to retrieve updated virtual network and subnet configuration. Verify that the subnet now has two address prefixes.
1. Use [az network vnet subnet update](/cli/azure/network/vnet/subnet#az_network_vnet_subnet_update) to update the list of address prefixes and remove the ones that aren't used.
256
+
257
+
> [!IMPORTANT]
258
+
> You must not skip listing all the required subnet prefixes in this step.
259
+
> Only the address prefixes specified here will be applied to the subnet, all others will be removed if not in use, or result in an error if those are referenced by existing network interfaces
0 commit comments