Skip to content

Latest commit

 

History

History
415 lines (320 loc) · 12 KB

Set-AzNetworkInterfaceIpConfig.md

File metadata and controls

415 lines (320 loc) · 12 KB
external help file Module Name ms.assetid online version schema
Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml
Az.Network
13EF1028-43DE-424D-8185-EC45B5CEF2C1
2.0.0

Set-AzNetworkInterfaceIpConfig

SYNOPSIS

Updates an IP configuration for a network interface.

SYNTAX

SetByResource (Default)

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

SetByResourceId

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

DESCRIPTION

The Set-AzNetworkInterfaceIpConfig cmdlet updates an IP configuration for a network interface.

EXAMPLES

1: Changing the IP address of an IP configuration

$vnet = Get-AzVirtualNetwork -Name myvnet -ResourceGroupName myrg
$subnet = Get-AzVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet

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

$nic | Set-AzNetworkInterfaceIpConfig -Name ipconfig1 -PrivateIpAddress 10.0.0.11 -Subnet $subnet -Primary

$nic | Set-AzNetworkInterface

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-AzVirtualNetwork -Name myvnet -ResourceGroupName myrg
$subnet = Get-AzVirtualNetworkSubnetConfig -Name mysubnet -VirtualNetwork $vnet
$asg = Get-AzApplicationSecurityGroup -Name myasg -ResourceGroupName myrg

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

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

$nic | Set-AzNetworkInterface

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-AzNetworkInterfaceIpConfig 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.

3: Disassociating an IP configuration with an application gateway backend address pool

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

$nic | Set-AzNetworkInterfaceIpConfig -Name ipconfig1 -ApplicationGatewayBackendAddressPool $null

$nic | Set-AzNetworkInterface

The Set-AzNetworkInterfaceIpConfig sets the application gateway backend address pool of the IP configuration ipconfig1 to null and disassociate with the network interface. Finally, the last command updates the network interface ensuring the changes have been made successfully.

PARAMETERS

-ApplicationGatewayBackendAddressPool

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

Type: Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool[]
Parameter Sets: SetByResource
Aliases:

Required: False
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.String[]
Parameter Sets: SetByResourceId
Aliases:

Required: False
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: Microsoft.Azure.Commands.Network.Models.PSApplicationSecurityGroup[]
Parameter Sets: SetByResource
Aliases:

Required: False
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.String[]
Parameter Sets: SetByResourceId
Aliases:

Required: False
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.Core.IAzureContextContainer
Parameter Sets: (All)
Aliases: AzContext, AzureRmContext, AzureCredential

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

-GatewayLoadBalancerId

Specifies the ID of the Gateway Load Balancer Provider Frontend Ip Configuration.

Type: System.String
Parameter Sets: SetByResource
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-LoadBalancerBackendAddressPool

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

Type: Microsoft.Azure.Commands.Network.Models.PSBackendAddressPool[]
Parameter Sets: SetByResource
Aliases:

Required: False
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.String[]
Parameter Sets: SetByResourceId
Aliases:

Required: False
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: Microsoft.Azure.Commands.Network.Models.PSInboundNatRule[]
Parameter Sets: SetByResource
Aliases:

Required: False
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.String[]
Parameter Sets: SetByResourceId
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Name

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

Type: System.String
Parameter Sets: (All)
Aliases:

Required: True
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
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Primary

Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
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: System.String
Parameter Sets: (All)
Aliases:

Required: False
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: System.String
Parameter Sets: (All)
Aliases:
Accepted values: IPv4, IPv6

Required: False
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
Parameter Sets: SetByResource
Aliases:

Required: False
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: System.String
Parameter Sets: SetByResourceId
Aliases:

Required: False
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
Parameter Sets: SetByResource
Aliases:

Required: False
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: System.String
Parameter Sets: SetByResourceId
Aliases:

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

CommonParameters

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

INPUTS

Microsoft.Azure.Commands.Network.Models.PSNetworkInterface

System.String[]

Microsoft.Azure.Commands.Network.Models.PSBackendAddressPool[]

Microsoft.Azure.Commands.Network.Models.PSInboundNatRule[]

Microsoft.Azure.Commands.Network.Models.PSApplicationGatewayBackendAddressPool[]

Microsoft.Azure.Commands.Network.Models.PSApplicationSecurityGroup[]

OUTPUTS

Microsoft.Azure.Commands.Network.Models.PSNetworkInterface

NOTES

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

RELATED LINKS

Add-AzNetworkInterfaceIpConfig

Get-AzNetworkInterfaceIpConfig

New-AzNetworkInterfaceIpConfig

Remove-AzNetworkInterfaceIpConfig