Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Add-AzNetworkInterfaceIpConfig

Adds a network interface IP configuration to a network interface.

Syntax

SetByResource (Default)

Add-AzNetworkInterfaceIpConfig
 -Name <String>
 -NetworkInterface <PSNetworkInterface>
 [-PrivateIPAddressPrefixLength <Int32>]
 [-PrivateIpAddressVersion <String>]
 [-PrivateIpAddress <String>]
 [-Primary]
 [-Subnet <PSSubnet>]
 [-PublicIpAddress <PSPublicIpAddress>]
 [-LoadBalancerBackendAddressPool <PSBackendAddressPool[]>]
 [-LoadBalancerInboundNatRule <PSInboundNatRule[]>]
 [-ApplicationGatewayBackendAddressPool <PSApplicationGatewayBackendAddressPool[]>]
 [-ApplicationSecurityGroup <PSApplicationSecurityGroup[]>]
 [-GatewayLoadBalancerId <String>]
 [-DefaultProfile <IAzureContextContainer>]
 [<CommonParameters>]

SetByResourceId

Add-AzNetworkInterfaceIpConfig
 -Name <String>
 -NetworkInterface <PSNetworkInterface>
 [-PrivateIPAddressPrefixLength <Int32>]
 [-PrivateIpAddressVersion <String>]
 [-PrivateIpAddress <String>]
 [-Primary]
 [-SubnetId <String>]
 [-PublicIpAddressId <String>]
 [-LoadBalancerBackendAddressPoolId <String[]>]
 [-LoadBalancerInboundNatRuleId <String[]>]
 [-ApplicationGatewayBackendAddressPoolId <String[]>]
 [-ApplicationSecurityGroupId <String[]>]
 [-DefaultProfile <IAzureContextContainer>]
 [<CommonParameters>]

Description

The Add-AzNetworkInterfaceIpConfig 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-AzVirtualNetworkSubnetConfig -Name MySubnet -AddressPrefix 10.0.1.0/24
$vnet = New-AzVirtualNetwork -Name MyVNET -ResourceGroupName MyResourceGroup -Location "West US" -AddressPrefix 10.0.0.0/16 -Subnet $subnet

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

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

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

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

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.

Parameters

-ApplicationGatewayBackendAddressPool

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

Parameter properties

Type:

PSApplicationGatewayBackendAddressPool[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ApplicationGatewayBackendAddressPoolId

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

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ApplicationSecurityGroup

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

Parameter properties

Type:

PSApplicationSecurityGroup[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-ApplicationSecurityGroupId

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

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

-GatewayLoadBalancerId

The reference of Gateway LoadBalancer Provider resource.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-LoadBalancerBackendAddressPool

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

Parameter properties

Type:

PSBackendAddressPool[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-LoadBalancerBackendAddressPoolId

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

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-LoadBalancerInboundNatRule

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

Parameter properties

Type:

PSInboundNatRule[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-LoadBalancerInboundNatRuleId

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

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Name

Specifies the name of the network interface IP configuration.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-NetworkInterface

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

Parameter properties

Type:PSNetworkInterface
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Primary

The Add-AzNetworkInterfaceIpConfig cmdlet adds a network interface IP configuration to an Azure network interface.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-PrivateIpAddress

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-PrivateIPAddressPrefixLength

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

Parameter properties

Type:

Nullable<T>[Int32]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-PrivateIpAddressVersion

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

  • IPv4
  • IPv6

Parameter properties

Type:String
Default value:None
Accepted values:IPv4, IPv6
Supports wildcards:False
DontShow:False

Parameter sets

-PublicIpAddress

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

Parameter properties

Type:PSPublicIpAddress
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-PublicIpAddressId

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Subnet

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

Parameter properties

Type:PSSubnet
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-SubnetId

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

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSNetworkInterface

String

PSBackendAddressPool

PSInboundNatRule

PSApplicationGatewayBackendAddressPool

PSApplicationSecurityGroup

Outputs

PSNetworkInterface

Notes

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

Related Links


Feedback

Was this page helpful?