New-AzureRmNetworkInterfaceIpConfig

Creates a network interface IP configuration.

Warning

The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.

Syntax

New-AzureRmNetworkInterfaceIpConfig
   -Name <String>
   [-PrivateIpAddressVersion <String>]
   [-PrivateIpAddress <String>]
   [-Primary]
   [-Subnet <PSSubnet>]
   [-PublicIpAddress <PSPublicIpAddress>]
   [-LoadBalancerBackendAddressPool <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSBackendAddressPool]>]
   [-LoadBalancerInboundNatRule <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSInboundNatRule]>]
   [-ApplicationGatewayBackendAddressPool <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool]>]
   [-ApplicationSecurityGroup <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationSecurityGroup]>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
New-AzureRmNetworkInterfaceIpConfig
   -Name <String>
   [-PrivateIpAddressVersion <String>]
   [-PrivateIpAddress <String>]
   [-Primary]
   [-SubnetId <String>]
   [-PublicIpAddressId <String>]
   [-LoadBalancerBackendAddressPoolId <System.Collections.Generic.List`1[System.String]>]
   [-LoadBalancerInboundNatRuleId <System.Collections.Generic.List`1[System.String]>]
   [-ApplicationGatewayBackendAddressPoolId <System.Collections.Generic.List`1[System.String]>]
   [-ApplicationSecurityGroupId <System.Collections.Generic.List`1[System.String]>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzureRmNetworkInterfaceIpConfig cmdlet creates an Azure network interface IP configuration for a network interface.

Examples

1: Create an IP configuration with a public IP address for a network interface

$vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg
$Subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet
$PIP1 = Get-AzureRmPublicIPAddress -Name "PIP1" -ResourceGroupName "RG1"

$IPConfig1 = New-AzureRmNetworkInterfaceIpConfig -Name "IPConfig-1" -Subnet $Subnet -PublicIpAddress $PIP1
    -Primary

 $nic = New-AzureRmNetworkInterface -Name $NicName -ResourceGroupName myrg -Location westus
    -IpConfiguration $IpConfig1

The first two commands get a virtual network called myvnet and a subnet called mysubnet respectively that were previously created. These are stored in $vnet and $Subnet respectively. The third command gets a previously created public IP address called PIP1. The forth command creates a new IP configuration called "IPConfig-1" as the primary IP configuration with a public IP address associated with it. The last command then creates a network interface called mynic1 using this IP configuration.

2: Create an IP configuration with a private IP address

$vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg
$Subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet

$IPConfig2 = New-AzureRmNetworkInterfaceIpConfig -Name "IP-Config2" -Subnet $Subnet -PrivateIpAddress
    10.0.0.5

$nic = New-AzureRmNetworkInterface -Name mynic1 -ResourceGroupName myrg -Location westus -IpConfiguration
    $IpConfig2

The first two commands get a virtual network called myvnet and a subnet called mysubnet respectively that were previously created. These are stored in $vnet and $Subnet respectively. The third command creates a new IP configuration called "IPConfig-2" with a private IP address 10.0.0.5 associated with it. The last command then creates a network interface called mynic1 using this IP configuration.

Parameters

-ApplicationGatewayBackendAddressPool

Specifies a collection of application gateway backend address pool references to which this network interface IP configuration belongs.

Type:List<T>[PSApplicationGatewayBackendAddressPool]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ApplicationGatewayBackendAddressPoolId

Specifies a collection of application gateway backend address pool references to which this network interface IP configuration belongs.

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ApplicationSecurityGroup

Specifies a collection of application security group references to which this network interface IP configuration belongs.

Type:List<T>[PSApplicationSecurityGroup]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-ApplicationSecurityGroupId

Specifies a collection of application security group references to which this network interface IP configuration belongs.

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Type:IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-LoadBalancerBackendAddressPool

Specifies a collection of load balancer backend address pool references to which this network interface IP configuration belongs.

Type:List<T>[PSBackendAddressPool]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-LoadBalancerBackendAddressPoolId

Specifies a collection of load balancer backend address pool references to which this network interface IP configuration belongs.

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-LoadBalancerInboundNatRule

Specifies a collection of load balancer inbound Nat Rule references to which this network interface IPConfiguration belongs.

Type:List<T>[PSInboundNatRule]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-LoadBalancerInboundNatRuleId

Specifies a collection of load balancer inbound network address translation (NAT) rule references to which this network interface IP configuration belongs.

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-Name

Specifies the name of the network interface IP configuration.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Primary

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PrivateIpAddress

Specifies the static IP address of the network interface IP configuration.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PrivateIpAddressVersion

Specifies the IP address version of a network interface IP configuration. The acceptable values for this parameter are:

  • IPv4
  • IPv6
Type:String
Accepted values:IPv4, IPv6
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PublicIpAddress

Specifies a PublicIPAddress object. This cmdlet creates a reference to a public IP Address to associate with this network interface IP configuration.

Type:PSPublicIpAddress
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PublicIpAddressId

This cmdlet creates a reference to a public IP Address to associate with this network interface IP configuration.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Subnet

Specifies a Subnet object. This cmdlet creates a reference to a subnet in which this network interface IP configuration is created.

Type:PSSubnet
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubnetId

Specifies a reference to a subnet in which this network interface IP configuration is created.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

List<T>[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]

List<T>[[Microsoft.Azure.Commands.Network.Models.PSBackendAddressPool, Microsoft.Azure.Commands.Network, Version=6.4.1.0, Culture=neutral, PublicKeyToken=null]]

List<T>[[Microsoft.Azure.Commands.Network.Models.PSInboundNatRule, Microsoft.Azure.Commands.Network, Version=6.4.1.0, Culture=neutral, PublicKeyToken=null]]

List<T>[[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool, Microsoft.Azure.Commands.Network, Version=6.4.1.0, Culture=neutral, PublicKeyToken=null]]

List<T>[[Microsoft.Azure.Commands.Network.Models.PSApplicationSecurityGroup, Microsoft.Azure.Commands.Network, Version=6.4.1.0, Culture=neutral, PublicKeyToken=null]]

Outputs

PSNetworkInterfaceIPConfiguration

Notes

  • Keywords: azure, azurerm, arm, resource, management, manager, network, networking