次の方法で共有


Get-AzVpnGatewayNatRule

VpnGateway に関連付けられている NAT 規則を取得します。

構文

ByVpnGatewayName (既定)

Get-AzVpnGatewayNatRule
    -ResourceGroupName <String>
    -ParentResourceName <String>
    [-Name <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

ByVpnGatewayObject

Get-AzVpnGatewayNatRule
    -ParentObject <PSVpnGateway>
    [-Name <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

ByVpnGatewayResourceId

Get-AzVpnGatewayNatRule
    -ParentResourceId <String>
    [-Name <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

説明

VpnGateway に関連付けられている NAT 規則を取得します。

Example

New-AzResourceGroup -Location "West US" -Name "testRG"
$virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West US"
$virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
New-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -VirtualHubId $virtualHub.Id -VpnGatewayScaleUnit 2
$vpnGateway = Get-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw"
New-AzVpnGatewayNatRule -ResourceGroupName $vpnGateway.ResourceGroupName -ParentResourceName $vpnGateway.Name -Name "testNatRule" -Type Static -Mode EgressSnat -InternalMapping "10.0.0.1/26" -ExternalMapping "192.168.0.0/26"
Get-AzVpnGatewayNatRule -ResourceGroupName $vpnGateway.ResourceGroupName -ParentResourceName $vpnGateway.Name -Name "testNatRule"
Type             		  : Static
Mode                      : EgressSnat
VpnConnectionProtocolType : IKEv2
InternalMappings          : 10.0.0.1/26
ExternalMappings          : 192.168.0.0/26
IpConfigurationId   	  :
IngressVpnSiteLinkConnections : [Microsoft.Azure.Commands.Network.Models.PSResourceId]
EgressVpnSiteLinkConnections  : [Microsoft.Azure.Commands.Network.Models.PSResourceId]
ProvisioningState         : Provisioned
Name                      : ps9709
Etag                      : W/"4580a2e2-2fab-4cff-88eb-92013a76b5a8"
Id                        : /subscriptions/{subscriptionId}/resourceGroups/testRg/providers/Microsoft.Network/vpnGateways/testvpngw/natRules/testNatRule

上記では、リソース グループ、Virtual WAN、Virtual Network、Virtual Hub、VpnGateway、および Vpngateway に関連付けられた NAT 規則が作成されます。 次に、NAT 規則名を使用して NAT 規則を取得します。

パラメーター

-DefaultProfile

Azure との通信のために使用される資格情報、アカウント、テナント、サブスクリプションです。

パラメーターのプロパティ

型:IAzureContextContainer
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-Name

リソース名。

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:True
DontShow:False
Aliases:ResourceName, VpnGatewayNatRuleName

パラメーター セット

(All)
配置:Named
必須:False
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ParentObject

この VpnGatewayNatRule の親 VpnGateway。

パラメーターのプロパティ

型:PSVpnGateway
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:ParentVpnGateway, VpnGateway

パラメーター セット

ByVpnGatewayObject
配置:Named
必須:True
パイプラインからの値:True
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ParentResourceId

この VpnGatewayNatRule の親 VpnGateway のリソース ID。

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:ParentVpnGatewayId, VpnGatewayId

パラメーター セット

ByVpnGatewayResourceId
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:True
残りの引数からの値:False

-ParentResourceName

親リソース名。

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False
Aliases:ParentVpnGatewayName, VpnGatewayName

パラメーター セット

ByVpnGatewayName
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

-ResourceGroupName

リソース グループ名。

パラメーターのプロパティ

型:String
規定値:None
ワイルドカードのサポート:False
DontShow:False

パラメーター セット

ByVpnGatewayName
配置:Named
必須:True
パイプラインからの値:False
プロパティ名別のパイプラインからの値:False
残りの引数からの値:False

CommonParameters

このコマンドレットでは、一般的なパラメーター -Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction、-WarningVariable の各パラメーターがサポートされています。 詳細については、about_CommonParametersを参照してください。

入力

PSVpnGateway

String

出力

PSVpnGatewayNatRule