New-AzVirtualNetworkGatewayConnection
Erstellt die Standort-zu-Standort-VPN-Verbindung zwischen dem virtuellen Netzwerkgateway und dem lokalen VPN-Gerät.
Syntax
New-AzVirtualNetworkGatewayConnection
-Name <String>
-ResourceGroupName <String>
-Location <String>
[-AuthorizationKey <String>]
-VirtualNetworkGateway1 <PSVirtualNetworkGateway>
[-VirtualNetworkGateway2 <PSVirtualNetworkGateway>]
[-LocalNetworkGateway2 <PSLocalNetworkGateway>]
-ConnectionType <String>
[-RoutingWeight <Int32>]
[-DpdTimeoutInSeconds <Int32>]
[-ConnectionMode <String>]
[-SharedKey <String>]
[-Peer <PSPeering>]
[-EnableBgp <Boolean>]
[-UseLocalAzureIpAddress]
[-Tag <Hashtable>]
[-Force]
[-UsePolicyBasedTrafficSelectors <Boolean>]
[-IpsecPolicies <PSIpsecPolicy[]>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-ConnectionProtocol <String>]
[-IngressNatRule <PSResourceId[]>]
[-EgressNatRule <PSResourceId[]>]
[-GatewayCustomBgpIpAddress <PSGatewayCustomBgpIpConfiguration[]>]
[-AsJob]
[-ExpressRouteGatewayBypass]
[-EnablePrivateLinkFastPath]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVirtualNetworkGatewayConnection
-Name <String>
-ResourceGroupName <String>
-Location <String>
[-AuthorizationKey <String>]
-VirtualNetworkGateway1 <PSVirtualNetworkGateway>
[-VirtualNetworkGateway2 <PSVirtualNetworkGateway>]
[-LocalNetworkGateway2 <PSLocalNetworkGateway>]
-ConnectionType <String>
[-RoutingWeight <Int32>]
[-DpdTimeoutInSeconds <Int32>]
[-ConnectionMode <String>]
[-SharedKey <String>]
[-PeerId <String>]
[-EnableBgp <Boolean>]
[-UseLocalAzureIpAddress]
[-Tag <Hashtable>]
[-Force]
[-UsePolicyBasedTrafficSelectors <Boolean>]
[-IpsecPolicies <PSIpsecPolicy[]>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-ConnectionProtocol <String>]
[-IngressNatRule <PSResourceId[]>]
[-EgressNatRule <PSResourceId[]>]
[-GatewayCustomBgpIpAddress <PSGatewayCustomBgpIpConfiguration[]>]
[-AsJob]
[-ExpressRouteGatewayBypass]
[-EnablePrivateLinkFastPath]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Beschreibung
Erstellt die Standort-zu-Standort-VPN-Verbindung zwischen dem virtuellen Netzwerkgateway und dem lokalen VPN-Gerät.
Beispiele
Beispiel 1
$vnetgw1 = Get-AzVirtualNetworkGateway -ResourceGroupName "Rg1" -Name "gw1"
$vnetgw2 = Get-AzVirtualNetworkGateway -ResourceGroupName "Rg1" -Name "gw2"
New-AzVirtualNetworkGatewayConnection -Name conn-client-1 -ResourceGroupName "Rg1" -VirtualNetworkGateway1 $vnetgw1 -VirtualNetworkGateway2 $vnetgw2 -Location "eastus" -ConnectionType Vnet2Vnet -SharedKey 'a1b2c3d4e5'
Beispiel 2 Hinzufügen/Aktualisieren von IngressNatRule/EgressNatRule zu einer vorhandenen Verbindung mit einem virtuellen Netzwerkgateway
$vnetgw1 = Get-AzVirtualNetworkGateway -ResourceGroupName "Rg1" -Name "vnetgw1"
$vnetgw2 = Get-AzVirtualNetworkGateway -ResourceGroupName "Rg1" -Name "vnetgw2"
$ingressnatrule = Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName "Rg1" -Name "natRule1" -ParentResourceName vnetgw1
$egressnatrule = Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName "Rg1" -Name "natRule2" -ParentResourceName vnetgw1
New-AzVirtualNetworkGatewayConnection -Name conn-client-1 -ResourceGroupName $RG1 -VirtualNetworkGateway1 $vnetgw1 -VirtualNetworkGateway2 $vnetgw2 -Location "eastus" -ConnectionType Vnet2Vnet -SharedKey 'a1b2c3d4e5' `
-IngressNatRule $ingressnatrule -EgressNatRule $egressnatrule
Der erste Befehl ruft ein natRule natRule des virtuellen Netzwerkgateways mit dem Namen natRule1 ab, der Typ "IngressSnat" ist. Der zweite Befehl ruft ein natRule natRule des virtuellen Netzwerkgateways mit dem Namen natRule2 ab, der typ ist EgressSnat. Der dritte Befehl erstellt diese neue virtuelle Netzwerkgatewayverbindung mit Ingress und Egress NatRules.
Beispiel 3 Hinzufügen von GatewayCustomBgpIpAddress zu einer Verbindung mit dem virtuellen Netzwerkgateway
$LocalnetGateway = Get-AzLocalNetworkGateway -ResourceGroupName "PS_testing" -name "testLng"
$gateway = Get-AzVirtualNetworkGateway -ResourceGroupName PS_testing -ResourceName testGw
$address = New-AzGatewayCustomBgpIpConfigurationObject -IpConfigurationId "/subscriptions/83704d68-d560-4c67-b1c7-12404db89dc3/resourceGroups/PS_testing/providers/Microsoft.Network/virtualNetworkGateways/testGw/ipConfigurations/default" -CustomBgpIpAddress "169.254.21.1"
New-AzVirtualNetworkGatewayConnection -ResourceGroupName "PS_testing" -name "Conn" -location "eastus" -VirtualNetworkGateway1 $gateway -LocalNetworkGateway2 $localnetGateway -ConnectionType IPsec -RoutingWeight 3 -SharedKey abc -GatewayCustomBgpIpAddress $address -EnableBgp $true
Der beiden Befehl ruft ein lokales Netzwerkgateway und ein virtuelles Netzwerkgateway ab. Der thrid-Befehl erstellt ein AzGatewayCustomBgpIpConfigurationObject. Der dritte Befehl erstellt diese neue Verbindung des virtuellen Netzwerkgateways mit GatewayCustomBgpIpAddress.
Parameter
-AsJob
Cmdlet im Hintergrund ausführen
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-AuthorizationKey
AuthorizationKey.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Hiermit werden Sie vor der Ausführung des Cmdlets zur Bestätigung aufgefordert.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ConnectionMode
Virtual Network Gateway Verbinden ion-Modus.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ConnectionProtocol
Gatewayverbindungsprotokoll:IKEv1/IKEv2
Type: | String |
Accepted values: | IKEv1, IKEv2 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ConnectionType
Gatewayverbindungstyp:IPsec/Vnet2Vnet/ExpressRoute/VPNClient
Type: | String |
Accepted values: | IPsec, Vnet2Vnet, ExpressRoute, VPNClient |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultProfile
Anmeldeinformationen, Konto, Mandant und Abonnement für die Kommunikation mit Azure
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DpdTimeoutInSeconds
Timeout der Inaktiven Peererkennung der Verbindung in Sekunden.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-EgressNatRule
Die Liste der NAT-Ausgangsregeln, die dieser Verbinden ion zugeordnet sind.
Type: | PSResourceId[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EnableBgp
Gibt an, ob eine BGP-Sitzung über einen S2S-VPN-Tunnel eingerichtet werden soll
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-EnablePrivateLinkFastPath
Umgehen Sie das ExpressRoute-Gateway beim Zugriff auf private Links. ExpressRoute FastPath (ExpressRouteGatewayBypass) muss aktiviert sein.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ExpressRouteGatewayBypass
Gibt an, ob der beschleunigte virtuelle Netzwerkzugriff durch Umgehung des Gateways verwendet werden soll.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Force
Bitten Sie nicht um Bestätigung, wenn Sie eine Ressource überschreiben möchten
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-GatewayCustomBgpIpAddress
Die GatewayCustomBgpIpAddress des in dieser Verbindung verwendeten virtuellen Netzwerkgateways.
Type: | PSGatewayCustomBgpIpConfiguration[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-IngressNatRule
Die Liste der NAT-Eingangsregeln, die dieser Verbinden ion zugeordnet sind.
Type: | PSResourceId[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-IpsecPolicies
Eine Liste der IPSec-Richtlinien.
Type: | PSIpsecPolicy[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-LocalNetworkGateway2
lokales Netzwerkgateway.
Type: | PSLocalNetworkGateway |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Location
vorhanden.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Der Name der Ressource.
Type: | String |
Aliases: | ResourceName |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Peer
Peer
Type: | PSPeering |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-PeerId
PeerId
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ResourceGroupName
Der Name der Ressourcengruppe.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-RoutingWeight
RoutingWeight.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-SharedKey
Der Ipsec-Freigabeschlüssel.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Tag
Eine Hashtabelle, die Ressourcentags darstellt.
Type: | Hashtable |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TrafficSelectorPolicy
Eine Liste der Richtlinien für die Datenverkehrsauswahl.
Type: | PSTrafficSelectorPolicy[] |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-UseLocalAzureIpAddress
Gibt an, ob PrivateIP für diesen S2S-VPN-Tunnel verwendet werden soll
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-UsePolicyBasedTrafficSelectors
Gibt an, ob richtlinienbasierte Datenverkehrsauswahlen für eine S2S-Verbindung verwendet werden sollen.
Type: | Boolean |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VirtualNetworkGateway1
Erstes virtuelles Netzwerkgateway.
Type: | PSVirtualNetworkGateway |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-VirtualNetworkGateway2
Zweites virtuelles Netzwerkgateway.
Type: | PSVirtualNetworkGateway |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Zeigt, was geschieht, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Eingaben
PSGatewayCustomBgpIpConfiguration[]
Ausgaben
PSVirtualNetworkGatewayConnection