Update-AzVpnGateway
Hiermee wordt een schaalbare VPN-gateway bijgewerkt.
Syntax
Update-AzVpnGateway
-ResourceGroupName <String>
-Name <String>
[-VpnConnection <PSVpnConnection[]>]
[-VpnGatewayNatRule <PSVpnGatewayNatRule[]>]
[-VpnGatewayScaleUnit <UInt32>]
[-BgpPeeringAddress <PSIpConfigurationBgpPeeringAddress[]>]
[-EnableBgpRouteTranslationForNat <Boolean>]
[-Tag <Hashtable>]
[-Asn <UInt32>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzVpnGateway
-InputObject <PSVpnGateway>
[-VpnConnection <PSVpnConnection[]>]
[-VpnGatewayNatRule <PSVpnGatewayNatRule[]>]
[-VpnGatewayScaleUnit <UInt32>]
[-BgpPeeringAddress <PSIpConfigurationBgpPeeringAddress[]>]
[-EnableBgpRouteTranslationForNat <Boolean>]
[-Tag <Hashtable>]
[-Asn <UInt32>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzVpnGateway
-ResourceId <String>
[-VpnConnection <PSVpnConnection[]>]
[-VpnGatewayNatRule <PSVpnGatewayNatRule[]>]
[-VpnGatewayScaleUnit <UInt32>]
[-BgpPeeringAddress <PSIpConfigurationBgpPeeringAddress[]>]
[-EnableBgpRouteTranslationForNat <Boolean>]
[-Tag <Hashtable>]
[-Asn <UInt32>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
De cmdlet Update-AzVpnGateway werkt een schaalbare VPN-gateway bij.
Een Azure VPN-gateway is een software-gedefinieerde connectiviteit voor site-naar-site-verbindingen in VirtualHub. De grootte van deze gateway wordt aangepast en geschaald op basis van de schaaleenheid die door de gebruiker is opgegeven. Een verbinding kan worden ingesteld vanaf een vertakking/site, ook wel VPN-site genoemd, naar de schaalbare gateway. Elke verbinding bestaat uit 2 actief-actieve tunnels
Voorbeelden
Voorbeeld 1
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"
$vpnGateway = New-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -VirtualHubId $virtualHub.Id -VpnGatewayScaleUnit 2
Update-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -VpnGatewayScaleUnit 3
ResourceGroupName : testRG
Name : testvpngw
Id : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/vpnGateways/testvpngw
Location : West US
VpnGatewayScaleUnit : 3
VirtualHub : /subscriptions/{subscriptionId}/resourceGroups/Ali_pS_Test/providers/Microsoft.Network/virtualHubs/westushub
BgpSettings : {}
Type : Microsoft.Network/vpnGateways
ProvisioningState : Succeeded
Met het bovenstaande maakt u een resourcegroep, Virtual WAN, Virtual Network, Virtual Hub in VS - west in resourcegroep testRG in Azure. Hierna wordt een VPN-gateway gemaakt in de virtuele hub met 2 schaaleenheden.
Nadat de gateway is gemaakt, wordt Update-AzVpnGateway gebruikt om de gateway te upgraden naar 3 schaaleenheden.
Voorbeeld 2
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"
$vpnGateway = New-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -VirtualHubId $virtualHub.Id -VpnGatewayScaleUnit 2
$ipconfigurationId1 = 'Instance0'
$addresslist1 = @('169.254.21.5')
$gw1ipconfBgp1 = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId1 -CustomAddress $addresslist1
$ipconfigurationId2 = 'Instance1'
$addresslist2 = @('169.254.21.10')
$gw1ipconfBgp2 = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId2 -CustomAddress $addresslist2
$gw = Get-AzVpnGateway -ResourceGroupName testRg -Name testgw
Update-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -BgpPeeringAddress @($gw1ipconfBgp1,$gw1ipconfBgp2)
ResourceGroupName : testRG
Name : testvpngw
Id : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/vpnGateways/testvpngw
Location : West US
VpnGatewayScaleUnit : 3
VirtualHub : /subscriptions/{subscriptionId}/resourceGroups/Ali_pS_Test/providers/Microsoft.Network/virtualHubs/westushub
BgpSettings : {}
Type : Microsoft.Network/vpnGateways
ProvisioningState : Succeeded
Met het bovenstaande maakt u een resourcegroep, Virtual WAN, Virtual Network, Virtual Hub in VS - west in resourcegroep testRG in Azure. Hierna wordt een VPN-gateway gemaakt in de virtuele hub met 2 schaaleenheden.
Nadat de gateway is gemaakt, wordt Set-AzVpnGateway gebruikt om BgpPeeringAddress bij te werken.
Voorbeeld 3
$gw = Get-AzVpnGateway -ResourceGroupName "testRg" -Name "testgw"
$gw.BgpSettings.BgpPeeringAddresses
$gw.BgpSettings.BgpPeeringAddresses[0].CustomBgpIpAddresses=$null
$gw.BgpSettings.BgpPeeringAddresses[1].CustomBgpIpAddresses=$null
$gw.BgpSettings.BgpPeeringAddresses
Update-AzVpnGateway -InputObject $gw
In het bovenstaande voorbeeld wordt de Virtual WAN VPN Gateway bijgewerkt om het standaard BgpPeeringAddress te gebruiken.
Voorbeeld 4
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"
$vpnGateway = New-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -VirtualHubId $virtualHub.Id -VpnGatewayScaleUnit 2
$ipconfigurationId1 = 'Instance0'
$addresslist1 = @()
$gw1ipconfBgp1 = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId1 -CustomAddress $addresslist1
$ipconfigurationId2 = 'Instance1'
$addresslist2 = @()
$gw1ipconfBgp2 = New-AzIpConfigurationBgpPeeringAddressObject -IpConfigurationId $ipconfigurationId2 -CustomAddress $addresslist2
$gw = Get-AzVpnGateway -ResourceGroupName testRg -Name testgw
Update-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -BgpPeeringAddress @($gw1ipconfBgp1,$gw1ipconfBgp2)
In het bovenstaande voorbeeld wordt de Virtual WAN VPN Gateway bijgewerkt om het standaard BgpPeeringAddress te gebruiken.
Het maakt gebruik van Update-AzVpnGateway om BgpPeeringAddress bij te werken
Parameters
-AsJob
Cmdlet op de achtergrond uitvoeren
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Asn
De ASN van de VPN-gateway voor BGP via VPN
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-BgpPeeringAddress
De BGP-peeringadressen voor deze VpnGateway-bgpsettings.
Type: | PSIpConfigurationBgpPeeringAddress[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Confirm
Hiermee wordt u gevraagd om bevestiging voordat u de cmdlet uitvoert.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
De referenties, accounts, tenants en abonnementen die worden gebruikt voor communicatie met Azure.
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EnableBgpRouteTranslationForNat
Vlag om Bgp-routeomzetting voor NAT in of uit te schakelen op deze VpnGateway.
Type: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-InputObject
Het vpn-gatewayobject dat moet worden gewijzigd
Type: | PSVpnGateway |
Aliases: | VpnGateway |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
De naam van de VPN-gateway.
Type: | String |
Aliases: | ResourceName, VpnGatewayName, GatewayName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResourceGroupName
De naam van de resourcegroep.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ResourceId
De Azure-resource-id van de VpnGateway die moet worden gewijzigd.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Tag
Een hashtabel die resourcetags vertegenwoordigt.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VpnConnection
De lijst met Vpn Verbinding maken ions die deze VpnGateway moet hebben.
Type: | PSVpnConnection[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VpnGatewayNatRule
De lijst met VpnGatewayNatRules die zijn gekoppeld aan deze VpnGateway.
Type: | PSVpnGatewayNatRule[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VpnGatewayScaleUnit
De schaaleenheid voor deze VpnGateway.
Type: | UInt32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-WhatIf
Hiermee wordt weergegeven wat er zou gebeuren als u de cmdlet uitvoert. De cmdlet wordt niet uitgevoerd.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Invoerwaarden
Uitvoerwaarden
Verwante koppelingen
Azure PowerShell
Feedback
https://aka.ms/ContentUserFeedback.
Binnenkort beschikbaar: In de loop van 2024 zullen we GitHub-problemen geleidelijk uitfaseren als het feedbackmechanisme voor inhoud en deze vervangen door een nieuw feedbacksysteem. Zie voor meer informatie:Feedback verzenden en weergeven voor