Add-AzureRmNetworkInterfaceIpConfig

Adds a network interface IP configuration to a network interface.

Syntax

Add-AzureRmNetworkInterfaceIpConfig
   -Name <String>
   -NetworkInterface <PSNetworkInterface>
   [-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>]
Add-AzureRmNetworkInterfaceIpConfig
   -Name <String>
   -NetworkInterface <PSNetworkInterface>
   [-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 Add-AzureRmNetworkInterfaceIpConfig cmdlet adds a network interface IP configuration to an Azure network interface.

Examples

Example 1: Add a new IP configuration with an application security group

$subnet = New-AzureRmVirtualNetworkSubnetConfig -Name MySubnet -AddressPrefix 10.0.1.0/24
$vnet = New-AzureRmvirtualNetwork -Name MyVNET -ResourceGroupName MyResourceGroup -Location "West US" -AddressPrefix 10.0.0.0/16 -Subnet $subnet

$nic = New-AzureRmNetworkInterface -Name MyNetworkInterface -ResourceGroupName MyResourceGroup -Location "West US"  -Subnet $vnet.Subnets[0]

$asg = New-AzureRmApplicationSecurityGroup -ResourceGroupName MyResourceGroup -Name MyASG -Location "West US"

$nic | Set-AzureRmNetworkInterfaceIpConfig -Name $nic.IpConfigurations[0].Name -Subnet $vnet.Subnets[0] -ApplicationSecurityGroup $asg | Set-AzureRmNetworkInterface

$nic | Add-AzureRmNetworkInterfaceIpConfig -Name MyNewIpConfig -Subnet $vnet.Subnets[0] -ApplicationSecurityGroup $asg  | Set-AzureRmNetworkInterface

In this example, we create a new network interface MyNetworkInterface that belongs to a subnet in the new virtual network MyVNET. We also create an empty application security group MyASG to associate with the IP configurations in the network interface. Once both objects are created, we link the default IP configuration to the MyASG object. At last, we create a new IP configuration in the network interface also linked to the application security group object.

Required Parameters

-Name

Specifies the name of the network interface IP configuration.

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

Specifies a NetworkInterface object. This cmdlet adds a network interface IP configuration to the object that this parameter specifies.

Type:Microsoft.Azure.Commands.Network.Models.PSNetworkInterface
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-ApplicationGatewayBackendAddressPool

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

Type:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ApplicationGatewayBackendAddressPoolId

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

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ApplicationSecurityGroup

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

Type:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationSecurityGroup]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-ApplicationSecurityGroupId

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

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
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:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSBackendAddressPool]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LoadBalancerBackendAddressPoolId

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

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LoadBalancerInboundNatRule

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

Type:System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSInboundNatRule]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-LoadBalancerInboundNatRuleId

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

Type:System.Collections.Generic.List`1[System.String]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Primary
Type:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
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
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
Parameter Sets:IPv4, IPv6
Position:Named
Default value:None
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:Microsoft.Azure.Commands.Network.Models.PSPublicIpAddress
Position:Named
Default value:None
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
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:Microsoft.Azure.Commands.Network.Models.PSSubnet
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-SubnetId

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

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

Inputs

PSNetworkInterface

Parameter 'NetworkInterface' accepts value of type 'PSNetworkInterface' from the pipeline

Outputs

Microsoft.Azure.Commands.Network.Models.PSNetworkInterface

Notes

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