Set-AzVirtualNetworkGatewayConnection
Hiermee configureert u een gatewayverbinding voor een virtueel netwerk.
Syntaxis
Set-AzVirtualNetworkGatewayConnection
-VirtualNetworkGatewayConnection <PSVirtualNetworkGatewayConnection>
[-EnableBgp <Boolean>]
[-DpdTimeoutInSeconds <Int32>]
[-ConnectionMode <String>]
[-UsePolicyBasedTrafficSelectors <Boolean>]
[-UseLocalAzureIpAddress <Boolean>]
[-IpsecPolicies <PSIpsecPolicy[]>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-IngressNatRule <PSResourceId[]>]
[-EgressNatRule <PSResourceId[]>]
[-GatewayCustomBgpIpAddress <PSGatewayCustomBgpIpConfiguration[]>]
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzVirtualNetworkGatewayConnection
-VirtualNetworkGatewayConnection <PSVirtualNetworkGatewayConnection>
[-EnableBgp <Boolean>]
[-DpdTimeoutInSeconds <Int32>]
[-ConnectionMode <String>]
[-UsePolicyBasedTrafficSelectors <Boolean>]
[-UseLocalAzureIpAddress <Boolean>]
[-IpsecPolicies <PSIpsecPolicy[]>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-IngressNatRule <PSResourceId[]>]
[-EgressNatRule <PSResourceId[]>]
[-GatewayCustomBgpIpAddress <PSGatewayCustomBgpIpConfiguration[]>]
-Tag <Hashtable>
[-Force]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
De cmdlet Set-AzVirtualNetworkGatewayConnection configureert een virtuele netwerkgatewayverbinding.
Voorbeelden
Voorbeeld 1:
$conn = Get-AzVirtualNetworkGatewayConnection -Name 1 -ResourceGroupName myRG
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn
Confirm
Are you sure you want to overwrite resource '1'
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
Name : 1
ResourceGroupName : myRG
Location : westus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Mi
crosoft.Network/connections/1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/M
icrosoft.Network/virtualNetworkGateways/myGateway"
VirtualNetworkGateway2 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/S2SVnetConn/providers/Mic
rosoft.Network/virtualNetworkGateways/S2SConnGW"
LocalNetworkGateway2 :
Peer :
RoutingWeight : 0
SharedKey :
ConnectionStatus : Connected
EgressBytesTransferred : 91334484
IngressBytesTransferred : 100386089
TunnelConnectionStatus : []
Voorbeeld 2: Tags toevoegen/bijwerken aan een bestaande VirtualNetworkGatewayConnection
$conn = Get-AzVirtualNetworkGatewayConnection -Name 1 -ResourceGroupName myRG
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn -Tag @{ testtagKey="SomeTagKey"; testtagValue="SomeKeyValue" }
Confirm
Are you sure you want to overwrite resource '1'
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
Name : 1
ResourceGroupName : myRG
Location : westus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Mi
crosoft.Network/connections/1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
Name Value
============ ============
testtagValue SomeKeyValue
testtagKey SomeTagKey
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/M
icrosoft.Network/virtualNetworkGateways/myGateway"
VirtualNetworkGateway2 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/S2SVnetConn/providers/Mic
rosoft.Network/virtualNetworkGateways/S2SConnGW"
LocalNetworkGateway2 :
Peer :
RoutingWeight : 0
SharedKey :
ConnectionStatus : Connected
EgressBytesTransferred : 91334484
IngressBytesTransferred : 100386089
TunnelConnectionStatus : []
Voorbeeld 3: NatRules toevoegen/verwijderen aan een bestaande VirtualNetworkGatewayConnection
$conn = Get-AzVirtualNetworkGatewayConnection -Name 1 -ResourceGroupName myRG
$egressNatrule = Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName myRG -Name "natRule1" -ParentResourceName "gw1"
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn -IngressNatRule @() -EgressNatRule $egressNatrule
Confirm
Are you sure you want to overwrite resource '1'
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): y
Name : 1
ResourceGroupName : myRG
Location : westus
Id : /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Mi
crosoft.Network/connections/1
Etag : W/"00000000-0000-0000-0000-000000000000"
ResourceGuid : 00000000-0000-0000-0000-000000000000
ProvisioningState : Succeeded
Tags :
Name Value
============ ============
testtagValue SomeKeyValue
testtagKey SomeTagKey
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/M
icrosoft.Network/virtualNetworkGateways/myGateway"
VirtualNetworkGateway2 : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/S2SVnetConn/providers/Mic
rosoft.Network/virtualNetworkGateways/S2SConnGW"
LocalNetworkGateway2 :
Peer :
RoutingWeight : 0
SharedKey :
ConnectionStatus : Connected
EgressBytesTransferred : 91334484
IngressBytesTransferred : 100386089
TunnelConnectionStatus : []
IngressNatRules : []
EgressNatRules : [
{
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1"
}
]
De eerste opdracht haalt een virtuele netwerkgatewayverbinding op met de naam 1 die deel uitmaakt van de resourcegroep myRG en slaat deze op in de variabele met de naam $conn. Met de tweede opdracht wordt de virtuele netwerkgateway natRule met de naam natRule1 opgeslagen in de variabele met de naam $egressNatrule. Met de derde opdracht wordt de gatewayverbinding van het virtuele netwerk ingesteld met alle ingressNatRules verwijderd en wordt egressNatrule toegevoegd aan EgressNatRules.
Voorbeeld 3: GatewayCustomBgpIpAddress toevoegen/verwijderen aan een bestaande VirtualNetworkGatewayConnection
$address1 = New-AzGatewayCustomBgpIpConfigurationObject -IpConfigurationId "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw/ipConfigurations/default" -CustomBgpIpAddress "169.254.21.1"
$address2 = New-AzGatewayCustomBgpIpConfigurationObject -IpConfigurationId "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw/ipConfigurations/ActiveActive" -CustomBgpIpAddress "169.254.21.3"
$conn = Get-AzVirtualNetworkGatewayConnection -ResourceGroupName PS_testing -ResourceName Conn
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn -GatewayCustomBgpIpAddress $address1,$address2
Name : Conn
ResourceGroupName : PS_testing
Location : eastus
Id : /subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/connections/Conn
Etag : W/"e867e7bb-fa2e-436e-8822-70c556ec0f03"
ResourceGuid : 9c33f4f7-b09c-4080-932e-a44405a8c252
ProvisioningState : Succeeded
Tags :
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw"
VirtualNetworkGateway2 :
LocalNetworkGateway2 : "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/localNetworkGateways/testLng"
Peer :
RoutingWeight : 3
SharedKey : abc
ExpressRouteGatewayBypass : False
EnablePrivateLinkFastPath : False
ConnectionStatus : Unknown
EgressBytesTransferred : 0
IngressBytesTransferred : 0
TunnelConnectionStatus : []
IngressNatRules : []
EgressNatRules : []
GatewayCustomBgpIpAddresses : [
{
"IpconfigurationId":
"/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw/ipConfigurations/default",
"CustomBgpIpAddress": "169.254.21.1"
},
{
"IpconfigurationId":
"/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw/ipConfigurations/ActiveActive",
"CustomBgpIpAddress": "169.254.21.3"
}
]
Hiermee maakt u een nieuwe AzGatewayCustomBgpIpConfigurationObjects en werkt u de gatewayverbinding bij met deze GatewayCustomBgpIpAddress.
Voorbeeld 4: GatewayCustomBgpIpAddress verwijderen naar een bestaande VirtualNetworkGatewayConnection
$conn = Get-AzVirtualNetworkGatewayConnection -ResourceGroupName PS_testing -ResourceName Conn
Set-AzVirtualNetworkGatewayConnection -VirtualNetworkGatewayConnection $conn -GatewayCustomBgpIpAddress @()
Name : Conn
ResourceGroupName : PS_testing
Location : eastus
Id : /subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/connections/Conn
Etag : W/"863d9b89-a030-42ba-9f71-58d5bc3336a9"
ResourceGuid : 9c33f4f7-b09c-4080-932e-a44405a8c252
ProvisioningState : Succeeded
Tags :
AuthorizationKey :
VirtualNetworkGateway1 : "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw"
VirtualNetworkGateway2 :
LocalNetworkGateway2 : "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/localNetworkGateways/testLng"
Peer :
RoutingWeight : 3
SharedKey : abc
ExpressRouteGatewayBypass : False
EnablePrivateLinkFastPath : False
ConnectionStatus : NotConnected
EgressBytesTransferred : 0
IngressBytesTransferred : 0
TunnelConnectionStatus : []
IngressNatRules : []
EgressNatRules : []
GatewayCustomBgpIpAddresses : []
Hiermee wordt de gatewayverbinding bijgewerkt met het verwijderen van deze GatewayCustomBgpIpAddress.
Parameters
-AsJob
Cmdlet op de achtergrond uitvoeren
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
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 |
-ConnectionMode
Verbindingsmodus voor virtuele netwerkgateway.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
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 |
-DpdTimeoutInSeconds
Time-out voor detectie van dode peers van de verbinding in seconden.
Type: | Nullable<T>[Int32] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-EgressNatRule
De lijst met uitgaande NAT-regels die aan deze verbinding zijn gekoppeld.
Type: | PSResourceId[] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-EnableBgp
Of een BGP-sessie via een S2S VPN-tunnel moet worden gebruikt
Type: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-Force
Vraag niet om bevestiging als u een resource wilt overschrijven
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-GatewayCustomBgpIpAddress
Het GatewayCustomBgpIpAddress van de gateway van het virtuele netwerk die in deze verbinding wordt gebruikt.
Type: | PSGatewayCustomBgpIpConfiguration[] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-IngressNatRule
De lijst met nat-regels voor inkomend verkeer die aan deze verbinding zijn gekoppeld.
Type: | PSResourceId[] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-IpsecPolicies
Een lijst met IPSec-beleidsregels.
Type: | PSIpsecPolicy[] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-Tag
Een hashtabel die resourcetags vertegenwoordigt.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-TrafficSelectorPolicy
Een lijst met beleidsregels voor verkeerskiezers.
Type: | PSTrafficSelectorPolicy[] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-UseLocalAzureIpAddress
Of u PrivateIP wilt gebruiken voor een S2S-verbinding
Type: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-UsePolicyBasedTrafficSelectors
Of u verkeerkiezers op basis van beleid wilt gebruiken voor een S2S-verbinding
Type: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-VirtualNetworkGatewayConnection
The VirtualNetworkGatewayConnection
Type: | PSVirtualNetworkGatewayConnection |
Position: | Named |
Default value: | None |
Vereist: | True |
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
PSVirtualNetworkGatewayConnection
Nullable<T>[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
Nullable<T>[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]
PSGatewayCustomBgpIpConfiguration[]
Uitvoerwaarden
PSVirtualNetworkGatewayConnection
Verwante koppelingen
Azure PowerShell