Skip to content

Commit fa60331

Browse files
authored
Merge pull request #304893 from ramandhillon84/patch-5
Update how-to-multiple-prefixes-subnet.md
2 parents f847c70 + 49789fa commit fa60331

1 file changed

Lines changed: 79 additions & 14 deletions

File tree

articles/virtual-network/how-to-multiple-prefixes-subnet.md

Lines changed: 79 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,39 @@
11
---
2-
title: Create multiple prefixes for a subnet - Preview
2+
title: Create multiple prefixes for a subnet
33
titleSuffix: Azure Virtual Network
44
description: Learn how to configure multiple prefixes for a subnet in an Azure Virtual Network to increase address space capacity.
55
author: asudbring
66
ms.author: allensu
77
ms.service: azure-virtual-network
88
ms.topic: how-to
9-
ms.date: 05/06/2024
9+
ms.date: 08/29/2025
1010

1111
#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.
1212

1313
# 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."
1414
---
1515

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
1717

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.
1919

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.
2121

22-
The following limitations apply during the public preview:
22+
The following limitations still apply as of now:
2323

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).
2525

2626
- 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.
2727

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`.
3230

3331
## Prerequisites
3432

3533
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
3634

3735
> [!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.
3937
4038
# [PowerShell](#tab/powershell)
4139

@@ -166,7 +164,11 @@ In this section, you add a second prefix on an existing subnet to expand the add
166164
$vnet = Get-AzVirtualNetwork -ResourceGroupName 'test-rg' -Name 'vnet-1'
167165
```
168166
169-
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.
170172
171173
```azurepowershell
172174
Set-AzVirtualNetworkSubnetConfig -Name 'subnet-1' -VirtualNetwork $vnet -AddressPrefix '10.0.0.0/24', '10.0.1.0/24'
@@ -190,7 +192,11 @@ In this section, you add a second prefix on an existing subnet to expand the add
190192
191193
# [CLI](#tab/cli)
192194
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.
194200
195201
```azurecli
196202
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
201207
```
202208
---
203209
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.
217+
218+
```azurepowershell
219+
$vnet = Get-AzVirtualNetwork -ResourceGroupName 'test-rg' -Name 'vnet-1'
220+
```
221+
222+
1. Use [Get-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/set-azvirtualnetworksubnetconfig) to list all the address prefixes on the target subnet.
223+
224+
```azurepowershell
225+
Get-AzVirtualNetworkSubnetConfig -Name 'subnet-1' -VirtualNetwork $vnet
226+
```
227+
228+
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.
232+
233+
234+
```azurepowershell
235+
Set-AzVirtualNetworkSubnetConfig -Name 'subnet-1' -VirtualNetwork $vnet -AddressPrefix '10.0.1.0/24'
236+
```
237+
238+
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.
245+
246+
```azurepowershell
247+
Get-AzVirtualNetwork -ResourceGroupName 'test-rg' -Name 'vnet-1' | `
248+
Get-AzVirtualNetworkSubnetConfig -Name 'subnet-1' | `
249+
ConvertTo-Json
250+
```
251+
252+
253+
# [CLI](#tab/cli)
254+
255+
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
260+
261+
```azurecli
262+
az network vnet subnet update \
263+
--name subnet-1 \
264+
--vnet-name vnet-1 \
265+
--resource-group test-rg \
266+
--address-prefixes 10.0.1.0/24
267+
```
268+
---

0 commit comments

Comments
 (0)