Edit

Share via


Update-AzVirtualNetworkGatewayNatRule

Updates a Virtual Network Gateway NatRule.

Syntax

ByVirtualNetworkGatewayNatRuleName (Default)

Update-AzVirtualNetworkGatewayNatRule
    -ResourceGroupName <String>
    -ParentResourceName <String>
    -Name <String>
    [-InternalMapping <String[]>]
    [-ExternalMapping <String[]>]
    [-InternalPortRange <String[]>]
    [-ExternalPortRange <String[]>]
    [-IpConfigurationId <String>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByVirtualNetworkGatewayNatRuleResourceId

Update-AzVirtualNetworkGatewayNatRule
    -ResourceId <String>
    [-InternalMapping <String[]>]
    [-ExternalMapping <String[]>]
    [-InternalPortRange <String[]>]
    [-ExternalPortRange <String[]>]
    [-IpConfigurationId <String>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByVirtualNetworkGatewayNatRuleObject

Update-AzVirtualNetworkGatewayNatRule
    -InputObject <PSVirtualNetworkGatewayNatRule>
    [-InternalMapping <String[]>]
    [-ExternalMapping <String[]>]
    [-InternalPortRange <String[]>]
    [-ExternalPortRange <String[]>]
    [-IpConfigurationId <String>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Update-AzVirtualNetworkGatewayNatRule cmdlet sets or updates a virtual network gateway nat rule.

Examples

Example 1:

$natRule1 = Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName "rg1" -Name "natRule1" -ParentResourceName "gw1"
Update-AzVirtualNetworkGatewayNatRule -InputObject $natRule1 -ExternalMapping @("30.0.0.0/16") -InternalMapping @("25.0.0.0/16") -IpConfigurationId "/subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/ipConfigurations/default"
Name              : natRule1
ProvisioningState : Succeeded
Type              : Static
Mode              : IngressSnat
InternalMappings  : [
                      {
                        "AddressSpace": "25.0.0.0/16"
                      }
                    ]
ExternalMappings  : [
                      {
                        "AddressSpace": "30.0.0.0/16"
                      }
                    ]
IpConfigurationId : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/ipConfigurations/default
Id                : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1
Etag              : W/"5150d788-e165-42ba-99c4-8138a545fce9"

Parameters

-AsJob

Run cmdlet in the background

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-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

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExternalMapping

The list of private IP address subnet external mappings for NAT

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ExternalPortRange

The list of external port range mappings for NAT subnets

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

The VirtualNetworkGatewayNatRule object to update.

Parameter properties

Type:PSVirtualNetworkGatewayNatRule
Default value:None
Supports wildcards:False
DontShow:False
Aliases:VirtualNetworkGatewayNatRule

Parameter sets

ByVirtualNetworkGatewayNatRuleObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-InternalMapping

The list of private IP address subnet internal mappings for NAT

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InternalPortRange

The list of internal port range mappings for NAT subnets

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IpConfigurationId

The IP Configuration ID this NAT rule applies to

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

The resource name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ResourceName, VirtualNetworkGatewayNatRuleName

Parameter sets

ByVirtualNetworkGatewayNatRuleName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ParentResourceName

The parent resource name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ParentVirtualNetworkGatewayName, VirtualNetworkGatewayName

Parameter sets

ByVirtualNetworkGatewayNatRuleName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The resource group name.

Parameter properties

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

Parameter sets

ByVirtualNetworkGatewayNatRuleName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceId

The resource id of the VirtualNetworkGatewayNatRule object to update.

Parameter properties

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

Parameter sets

ByVirtualNetworkGatewayNatRuleResourceId
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

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

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

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

String

PSVirtualNetworkGatewayNatRule

Outputs

PSVirtualNetworkGatewayNatRule