你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Get-AzVirtualNetworkGatewayNatRule

Gets a Virtual Network Gateway NatRule.

Syntax

Get-AzVirtualNetworkGatewayNatRule
   -ResourceGroupName <String>
   -ParentResourceName <String>
   [-Name <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzVirtualNetworkGatewayNatRule
   -ParentObject <PSVirtualNetworkGateway>
   [-Name <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Get-AzVirtualNetworkGatewayNatRule
   -ParentResourceId <String>
   [-Name <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Get-AzVirtualNetworkGatewayNatRule cmdlet returns a virtual network gateway nat rule object of your virtual network gateway based on Name and ParentResourceName.

Examples

Example 1

Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName "rg1" -Name "natRule1" -ParentResourceName gw1

Name              : natRule1
ProvisioningState : Succeeded
Type              : Static
Mode              : IngressSnat
InternalMappings  : [
                      {
                        "AddressSpace": "25.0.0.0/16"
                      }
                    ]
ExternalMappings  : [
                      {
                        "AddressSpace": "30.0.0.0/16"
                      }
                    ]
IpConfigurationId :
Id                : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1
Etag              : W/"5150d788-e165-42ba-99c4-8138a545fce9"

Example 2:

Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName "rg1" -ParentResourceName "gw1"

Name              : natRule1
ProvisioningState : Succeeded
Type              : Static
Mode              : IngressSnat
InternalMappings  : [
                      {
                        "AddressSpace": "25.0.0.0/16"
                      }
                    ]
ExternalMappings  : [
                      {
                        "AddressSpace": "30.0.0.0/16"
                      }
                    ]
IpConfigurationId :
Id                : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1
Etag              : W/"5150d788-e165-42ba-99c4-8138a545fce9"

Name              : natRule2
ProvisioningState : Succeeded
Type              : Static
Mode              : EgressSnat
InternalMappings  : [
                      {
                        "AddressSpace": "20.0.0.0/16"
                      }
                    ]
ExternalMappings  : [
                      {
                        "AddressSpace": "50.0.0.0/16"
                      }
                    ]
IpConfigurationId :
Id                : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule2
Etag              : W/"5150d788-e165-42ba-99c4-8138a545fce9"

Parameters

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The resource name.

Type:String
Aliases:ResourceName, VirtualNetworkGatewayNatRuleName
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:True

-ParentObject

The parent VirtualNetworkGateway for this VirtualNetworkGatewayNatRule.

Type:PSVirtualNetworkGateway
Aliases:ParentVirtualNetworkGateway, VirtualNetworkGateway
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ParentResourceId

The resource id of the parent VirtualNetworkGateway for this VirtualNetworkGatewayNatRule.

Type:String
Aliases:ParentVirtualNetworkGatewayId, VirtualNetworkGatewayId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ParentResourceName

The parent resource name.

Type:String
Aliases:ParentVirtualNetworkGatewayName, VirtualNetworkGatewayName
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The resource group name.

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

Inputs

PSVirtualNetworkGateway

String

Outputs

PSVirtualNetworkGatewayNatRule