Delen via


Set-AzVirtualNetworkGateway

Hiermee wordt een virtuele netwerkgateway bijgewerkt.

Syntaxis

Set-AzVirtualNetworkGateway
   -VirtualNetworkGateway <PSVirtualNetworkGateway>
   [-GatewaySku <String>]
   [-GatewayDefaultSite <PSLocalNetworkGateway>]
   [-VpnClientAddressPool <String[]>]
   [-VpnClientProtocol <String[]>]
   [-VpnAuthenticationType <String[]>]
   [-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
   [-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>]
   [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
   [-Asn <UInt32>]
   [-PeerWeight <Int32>]
   [-MinScaleUnit <Int32>]
   [-MaxScaleUnit <Int32>]
   [-IpConfigurationBgpPeeringAddresses <PSIpConfigurationBgpPeeringAddress[]>]
   [-EnableActiveActiveFeature]
   [-EnablePrivateIpAddress <Boolean>]
   [-DisableActiveActiveFeature]
   [-RadiusServerAddress <String>]
   [-RadiusServerSecret <SecureString>]
   [-RadiusServerList <PSRadiusServer[]>]
   [-AadTenantUri <String>]
   [-AadAudienceId <String>]
   [-AadIssuerUri <String>]
   [-RemoveAadAuthentication]
   [-CustomRoute <String[]>]
   [-NatRule <PSVirtualNetworkGatewayNatRule[]>]
   [-BgpRouteTranslationForNat <Boolean>]
   [-VirtualNetworkGatewayPolicyGroup <PSVirtualNetworkGatewayPolicyGroup[]>]
   [-ClientConnectionConfiguration <PSClientConnectionConfiguration[]>]
   [-AdminState <String>]
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Set-AzVirtualNetworkGateway
   -VirtualNetworkGateway <PSVirtualNetworkGateway>
   [-GatewaySku <String>]
   [-GatewayDefaultSite <PSLocalNetworkGateway>]
   [-VpnClientAddressPool <String[]>]
   [-VpnClientProtocol <String[]>]
   [-VpnAuthenticationType <String[]>]
   [-VpnClientRootCertificates <PSVpnClientRootCertificate[]>]
   [-VpnClientRevokedCertificates <PSVpnClientRevokedCertificate[]>]
   [-VpnClientIpsecPolicy <PSIpsecPolicy[]>]
   [-Asn <UInt32>]
   [-PeerWeight <Int32>]
   [-IpConfigurationBgpPeeringAddresses <PSIpConfigurationBgpPeeringAddress[]>]
   [-EnableActiveActiveFeature]
   [-EnablePrivateIpAddress <Boolean>]
   [-DisableActiveActiveFeature]
   [-RadiusServerAddress <String>]
   [-RadiusServerSecret <SecureString>]
   [-RadiusServerList <PSRadiusServer[]>]
   [-AadTenantUri <String>]
   [-AadAudienceId <String>]
   [-AadIssuerUri <String>]
   [-RemoveAadAuthentication]
   [-CustomRoute <String[]>]
   [-NatRule <PSVirtualNetworkGatewayNatRule[]>]
   [-BgpRouteTranslationForNat <Boolean>]
   [-VirtualNetworkGatewayPolicyGroup <PSVirtualNetworkGatewayPolicyGroup[]>]
   [-ClientConnectionConfiguration <PSClientConnectionConfiguration[]>]
   -Tag <Hashtable>
   [-AsJob]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Met de cmdlet Set-AzVirtualNetworkGateway wordt een virtuele netwerkgateway bijgewerkt.

Voorbeelden

Voorbeeld 1: DE ASN van een virtuele netwerkgateway bijwerken

$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -Asn 1337

Met de eerste opdracht wordt een virtuele netwerkgateway met de naam Gateway01 opgehaald die deel uitmaakt van resourcegroep ResourceGroup001 en opgeslagen in de variabele $Gateway Met de tweede opdracht wordt de virtuele netwerkgateway bijgewerkt die is opgeslagen in variabele $Gateway. Met de opdracht wordt ook de ASN ingesteld op 1337.

Voorbeeld 2: IPsec-beleid toevoegen aan een gateway van een virtueel netwerk

$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
$vpnclientipsecpolicy = New-AzVpnClientIpsecPolicy -IpsecEncryption AES256 -IpsecIntegrity SHA256 -SALifeTime 86472 -SADataSize 429497 -IkeEncryption AES256 -IkeIntegrity SHA256 -DhGroup DHGroup2 -PfsGroup None
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientIpsecPolicy $vpnclientipsecpolicy

Met de eerste opdracht wordt een virtuele netwerkgateway met de naam Gateway01 opgehaald die deel uitmaakt van resourcegroep ResourceGroup001 en opgeslagen in de variabele met de naam $Gateway Met de tweede opdracht wordt het Vpn ipsec-beleidsobject gemaakt volgens de opgegeven ipsec-parameters. Met de derde opdracht wordt de gateway van het virtuele netwerk bijgewerkt die is opgeslagen in variabele $Gateway. Met de opdracht wordt ook het aangepaste ipsec-beleid voor vpn ingesteld dat is opgegeven in het $vpnclientipsecpolicy-object op de gateway van het virtuele netwerk.

Voorbeeld 3: Tags toevoegen/bijwerken aan een bestaande virtuele netwerkgateway

$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -Tag @{ testtagKey="SomeTagKey"; testtagValue="SomeKeyValue" }

Name                   : Gateway001
ResourceGroupName      : ResourceGroup001
Location               : westus
Id                     : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag                   : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid           : 00000000-0000-0000-0000-000000000000
ProvisioningState      : Succeeded
Tags                   :
                         Name          Value
                         ============  ============
                         testtagValue  SomeKeyValue
                         testtagKey    SomeTagKey

IpConfigurations       : [
                           {
                             "PrivateIpAllocationMethod": "Dynamic",
                             "Subnet": {
                               "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/GatewaySubnet"
                             },
                             "PublicIpAddress": {
                               "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/Gateway001Ip"
                             },
                             "Name": "vng1ipConfig",
                             "Etag": "W/\"00000000-0000-0000-0000-000000000000\"",
                             "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/Gateway001IpConfig"
                           }
                         ]
GatewayType            : Vpn
VpnType                : RouteBased
EnableBgp              : False
ActiveActive           : False
GatewayDefaultSite     : null
Sku                    : {
                           "Capacity": 2,
                           "Name": "VpnGw1",
                           "Tier": "VpnGw1"
                         }
VpnClientConfiguration : null
BgpSettings            : {
                           "Asn": 65515,
                           "BgpPeeringAddress": "1.2.3.4",
                           "PeerWeight": 0
                         }

Met de eerste opdracht wordt een virtuele netwerkgateway met de naam Gateway01 opgehaald die deel uitmaakt van resourcegroep ResourceGroup001 en opgeslagen in de variabele met de naam $Gateway Met de tweede opdracht wordt de gateway van het virtuele netwerk bijgewerkt met de tags @{ testtagKey="SomeTagKey"; testtagValue="SomeKeyValue" }.

Voorbeeld 4: AAD-verificatieconfiguratie toevoegen/bijwerken voor VpnClient van een bestaande virtuele netwerkgateway

$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -AadTenantUri "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4" -AadIssuerUri "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/" -AadAudienceId "a21fce82-76af-45e6-8583-a08cb3b956f9"

Name                   : Gateway001
ResourceGroupName      : ResourceGroup001
Location               : westus
Id                     : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag                   : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid           : 00000000-0000-0000-0000-000000000000
ProvisioningState      : Succeeded
Tags                   :
                         Name          Value
                         ============  ============
                         testtagValue  SomeKeyValue
                         testtagKey    SomeTagKey

IpConfigurations       : [
                           {
                             "PrivateIpAllocationMethod": "Dynamic",
                             "Subnet": {
                               "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/MyVnet/subnets/GatewaySubnet"
                             },
                             "PublicIpAddress": {
                               "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/Gateway001Ip"
                             },
                             "Name": "vng1ipConfig",
                             "Etag": "W/\"00000000-0000-0000-0000-000000000000\"",
                             "Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/Gateway001IpConfig"
                           }
                         ]
GatewayType            : Vpn
VpnType                : RouteBased
EnableBgp              : False
ActiveActive           : False
GatewayDefaultSite     : null
Sku                    : {
                           "Capacity": 2,
                           "Name": "VpnGw1",
                           "Tier": "VpnGw1"
                         }
vpnClientConfiguration : {
                    "vpnClientProtocols": [
					"OpenVPN"
					],

                    "vpnClientAddressPool": {
                    "addressPrefixes": [
                        "101.10.0.0/16"
                    ]
                	},
					"vpnClientRootCertificates": "",
                    "vpnClientRevokedCertificates": "",

                    "radiusServerAddress": "",
                    "radiusServerSecret": "",
					"aadTenantUri": "https://login.microsoftonline.com/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4\",
					"aadAudienceId": "a21fce82-76af-45e6-8583-a08cb3b956g9\",
					"aadIssuerUri": "https://sts.windows.net/0ab2c4f4-81e6-44cc-a0b2-b3a47a1443f4/\"
                },
BgpSettings            : {
                           "Asn": 65515,
                           "BgpPeeringAddress": "1.2.3.4",
                           "PeerWeight": 0
                         }
						 
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientRootCertificates $rootCert -RemoveAadAuthentication

Met de eerste opdracht wordt een virtuele netwerkgateway met de naam Gateway01 opgehaald die deel uitmaakt van resourcegroep ResourceGroup001 en opgeslagen in de variabele met de naam $Gateway Met de tweede opdracht wordt de gateway gateway van het virtuele netwerk bijgewerkt met de AAD-verificatieconfiguraties params:aadTenantUri, aadAudienceId, aadIssuerUri voor VpnClient. Met de derde opdracht wordt de AAD-verificatieconfiguratie verwijderd uit VpnClient van de virtuele netwerkgateway.

Voorbeeld 5: IpConfigurationBgpPeeringAddresses toevoegen/bijwerken naar een bestaande virtuele netwerkgateway

$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
$ipconfigurationId1 = '/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default'
$addresslist1 = @('169.254.21.25')
$gw1ipconfBgp1 = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId1 -CustomAddress $addresslist1
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -IpConfigurationBgpPeeringAddresses $gw1ipconfBgp1

Name                   : Gateway001
ResourceGroupName      : ResourceGroup001
Location               : westcentralus
Id                     : /subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag                   : W/"a08f13d3-6106-44e0-9127-e35e6f9793d5"
ResourceGuid           : 30993429-a1ed-42ca-9862-9156b013626e
ProvisioningState      : Succeeded
Tags                   :
IpConfigurations       : [
                           {
                             "PrivateIpAllocationMethod": "Dynamic",
                             "Subnet": {
                               "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/newApipaNet/subnets/GatewaySubnet"
                             },
                             "PublicIpAddress": {
                               "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/newapipaip"
                             },
                             "Name": "default",
                             "Etag": "W/\"a08f13d3-6106-44e0-9127-e35e6f9793d5\"",
                             "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default"
                           }
                         ]
GatewayType            : Vpn
VpnType                : RouteBased
EnableBgp              : False
ActiveActive           : False
GatewayDefaultSite     : null
Sku                    : {
                           "Capacity": 2,
                           "Name": "VpnGw1",
                           "Tier": "VpnGw1"
                         }
VpnClientConfiguration : null
BgpSettings            : {
                           "Asn": 65515,
                           "BgpPeeringAddress": "10.1.255.30",
                           "PeerWeight": 0,
                           "BgpPeeringAddresses": [
                             {
                               "IpconfigurationId": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default",
                               "DefaultBgpIpAddresses": [
                                 "10.1.255.30"
                               ],
                               "CustomBgpIpAddresses": [
                                 "169.254.21.55"
                               ],
                               "TunnelIpAddresses": [
                                 "13.78.146.151"
                               ]
                             }
                           ]
                         }

Met de eerste opdracht wordt een virtuele netwerkgateway met de naam Gateway01 opgehaald die deel uitmaakt van resourcegroep ResourceGroup001 en opgeslagen in de variabele met de naam $Gateway Met de tweede opdracht wordt de waarde van de gateway van de virtuele netwerkgateway Gateway01 IpConfiguration Id toegewezen aan variabele ipconfigurationId1. Met de derde opdracht wordt de adreslijst toegewezen aan adreslijst1. Met de vierde opdracht is een PSIpConfigurationBgpPeeringAddress-object gemaakt. Met de vijfde opdracht stelt u dit nieuwe gemaakte PSIpConfigurationBgpPeeringAddress in op IpConfigurationBgpPeeringAddresses en werkt u de gateway bij.

Voorbeeld 6: CustomAddress bijwerken/verwijderen naar een bestaande IpConfigurationBgpPeeringAddresses van virtuele netwerkgateway

$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
$ipconfigurationId1 = '/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default'
$addresslist1 = @()
$gw1ipconfBgp1 = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId1 -CustomAddress $addresslist1
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -IpConfigurationBgpPeeringAddresses $gw1ipconfBgp1

Name                   : Gateway001
ResourceGroupName      : ResourceGroup001
Location               : westcentralus
Id                     : /subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag                   : W/"a08f13d3-6106-44e0-9127-e35e6f9793d5"
ResourceGuid           : 30993429-a1ed-42ca-9862-9156b013626e
ProvisioningState      : Succeeded
Tags                   :
IpConfigurations       : [
                           {
                             "PrivateIpAllocationMethod": "Dynamic",
                             "Subnet": {
                               "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/newApipaNet/subnets/GatewaySubnet"
                             },
                             "PublicIpAddress": {
                               "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/newapipaip"
                             },
                             "Name": "default",
                             "Etag": "W/\"a08f13d3-6106-44e0-9127-e35e6f9793d5\"",
                             "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default"
                           }
                         ]
GatewayType            : Vpn
VpnType                : RouteBased
EnableBgp              : False
ActiveActive           : False
GatewayDefaultSite     : null
Sku                    : {
                           "Capacity": 2,
                           "Name": "VpnGw1",
                           "Tier": "VpnGw1"
                         }
VpnClientConfiguration : null
BgpSettings            : {
                           "Asn": 65515,
                           "BgpPeeringAddress": "10.1.255.30",
                           "PeerWeight": 0,
                           "BgpPeeringAddresses": [
                             {
                               "IpconfigurationId": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default",
                               "DefaultBgpIpAddresses": [
                                 "10.1.255.30"
                               ],
                               "CustomBgpIpAddresses": [],
                               "TunnelIpAddresses": [
                                 "13.78.146.151"
                               ]
                             }
                           ]
                         }

Met de eerste opdracht wordt een virtuele netwerkgateway met de naam Gateway01 opgehaald die deel uitmaakt van resourcegroep ResourceGroup001 en opgeslagen in de variabele met de naam $Gateway Met de tweede opdracht wordt de waarde van de gateway van de virtuele netwerkgateway Gateway01 IpConfiguration Id toegewezen aan variabele ipconfigurationId1. Met de derde opdracht wordt de adreslijst toegewezen aan adreslijst1. Met de vierde opdracht is een PSIpConfigurationBgpPeeringAddress-object gemaakt. Met de vijfde opdracht stelt u dit nieuwe gemaakte PSIpConfigurationBgpPeeringAddress in op IpConfigurationBgpPeeringAddresses en werkt u de gateway bij.

Voorbeeld 7: NatRules toevoegen/bijwerken aan een bestaande virtuele netwerkgateway

$Gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"
$vngNatRules = $Gateway.NatRules
$natRule = New-AzVirtualNetworkGatewayNatRule -Name "natRule1" -Type "Static" -Mode "IngressSnat" -InternalMapping @("25.0.0.0/16") -ExternalMapping @("30.0.0.0/16")
$vngNatRules.Add($natrule)
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -NatRule $vngNatRules.NatRules -BgpRouteTranslationForNat $true

Name                   : Gateway001
ResourceGroupName      : ResourceGroup001
Location               : westcentralus
Id                     : /subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001
Etag                   : W/"a08f13d3-6106-44e0-9127-e35e6f9793d5"
ResourceGuid           : 30993429-a1ed-42ca-9862-9156b013626e
ProvisioningState      : Succeeded
Tags                   :
IpConfigurations       : [
                           {
                             "PrivateIpAllocationMethod": "Dynamic",
                             "Subnet": {
                               "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworks/newApipaNet/subnets/GatewaySubnet"
                             },
                             "PublicIpAddress": {
                               "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/publicIPAddresses/newapipaip"
                             },
                             "Name": "default",
                             "Etag": "W/\"a08f13d3-6106-44e0-9127-e35e6f9793d5\"",
                             "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default"
                           }
                         ]
GatewayType            : Vpn
VpnType                : RouteBased
EnableBgp              : False
ActiveActive           : False
GatewayDefaultSite     : null
Sku                    : {
                           "Capacity": 2,
                           "Name": "VpnGw1",
                           "Tier": "VpnGw1"
                         }
VpnClientConfiguration : null
BgpSettings            : {
                           "Asn": 65515,
                           "BgpPeeringAddress": "10.1.255.30",
                           "PeerWeight": 0,
                           "BgpPeeringAddresses": [
                             {
                               "IpconfigurationId": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/ipConfigurations/default",
                               "DefaultBgpIpAddresses": [
                                 "10.1.255.30"
                               ],
                               "CustomBgpIpAddresses": [
                                 "169.254.21.55"
                               ],
                               "TunnelIpAddresses": [
                                 "13.78.146.151"
                               ]
                             }
                           ]
                         }
NatRules                        : [
                                    {
                                      "VirtualNetworkGatewayNatRulePropertiesType": "Static",
                                      "Mode": "IngressSnat",
                                      "InternalMappings": [
                                        {
                                          "AddressSpace": "25.0.0.0/16"
                                        }
                                      ],
                                      "ExternalMappings": [
                                        {
                                          "AddressSpace": "30.0.0.0/16"
                                        }
                                      ],
                                      "ProvisioningState": "Succeeded",
                                      "Name": "natRule1",
                                      "Etag": "W/\"5150d788-e165-42ba-99c4-8138a545fce9\"",
                                      "Id": "/subscriptions/59ac12a6-f2b7-46d4-af3d-98ba9d9dbd92/resourceGroups/ResourceGroup001/providers/Microsoft.Network/virtualNetworkGateways/Gateway001/natRules/natRule1"
                                    }
                                  ]
EnableBgpRouteTranslationForNat : True

De eerste opdracht haalt een virtuele netwerkgateway op met de naam Gateway01 die deel uitmaakt van resourcegroep ResourceGroup001 en slaat deze op in de variabele met de naam $Gateway Met de tweede opdracht worden de bestaande natrules toegewezen aan variabele vngNatRules. Met de derde opdracht wordt de waarde toegewezen die nieuw is gemaakt psVirtualNetworkGatewayNatRule-object natrule in variabele natRule. Met de vierde opdracht voegt u dit PSVirtualNetworkGatewayNatRule-object toe aan de vngNatRules-lijst. Met de vijfde opdracht stelt u deze nieuwe psVirtualNetworkGatewayNatRule in op NatRules van de gateway en werkt u de gateway bij.

Voorbeeld 8: Meerdere verlopen VpnClientRootCertificates van een bestaande virtuele netwerkgateway verwijderen

$Gateway=Get-AzVirtualNetworkGateway -ResourceGroupName "ResourceGroup001" -Name "Gateway001"

$rootCerts=$Gateway.VpnClientConfiguration.VpnClientRootCertificates

$rootCerts.Count
$rootCerts[0]
$rootCerts[1]
$rootCerts.Remove($rootCerts[1])

$Gateway1 = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $Gateway -VpnClientRootCertificates $rootCerts

Met de eerste opdracht wordt een virtuele netwerkgateway met de naam Gateway01 die deel uitmaakt van resourcegroep ResourceGroup001, opgeslagen in de variabele met de naam $Gateway Met de tweede opdracht worden alle basiscertificaten op VirtualNetworkGateway opgeslagen en opgeslagen in een andere variabele $rootCerts De derde opdracht toont het totale aantal bestaande basiscertificaten op VirtualNetworkGateway. Met de volgende & vijfde opdrachten worden basiscertificaten afgedrukt op de bijbehorende indexen voor de klant om te zien welke ze willen verwijderen. Met de zesde opdracht wordt verlopen basiscertificaat verwijderd met behulp van die index, bijvoorbeeld hier 1. Herhaal dezelfde stappen om meerdere verlopen certificaten uit de variabele te verwijderen: $rootCerts Met de zevende opdracht wordt VirtualNetworkGateway bijgewerkt om geldige basiscertificaten in te stellen, d.w.w.v. certificaten die in variabele bestaan: $rootCerts

Voorbeeld 9: Configureer een virtuele ExpressRoute-netwerkgateway om communicatie via ExpressRoute mogelijk te maken met andere virtuele ExpressRoute-netwerkgateways in Virtual Wan-netwerken.

# Option 1 - Retrieve the gateway object, modify the property and save the changes.  
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowVirtualWanTraffic = $true
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway

# Option 2 - Use the cmdlet switch
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -AllowVirtualWanTraffic $true

In beide gevallen haalt de eerste opdracht de gateway op. Vervolgens kunt u de eigenschap rechtstreeks op het object wijzigen en behouden, of u kunt de schakeloptie gebruiken voor de cmdlet Set-AzVirtualNetworkGateway.

Voorbeeld 10: Een virtuele ExpressRoute-netwerkgateway configureren om communicatie via ExpressRoute te blokkeren met andere virtuele ExpressRoute-netwerkgateways in Virtual Wan-netwerken.

# Option 1 - Retrieve the gateway object, modify the property and save the changes.  
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowVirtualWanTraffic = $false
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway

# Option 2 - Use the cmdlet switch
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -AllowVirtualWanTraffic $false

In beide gevallen haalt de eerste opdracht de gateway op. Vervolgens kunt u de eigenschap rechtstreeks op het object wijzigen en behouden, of u kunt de schakeloptie gebruiken voor de cmdlet Set-AzVirtualNetworkGateway.

Voorbeeld 11: Configureer een virtuele ExpressRoute-netwerkgateway om communicatie via ExpressRoute met andere virtuele ExpressRoute-netwerkgateways in andere VNets toe te staan.

# Option 1 - Retrieve the gateway object, modify the property and save the changes.  
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowRemoteVnetTraffic = $true
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway

# Option 2 - Use the cmdlet switch
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -AllowRemoteVnetTraffic $true

In beide gevallen haalt de eerste opdracht de gateway op. Vervolgens kunt u de eigenschap rechtstreeks op het object wijzigen en behouden, of u kunt de schakeloptie gebruiken voor de cmdlet Set-AzVirtualNetworkGateway.

Voorbeeld 12: Configureer een virtuele ExpressRoute-netwerkgateway om communicatie via ExpressRoute te blokkeren met andere virtuele netwerkgateways in andere VNets.

# Option 1 - Retrieve the gateway object, modify the property and save the changes.  
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
$gateway.AllowRemoteVnetTraffic = $false
$gateway = Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway

# Option 2 - Use the cmdlet switch
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName "resourceGroup001" -Name "gateway001"
Set-AzVirtualNetworkGateway -VirtualNetworkGateway $gateway -AllowRemoteVnetTraffic $false

In beide gevallen haalt de eerste opdracht de gateway op. Vervolgens kunt u de eigenschap rechtstreeks op het object wijzigen en behouden, of u kunt de schakeloptie gebruiken voor de cmdlet Set-AzVirtualNetworkGateway.

Parameters

-AadAudienceId

P2S AAD-verificatieoptie: AadAudienceId.

Type:String
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-AadIssuerUri

P2S AAD-verificatieoptie: AadIssuerUri.

Type:String
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-AadTenantUri

P2S AAD-verificatieoptie: AadTenantUri.

Type:String
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-AsJob

Cmdlet op de achtergrond uitvoeren

Type:SwitchParameter
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Asn

De ASN van de virtuele netwerkgateway, die wordt gebruikt om BGP-sessies in IPsec-tunnels in te stellen

Type:UInt32
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-BgpRouteTranslationForNat

Hiermee wordt BgpRouteTranslationForNat ingeschakeld en uitgeschakeld op deze VirtualNetworkGateway

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-ClientConnectionConfiguration

P2S-clientverbindingsconfiguratie die wordt gesiociat tussen adres en beleidsgroep

Type:PSClientConnectionConfiguration[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-Confirm

Hiermee wordt u gevraagd om bevestiging voordat u de cmdlet uitvoert.

Type:SwitchParameter
Aliassen:cf
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-CustomRoute

Aangepaste routes AddressPool die is opgegeven door de klant

Type:String[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-DefaultProfile

De referenties, accounts, tenants en abonnementen die worden gebruikt voor communicatie met Azure.

Type:IAzureContextContainer
Aliassen:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-DisableActiveActiveFeature

Vlag voor het uitschakelen van de functie Actief actief op de gateway van het virtuele netwerk

Type:SwitchParameter
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-EnableActiveActiveFeature

Vlag om de functie Actief actief in te schakelen op de gateway van het virtuele netwerk

Type:SwitchParameter
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-EnablePrivateIpAddress

Vlag om de functie Actief actief in te schakelen op de gateway van het virtuele netwerk

Type:Nullable<T>[Boolean]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-GatewayDefaultSite

De standaardsite die moet worden gebruikt voor geforceerde tunneling. Als er een standaardsite is opgegeven, wordt al het internetverkeer van het vnet van de gateway doorgestuurd naar die site.

Type:PSLocalNetworkGateway
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-GatewaySku

De SKU van de virtuele netwerkgateway

Type:String
Geaccepteerde waarden:Basic, Standard, HighPerformance, UltraPerformance, VpnGw1, VpnGw2, VpnGw3, VpnGw4, VpnGw5, VpnGw1AZ, VpnGw2AZ, VpnGw3AZ, VpnGw4AZ, VpnGw5AZ, ErGw1AZ, ErGw2AZ, ErGw3AZ
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-IpConfigurationBgpPeeringAddresses

De BgpPeeringAddresses voor virtual network gateway bgpsettings.

Type:PSIpConfigurationBgpPeeringAddress[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-NatRule

De NatRules voor virtuele netwerkgateway.

Type:PSVirtualNetworkGatewayNatRule[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-PeerWeight

Het gewicht dat is toegevoegd aan routes die via BGP zijn geleerd via deze virtuele netwerkgateway

Type:Int32
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-RadiusServerAddress

P2S External Radius-serveradres.

Type:String
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-RadiusServerList

P2S meerdere externe Radius-servers.

Type:PSRadiusServer[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-RadiusServerSecret

P2S External Radius-servergeheim.

Type:SecureString
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-RemoveAadAuthentication

Vlag voor het verwijderen van AAD-verificatie voor P2S-client van de gateway van het virtuele netwerk.

Type:SwitchParameter
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-Tag

P2S External Radius-serveradres.

Type:Hashtable
Position:Named
Default value:None
Vereist:True
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

-VirtualNetworkGateway

Het gatewayobject van het virtuele netwerk om basiswijzigingen van af te leggen. Dit kan worden opgehaald met Behulp van Get-AzVirtualNetworkGateway

Type:PSVirtualNetworkGateway
Position:Named
Default value:None
Vereist:True
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-VirtualNetworkGatewayPolicyGroup

P2S-beleidsgroep toegevoegd aan deze gateway

Type:PSVirtualNetworkGatewayPolicyGroup[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-VpnAuthenticationType

De lijst met P2S VPN-clientverificatietypen.

Type:String[]
Geaccepteerde waarden:Certificate, Radius, AAD
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-VpnClientAddressPool

De adresruimte waaruit IP-adressen van de VPN-client moeten worden toegewezen. Dit mag niet overlappen met virtuele netwerken of on-premises bereiken.

Type:String[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-VpnClientIpsecPolicy

Een lijst met IPSec-beleidsregels voor P2S VPN-clienttunnelprotocollen.

Type:PSIpsecPolicy[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-VpnClientProtocol

Een lijst met P2S VPN-clienttunnelprotocollen

Type:String[]
Geaccepteerde waarden:SSTP, IkeV2, OpenVPN
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-VpnClientRevokedCertificates

Een lijst met ingetrokken VPN-clientcertificaten. Een VPN-client die een certificaat presenteert dat overeenkomt met een van deze, wordt verteld om weg te gaan.

Type:PSVpnClientRevokedCertificate[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-VpnClientRootCertificates

Een lijst met VPN-clienthoofdcertificaten die moeten worden gebruikt voor VPN-clientverificatie. Vpn-clients moeten certificaten presenteren die zijn gegenereerd op basis van een van deze basiscertificaten.

Type:PSVpnClientRootCertificate[]
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:True
Jokertekens accepteren:False

-WhatIf

Hiermee wordt weergegeven wat er zou gebeuren als u de cmdlet uitvoert. De cmdlet wordt niet uitgevoerd.

Type:SwitchParameter
Aliassen:wi
Position:Named
Default value:None
Vereist:False
Pijplijninvoer accepteren:False
Jokertekens accepteren:False

Invoerwaarden

PSVirtualNetworkGateway

String

PSLocalNetworkGateway

String[]

PSVpnClientRootCertificate[]

PSVpnClientRevokedCertificate[]

PSIpsecPolicy[]

UInt32

Int32

PSIpConfigurationBgpPeeringAddress[]

SecureString

PSRadiusServer[]

PSVirtualNetworkGatewayNatRule[]

Uitvoerwaarden

PSVirtualNetworkGateway