Get-AzVirtualNetworkGatewayNatRule
取得虛擬網路網關 NatRule。
語法
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 會根據 Name 和 ParentResourceName 傳回虛擬網路網關的虛擬網路閘道 nat 規則物件。
範例
範例 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"
範例 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"
參數
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Name
資源名稱。
類型: | String |
別名: | ResourceName, VirtualNetworkGatewayNatRuleName |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | True |
-ParentObject
此 VirtualNetworkGatewayNatRule 的父 VirtualNetworkGateway。
類型: | PSVirtualNetworkGateway |
別名: | ParentVirtualNetworkGateway, VirtualNetworkGateway |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ParentResourceId
此 VirtualNetworkGatewayNatRule 之父 VirtualNetworkGateway 的資源標識符。
類型: | String |
別名: | ParentVirtualNetworkGatewayId, VirtualNetworkGatewayId |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ParentResourceName
父資源名稱。
類型: | String |
別名: | ParentVirtualNetworkGatewayName, VirtualNetworkGatewayName |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGroupName
資源組名。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
輸入
輸出
PSVirtualNetworkGatewayNatRule