Skip to content

Commit 597e261

Browse files
author
Khushboo Baheti
committed
helpFiles
1 parent 80636ea commit 597e261

8 files changed

+1295
-104
lines changed
Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
---
2+
external help file: Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml
3+
Module Name: Az.Network
4+
online version: https://docs.microsoft.com/powershell/module/az.network/get-azvirtualnetworkgatewaynatrule
5+
schema: 2.0.0
6+
---
7+
8+
# Get-AzVirtualNetworkGatewayNatRule
9+
10+
## SYNOPSIS
11+
Gets a Virtual Network Gateway NatRule.
12+
13+
## SYNTAX
14+
15+
### ByVirtualNetworkGatewayName (Default)
16+
```
17+
Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName <String> -ParentResourceName <String> [-Name <String>]
18+
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
19+
```
20+
21+
### ByVirtualNetworkGatewayObject
22+
```
23+
Get-AzVirtualNetworkGatewayNatRule -ParentObject <PSVirtualNetworkGateway> [-Name <String>]
24+
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
25+
```
26+
27+
### ByVirtualNetworkGatewayResourceId
28+
```
29+
Get-AzVirtualNetworkGatewayNatRule -ParentResourceId <String> [-Name <String>]
30+
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
31+
```
32+
33+
## DESCRIPTION
34+
**Get-AzVirtualNetworkGatewayNatRule** cmdlet returns a virtual network gateway nat rule object of your virtual network gateway based on Name and ParentResourceName.
35+
36+
## EXAMPLES
37+
38+
### Example 1
39+
```powershell
40+
PS C:\Users> get-azVirtualNetworkGatewayNatRule -ResourceGroupName "rg1" -Name "natRule1" -ParentResourceName gw1
41+
42+
Name : natRule1
43+
ProvisioningState : Succeeded
44+
Type : Static
45+
Mode : IngressSnat
46+
InternalMappings : [
47+
{
48+
"AddressSpace": "25.0.0.0/16"
49+
}
50+
]
51+
ExternalMappings : [
52+
{
53+
"AddressSpace": "30.0.0.0/16"
54+
}
55+
]
56+
IpConfigurationId :
57+
Id : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1
58+
Etag : W/"5150d788-e165-42ba-99c4-8138a545fce9"
59+
```
60+
61+
### Example 2:
62+
```powershell
63+
PS C:\Users\khbaheti> get-azVirtualNetworkGatewayNatRule -ResourceGroupName "rg1" -ParentResourceName "gw1"
64+
65+
Name : natRule1
66+
ProvisioningState : Succeeded
67+
Type : Static
68+
Mode : IngressSnat
69+
InternalMappings : [
70+
{
71+
"AddressSpace": "25.0.0.0/16"
72+
}
73+
]
74+
ExternalMappings : [
75+
{
76+
"AddressSpace": "30.0.0.0/16"
77+
}
78+
]
79+
IpConfigurationId :
80+
Id : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1
81+
Etag : W/"5150d788-e165-42ba-99c4-8138a545fce9"
82+
83+
Name : natRule2
84+
ProvisioningState : Succeeded
85+
Type : Static
86+
Mode : EgressSnat
87+
InternalMappings : [
88+
{
89+
"AddressSpace": "20.0.0.0/16"
90+
}
91+
]
92+
ExternalMappings : [
93+
{
94+
"AddressSpace": "50.0.0.0/16"
95+
}
96+
]
97+
IpConfigurationId :
98+
Id : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule2
99+
Etag : W/"5150d788-e165-42ba-99c4-8138a545fce9"
100+
```
101+
102+
103+
## PARAMETERS
104+
105+
### -DefaultProfile
106+
The credentials, account, tenant, and subscription used for communication with Azure.
107+
108+
```yaml
109+
Type: IAzureContextContainer
110+
Parameter Sets: (All)
111+
Aliases: AzContext, AzureRmContext, AzureCredential
112+
113+
Required: False
114+
Position: Named
115+
Default value: None
116+
Accept pipeline input: False
117+
Accept wildcard characters: False
118+
```
119+
120+
### -Name
121+
The resource name.
122+
123+
```yaml
124+
Type: String
125+
Parameter Sets: (All)
126+
Aliases: ResourceName, VirtualNetworkGatewayNatRuleName
127+
128+
Required: False
129+
Position: Named
130+
Default value: None
131+
Accept pipeline input: False
132+
Accept wildcard characters: False
133+
```
134+
135+
### -ParentObject
136+
The parent VirtualNetworkGateway for this VirtualNetworkGatewayNatRule.
137+
138+
```yaml
139+
Type: PSVirtualNetworkGateway
140+
Parameter Sets: ByVirtualNetworkGatewayObject
141+
Aliases: ParentVirtualNetworkGateway, VirtualNetworkGateway
142+
143+
Required: True
144+
Position: Named
145+
Default value: None
146+
Accept pipeline input: True (ByValue)
147+
Accept wildcard characters: False
148+
```
149+
150+
### -ParentResourceId
151+
The resource id of the parent VirtualNetworkGateway for this VirtualNetworkGatewayNatRule.
152+
153+
```yaml
154+
Type: String
155+
Parameter Sets: ByVirtualNetworkGatewayResourceId
156+
Aliases: ParentVirtualNetworkGatewayId, VirtualNetworkGatewayId
157+
158+
Required: True
159+
Position: Named
160+
Default value: None
161+
Accept pipeline input: True (ByPropertyName)
162+
Accept wildcard characters: False
163+
```
164+
165+
### -ParentResourceName
166+
The parent resource name.
167+
168+
```yaml
169+
Type: String
170+
Parameter Sets: ByVirtualNetworkGatewayName
171+
Aliases: ParentVirtualNetworkGatewayName, VirtualNetworkGatewayName
172+
173+
Required: True
174+
Position: Named
175+
Default value: None
176+
Accept pipeline input: False
177+
Accept wildcard characters: False
178+
```
179+
180+
### -ResourceGroupName
181+
The resource group name.
182+
183+
```yaml
184+
Type: String
185+
Parameter Sets: ByVirtualNetworkGatewayName
186+
Aliases:
187+
188+
Required: True
189+
Position: Named
190+
Default value: None
191+
Accept pipeline input: False
192+
Accept wildcard characters: False
193+
```
194+
195+
### CommonParameters
196+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
197+
198+
## INPUTS
199+
200+
### Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway
201+
202+
### System.String
203+
204+
## OUTPUTS
205+
206+
### Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGatewayNatRule
207+
208+
## NOTES
209+
210+
## RELATED LINKS
211+
212+
[New-AzVirtualNetworkGatewayNatRule](./New-AzVirtualNetworkGatewayNatRule.md)
213+
214+
[Remove-AzVirtualNetworkGatewayNatRule](./Remove-AzVirtualNetworkGatewayNatRule.md)
215+
216+
[Update-AzVirtualNetworkGatewayNatRule](./Update-AzVirtualNetworkGatewayNatRule.md)

src/Network/Network/help/New-AzVirtualNetworkGateway.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,12 @@ New-AzVirtualNetworkGateway -Name <String> -ResourceGroupName <String> -Location
2222
[-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
2323
[-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>] [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
2424
[-Asn <UInt32>] [-PeerWeight <Int32>]
25-
[-IpConfigurationBgpPeeringAddresses <PSIpConfigurationBgpPeeringAddress[]>] [-Tag <Hashtable>] [-Force]
26-
[-RadiusServerAddress <String>] [-RadiusServerSecret <SecureString>] [-RadiusServerList <PSRadiusServer[]>]
27-
[-AadTenantUri <String>] [-AadAudienceId <String>] [-AadIssuerUri <String>] [-CustomRoute <String[]>]
28-
[-VpnGatewayGeneration <String>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
29-
[<CommonParameters>]
25+
[-IpConfigurationBgpPeeringAddresses <PSIpConfigurationBgpPeeringAddress[]>]
26+
[-NatRule <PSVirtualNetworkGatewayNatRule[]>] [-EnableBgpRouteTranslationForNatFlag] [-Tag <Hashtable>]
27+
[-Force] [-RadiusServerAddress <String>] [-RadiusServerSecret <SecureString>]
28+
[-RadiusServerList <PSRadiusServer[]>] [-AadTenantUri <String>] [-AadAudienceId <String>]
29+
[-AadIssuerUri <String>] [-CustomRoute <String[]>] [-VpnGatewayGeneration <String>] [-AsJob]
30+
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
3031
```
3132

3233
## DESCRIPTION
@@ -159,6 +160,28 @@ The gateway will be called "gateway1" within the resource group "resourcegroup1r
159160
with the previously created IP configurations Bgppeering address saved in the variable "gw1ipconfBgp1," the
160161
gateway type of "VPN", the vpn type "RouteBased", the sku "VpnGw4" and VpnGatewayGeneration Generation2 enabled.
161162

163+
### Example 6: Create a Virtual Network Gateway with NatRules
164+
```powershell
165+
New-AzResourceGroup -Location "UK West" -Name "resourcegroup1"
166+
$subnet = New-AzVirtualNetworkSubnetConfig -Name 'gatewaysubnet' -AddressPrefix '10.254.0.0/27'
167+
168+
$ngwpip = New-AzPublicIpAddress -Name ngwpip -ResourceGroupName "resourcegroup1" -Location "UK West" -AllocationMethod Dynamic
169+
$vnet = New-AzVirtualNetwork -AddressPrefix "10.254.0.0/27" -Location "UK West" -Name vnet-gateway -ResourceGroupName "resourcegroup1" -Subnet $subnet
170+
$subnet = Get-AzVirtualNetworkSubnetConfig -name 'gatewaysubnet' -VirtualNetwork $vnet
171+
$ngwipconfig = New-AzVirtualNetworkGatewayIpConfig -Name ipconfig1 -SubnetId $subnet.Id -PublicIpAddressId $ngwpip.Id
172+
173+
$natRule = New-AzVirtualNetworkGatewayNatRule -Name "natRule1" -Type "Static" -Mode "IngressSnat" -InternalMapping @("25.0.0.0/16") -ExternalMapping @("30.0.0.0/16")
174+
175+
New-AzVirtualNetworkGateway -Name gateway1 -ResourceGroupName vnet-gateway -Location "UK West" -IpConfigurations $ngwIpConfig -GatewayType "Vpn" -VpnType "RouteBased" -GatewaySku "VpnGw4" -VpnGatewayGeneration "Generation2" -NatRule $natRule -EnableBgpRouteTranslationForNatFlag
176+
```
177+
178+
The above will create a resource group, request a Public IP Address, create a Virtual Network and
179+
subnet and create a Virtual Network Gateway in Azure.
180+
ipconfigurationId1 of gateway ipconfiguration just created and stored in ngwipconfig.
181+
The gateway will be called "gateway1" within the resource group "resourcegroup1resourcegroup1" in the location "UK West"
182+
New virtualNetworkGateway NatRule will be saved in the variable "natRule"
183+
the gateway type of "VPN", the vpn type "RouteBased", the sku "VpnGw4" and VpnGatewayGeneration Generation2 enabled and BgpRouteTranslationForNat enabled.
184+
162185
## PARAMETERS
163186

164187
### -AadAudienceId
@@ -296,6 +319,21 @@ Accept pipeline input: True (ByPropertyName)
296319
Accept wildcard characters: False
297320
```
298321
322+
### -EnableBgpRouteTranslationForNatFlag
323+
Flag to enable BgpRouteTranslationForNat on this VirtualNetworkGateway.
324+
325+
```yaml
326+
Type: System.Management.Automation.SwitchParameter
327+
Parameter Sets: (All)
328+
Aliases:
329+
330+
Required: False
331+
Position: Named
332+
Default value: None
333+
Accept pipeline input: False
334+
Accept wildcard characters: False
335+
```
336+
299337
### -EnablePrivateIpAddress
300338
Flag to enable private IPAddress on virtual network gateway
301339
@@ -433,6 +471,21 @@ Accept pipeline input: True (ByPropertyName)
433471
Accept wildcard characters: False
434472
```
435473
474+
### -NatRule
475+
The NatRules for Virtual network gateway.
476+
477+
```yaml
478+
Type: Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGatewayNatRule[]
479+
Parameter Sets: (All)
480+
Aliases:
481+
482+
Required: False
483+
Position: Named
484+
Default value: None
485+
Accept pipeline input: True (ByPropertyName)
486+
Accept wildcard characters: False
487+
```
488+
436489
### -PeerWeight
437490
The weight added to routes learned over BGP from this virtual network gateway
438491
@@ -530,6 +583,7 @@ The list of P2S VPN client authentication types.
530583
Type: System.String[]
531584
Parameter Sets: (All)
532585
Aliases:
586+
Accepted values: Certificate, Radius, AAD
533587

534588
Required: False
535589
Position: Named
@@ -704,10 +758,14 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
704758
705759
### Microsoft.Azure.Commands.Network.Models.PSIpConfigurationBgpPeeringAddress[]
706760
761+
### Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGatewayNatRule[]
762+
707763
### System.Collections.Hashtable
708764
709765
### System.Security.SecureString
710766
767+
### Microsoft.Azure.Commands.Network.Models.PSRadiusServer[]
768+
711769
## OUTPUTS
712770
713771
### Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway

0 commit comments

Comments
 (0)