< Back

Set-AzureRmNetworkInterfaceIpConfig

Tue Jan 29, 2019 9:58 pm

NAME Set-AzureRmNetworkInterfaceIpConfig



SYNOPSIS

Sets the goal state for an Azure network interface IP configuration.





SYNTAX

Set-AzureRmNetworkInterfaceIpConfig [-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>] [-LoadBalancerBackendAddressPool

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSBackendAddressPool]>] [-LoadBalancerInboundNatRule

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSInboundNatRule]>] -Name <String> -NetworkInterface

<PSNetworkInterface> [-Primary] [-PrivateIpAddress <String>] [-PrivateIpAddressVersion {IPv4 | IPv6}] [-PublicIpAddress <PSPublicIpAddress>]

[-Subnet <PSSubnet>] [<CommonParameters>]



Set-AzureRmNetworkInterfaceIpConfig [-ApplicationGatewayBackendAddressPoolId <System.Collections.Generic.List`1[System.String]>]

[-ApplicationSecurityGroupId <System.Collections.Generic.List`1[System.String]>] [-DefaultProfile <IAzureContextContainer>]

[-LoadBalancerBackendAddressPoolId <System.Collections.Generic.List`1[System.String]>] [-LoadBalancerInboundNatRuleId

<System.Collections.Generic.List`1[System.String]>] -Name <String> -NetworkInterface <PSNetworkInterface> [-Primary] [-PrivateIpAddress <String>]

[-PrivateIpAddressVersion {IPv4 | IPv6}] [-PublicIpAddressId <String>] [-SubnetId <String>] [<CommonParameters>]





DESCRIPTION

The Set-AzureRmNetworkInterfaceIpConfig cmdlet sets the goal state for an Azure network interface IP configuration.





PARAMETERS

-ApplicationGatewayBackendAddressPool

<System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool]>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ApplicationGatewayBackendAddressPoolId <System.Collections.Generic.List`1[System.String]>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ApplicationSecurityGroup <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSApplicationSecurityGroup]>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ApplicationSecurityGroupId <System.Collections.Generic.List`1[System.String]>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-LoadBalancerBackendAddressPool <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSBackendAddressPool]>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-LoadBalancerBackendAddressPoolId <System.Collections.Generic.List`1[System.String]>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-LoadBalancerInboundNatRule <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSInboundNatRule]>

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

configuration belongs.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-LoadBalancerInboundNatRuleId <System.Collections.Generic.List`1[System.String]>

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



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String>

Specifies the name of the network IP configuration for which this cmdlet sets.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NetworkInterface <PSNetworkInterface>

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



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Primary [<SwitchParameter>]





Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-PrivateIpAddress <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PrivateIpAddressVersion <String>

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



- IPv4



- IPv6



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PublicIpAddress <PSPublicIpAddress>

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

configuration.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PublicIpAddressId <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Subnet <PSSubnet>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-SubnetId <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



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



1: Changing the IP address of an IP configuration



$vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg

$subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet



$nic = Get-AzureRmNetworkInterface -Name nic1 -ResourceGroupName myrg



$nic | Set-AzureRmNetworkInterfaceIpConfig -Name ipconfig1 -PrivateIpAddress 10.0.0.11 -Subnet $subnet

-Primary



$nic | Set-AzureRmNetworkInterface



The first two commands get a virtual network called myvnet and a subnet called mysubnet and store it in the variables $vnet and $subnet

respectively. The third command gets the network interface nic1 associated with the IP configuration that needs to be updated. The third

command sets the private IP address of the primary IP configuration ipconfig1 to 10.0.0.11. Finally, the last command updates the network

interface ensuring the changes have been made successfully.





2: Associating an IP configuration with an application security group



$vnet = Get-AzureRmVirtualNetwork -Name myvnet -ResourceGroupName myrg

$subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet

$asg = Get-ApplicationSecurityGroup -Name myasg -ResourceGroupName myrg



$nic = Get-AzureRmNetworkInterface -Name nic1 -ResourceGroupName myrg



$nic | Set-AzureRmNetworkInterfaceIpConfig -Name ipconfig1 -PrivateIpAddress 10.0.0.11 -Subnet $subnet -ApplicationSecurityGroup $asg

-Primary



$nic | Set-AzureRmNetworkInterface



In this example, the variable $asg contains a reference to an application security group. The fourth command gets the network interface nic1

associated with the IP configuration that needs to be updated. The Set-AzureRmNetworkInterfaceIpConfig sets the private IP address of the

primary IP configuration ipconfig1 to 10.0.0.11 and creates an association with the retrieved application security group. Finally, the

last command updates the network interface ensuring the changes have been made successfully.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ceipconfig

Add-AzureRmNetworkInterfaceIpConfig

Get-AzureRmNetworkInterfaceIpConfig

New-AzureRmNetworkInterfaceIpConfig

Remove-AzureRmNetworkInterfaceIpConfig