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/ip-services/virtual-network-multiple-ip-addresses-powershell.md
+25-18Lines changed: 25 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,15 @@
1
1
---
2
-
title: Multiple IP addresses for Azure virtual machines - Azure PowerShell
2
+
title: Assign multiple IP addresses to VMs - Azure PowerShell
3
3
titleSuffix: Azure Virtual Network
4
4
description: Learn how to create a virtual machine with multiple IP addresses with Azure PowerShell.
5
5
services: virtual-network
6
6
author: asudbring
7
7
ms.service: virtual-network
8
8
ms.subservice: ip-services
9
9
ms.topic: how-to
10
-
ms.date: 09/09/2022
10
+
ms.date: 12/12/2022
11
11
ms.author: allensu
12
+
ms.custom: template-how-to, engagement-fy23
12
13
---
13
14
14
15
# Assign multiple IP addresses to virtual machines using Azure PowerShell
@@ -23,14 +24,14 @@ Assigning multiple IP addresses to a VM enables the following capabilities:
23
24
24
25
* The ability to add any of the private IP addresses for any of the NICs to an Azure Load Balancer back-end pool. In the past, only the primary IP address for the primary NIC could be added to a back-end pool. For more information about load balancing multiple IP configurations, see [Load balancing multiple IP configurations](../../load-balancer/load-balancer-multiple-ip.md?toc=%2fazure%2fvirtual-network%2ftoc.json).
25
26
26
-
Every NIC attached to a VM has one or more IP configurations associated to it. Each configuration is assigned one static or dynamic private IP address. Each configuration may also have one public IP address resource associated to it. To learn more about IP addresses in Azure, read the [IP addresses in Azure](../../virtual-network/ip-services/public-ip-addresses.md) article.
27
+
Every NIC attached to a VM has one or more IP configurations associated to it. Each configuration is assigned one static or dynamic private IP address. Each configuration may also have one public IP address resource associated to it. To learn more about IP addresses in Azure, see [IP addresses in Azure](../../virtual-network/ip-services/public-ip-addresses.md).
27
28
28
29
> [!NOTE]
29
-
> All IP configurations on a single NIC must be associated to the same subnet. If multiple IPs on different subnets are desired, multiple NICs on a VM can be used. To learn more about multiple NICs on a VM in Azure, read the [Create VM with Multiple NICs](../../virtual-machines/windows/multiple-nics.md) article.
30
+
> All IP configurations on a single NIC must be associated to the same subnet. If multiple IPs on different subnets are desired, multiple NICs on a VM can be used. To learn more about multiple NICs on a VM in Azure, see [Create VM with Multiple NICs](../../virtual-machines/windows/multiple-nics.md).
30
31
31
32
There's a limit to how many private IP addresses can be assigned to a NIC. There's also a limit to how many public IP addresses that can be used in an Azure subscription. See the [Azure limits](../../azure-resource-manager/management/azure-subscription-service-limits.md?toc=%2fazure%2fvirtual-network%2ftoc.json#azure-resource-manager-virtual-networking-limits) article for details.
32
33
33
-
This article explains how to add multiple IP addresses to a virtual machine using the Azure portal.
34
+
This article explains how to add multiple IP addresses to a virtual machine using PowerShell.
34
35
35
36
## Prerequisites
36
37
@@ -43,14 +44,14 @@ This article explains how to add multiple IP addresses to a virtual machine usin
43
44
- 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
44
45
-Name "Az. Network" if necessary.
45
46
46
-
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.
47
+
If you choose to install and use PowerShell locally, this article requires the Azure PowerShell module version 5.4.1 or later. Run `Get-InstalledModule -Name 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.
47
48
48
49
> [!NOTE]
49
50
> Though the steps in this article assigns all IP configurations to a single NIC, you can also assign multiple IP configurations to any NIC in a multi-NIC VM. To learn how to create a VM with multiple NICs, see [Create a VM with multiple NICs](../../virtual-machines/windows/multiple-nics.md).
50
51
51
52
:::image type="content" source="./media/virtual-network-multiple-ip-addresses-portal/multiple-ipconfigs.png" alt-text="Diagram of network configuration resources created in How-to article.":::
52
53
53
-
*Figure: Diagram of network configuration resources created in How-to article.*
54
+
*Figure: Diagram of network configuration resources created in this How-to article.*
54
55
55
56
## Create a resource group
56
57
@@ -70,7 +71,7 @@ New-AzResourceGroup @rg
70
71
71
72
In this section, you'll create a virtual network for the virtual machine.
72
73
73
-
Use [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork) and [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig) to create a virtual network.
74
+
Use [New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork) and [New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig) to create a virtual network with one subnet.
Use [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress) to create a primary public IP address.
98
99
@@ -141,9 +142,9 @@ $nsg = @{
141
142
New-AzNetworkSecurityGroup @nsg
142
143
```
143
144
144
-
###Create network interface
145
+
## Create a network interface
145
146
146
-
You'll use [New-AzNetworkInterface](/powershell/module/az.network/new-aznetworkinterface) and [New-AzNetworkInterfaceIpConfig](/powershell/module/az.network/new-aznetworkinterfaceipconfig) to create the network interface for the virtual machine. The public IP addresses and the NSG created previously are associated with the NIC. The network interface is attached to the virtual network you created previously.
147
+
Use [New-AzNetworkInterface](/powershell/module/az.network/new-aznetworkinterface) and [New-AzNetworkInterfaceIpConfig](/powershell/module/az.network/new-aznetworkinterfaceipconfig) to create a network interface (NIC) for the virtual machine. The public IP address and network security group created previously are associated with the network interface. The network interface is attached to the virtual network you created previously.
147
148
148
149
```azurepowershell-interactive
149
150
## Place the virtual network into a variable. ##
@@ -167,7 +168,7 @@ $pub1 = @{
167
168
}
168
169
$pubIP1 = Get-AzPublicIPAddress @pub1
169
170
170
-
## Create primary configuration for NIC. ##
171
+
## Create a primary IP configuration for the network interface. ##
0 commit comments