New-AzVpnConnection
Hiermee maakt u een IPSec-verbinding die een VpnGateway verbindt met een externe klantbranch die in RM wordt weergegeven als een VpnSite.
Syntaxis
New-AzVpnConnection
-ResourceGroupName <String>
-ParentResourceName <String>
-Name <String>
-VpnSite <PSVpnSite>
[-SharedKey <SecureString>]
[-ConnectionBandwidthInMbps <UInt32>]
[-IpSecPolicy <PSIpsecPolicy>]
[-VpnConnectionProtocolType <String>]
[-EnableBgp]
[-UseLocalAzureIpAddress]
[-UsePolicyBasedTrafficSelectors]
[-VpnSiteLinkConnection <PSVpnSiteLinkConnection[]>]
[-EnableInternetSecurity]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVpnConnection
-ResourceGroupName <String>
-ParentResourceName <String>
-Name <String>
-VpnSiteId <String>
[-SharedKey <SecureString>]
[-ConnectionBandwidthInMbps <UInt32>]
[-IpSecPolicy <PSIpsecPolicy>]
[-VpnConnectionProtocolType <String>]
[-EnableBgp]
[-UseLocalAzureIpAddress]
[-UsePolicyBasedTrafficSelectors]
[-VpnSiteLinkConnection <PSVpnSiteLinkConnection[]>]
[-EnableInternetSecurity]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVpnConnection
-ParentObject <PSVpnGateway>
-Name <String>
-VpnSite <PSVpnSite>
[-SharedKey <SecureString>]
[-ConnectionBandwidthInMbps <UInt32>]
[-IpSecPolicy <PSIpsecPolicy>]
[-VpnConnectionProtocolType <String>]
[-EnableBgp]
[-UseLocalAzureIpAddress]
[-UsePolicyBasedTrafficSelectors]
[-VpnSiteLinkConnection <PSVpnSiteLinkConnection[]>]
[-EnableInternetSecurity]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVpnConnection
-ParentObject <PSVpnGateway>
-Name <String>
-VpnSiteId <String>
[-SharedKey <SecureString>]
[-ConnectionBandwidthInMbps <UInt32>]
[-IpSecPolicy <PSIpsecPolicy>]
[-VpnConnectionProtocolType <String>]
[-EnableBgp]
[-UseLocalAzureIpAddress]
[-UsePolicyBasedTrafficSelectors]
[-VpnSiteLinkConnection <PSVpnSiteLinkConnection[]>]
[-EnableInternetSecurity]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVpnConnection
-ParentResourceId <String>
-Name <String>
-VpnSite <PSVpnSite>
[-SharedKey <SecureString>]
[-ConnectionBandwidthInMbps <UInt32>]
[-IpSecPolicy <PSIpsecPolicy>]
[-VpnConnectionProtocolType <String>]
[-EnableBgp]
[-UseLocalAzureIpAddress]
[-UsePolicyBasedTrafficSelectors]
[-VpnSiteLinkConnection <PSVpnSiteLinkConnection[]>]
[-EnableInternetSecurity]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVpnConnection
-ParentResourceId <String>
-Name <String>
-VpnSiteId <String>
[-SharedKey <SecureString>]
[-ConnectionBandwidthInMbps <UInt32>]
[-IpSecPolicy <PSIpsecPolicy>]
[-VpnConnectionProtocolType <String>]
[-EnableBgp]
[-UseLocalAzureIpAddress]
[-UsePolicyBasedTrafficSelectors]
[-VpnSiteLinkConnection <PSVpnSiteLinkConnection[]>]
[-EnableInternetSecurity]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-TrafficSelectorPolicy <PSTrafficSelectorPolicy[]>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Hiermee maakt u een IPSec-verbinding die een VpnGateway verbindt met een externe klantbranch die in RM wordt weergegeven als een VpnSite.
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"
New-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -VirtualHubId $virtualHub.Id -VpnGatewayScaleUnit 2
$vpnGateway = Get-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw"
$vpnSiteAddressSpaces = New-Object string[] 2
$vpnSiteAddressSpaces[0] = "192.168.2.0/24"
$vpnSiteAddressSpaces[1] = "192.168.3.0/24"
$vpnSite = New-AzVpnSite -ResourceGroupName "testRG" -Name "testVpnSite" -Location "West US" -VirtualWan $virtualWan -IpAddress "1.2.3.4" -AddressSpace $vpnSiteAddressSpaces -DeviceModel "SomeDevice" -DeviceVendor "SomeDeviceVendor" -LinkSpeedInMbps "10"
New-AzVpnConnection -ResourceGroupName $vpnGateway.ResourceGroupName -ParentResourceName $vpnGateway.Name -Name "testConnection" -VpnSite $vpnSite -ConnectionBandwidthInMbps 20
RemoteVpnSite : Microsoft.Azure.Commands.Network.Models.PSResourceId
SharedKey :
VpnConnectionProtocolType : IKEv2
ConnectionStatus :
EgressBytesTransferred : 0
IngressBytesTransferred : 0
IpsecPolicies : {}
ConnectionBandwidth : 20
EnableBgp : False
UseLocalAzureIpAddress : False
ProvisioningState : testConnection
Name : ps9709
Etag : W/"4580a2e2-2fab-4cff-88eb-92013a76b5a8"
Id : /subscriptions/{subscriptionId}/resourceGroups/testRg/providers/Microsoft.Network/vpnGateways/testvpngw/vpnConnections/testConnection
RoutingConfiguration : {
"AssociatedRouteTable": {
"Id": "/subscriptions/{subscriptionId}/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/westushub/hubRouteTables/defaultRouteTable"
}
"PropagatedRouteTables": {
"Labels": [],
"Ids": [
{
"Id": "/subscriptions/{subscriptionId}/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/westushub/hubRouteTables/defaultRouteTable"
}
]
},
"VnetRoutes": {
"StaticRoutes": []
}
}
Met het bovenstaande maakt u een resourcegroep, Virtual WAN, Virtual Network, Virtual Hub en een VpnSite in VS - west in de resourcegroep testRG in Azure. Hierna wordt een VPN-gateway gemaakt in de virtuele hub met 2 schaaleenheden.
Zodra de gateway is gemaakt, is deze verbonden met de VpnSite met behulp van de opdracht New-AzVpnConnection.
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"
New-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw" -VirtualHubId $virtualHub.Id -VpnGatewayScaleUnit 2
$vpnGateway = Get-AzVpnGateway -ResourceGroupName "testRG" -Name "testvpngw"
$vpnSiteAddressSpaces = New-Object string[] 2
$vpnSiteAddressSpaces[0] = "192.168.2.0/24"
$vpnSiteAddressSpaces[1] = "192.168.3.0/24"
$vpnSiteLink1 = New-AzVpnSiteLink -Name "testVpnSiteLink1" -IpAddress "15.25.35.45" -LinkProviderName "SomeTelecomProvider" -LinkSpeedInMbps "10"
$vpnSiteLink2 = New-AzVpnSiteLink -Name "testVpnSiteLink2" -IpAddress "15.25.35.55" -LinkProviderName "SomeTelecomProvider2" -LinkSpeedInMbps "100"
$vpnSite = New-AzVpnSite -ResourceGroupName "testRG" -Name "testVpnSite" -Location "West US" -VirtualWan $virtualWan -AddressSpace $vpnSiteAddressSpaces -DeviceModel "SomeDevice" -DeviceVendor "SomeDeviceVendor" -VpnSiteLink @($vpnSiteLink1, $vpnSiteLink2)
$vpnSiteLinkConnection1 = New-AzVpnSiteLinkConnection -Name "testLinkConnection1" -VpnSiteLink $vpnSite.VpnSiteLinks[0] -ConnectionBandwidth 100
$vpnSiteLinkConnection2 = New-AzVpnSiteLinkConnection -Name "testLinkConnection2" -VpnSiteLink $vpnSite.VpnSiteLinks[1] -ConnectionBandwidth 10
New-AzVpnConnection -ResourceGroupName $vpnGateway.ResourceGroupName -ParentResourceName $vpnGateway.Name -Name "testConnection" -VpnSite $vpnSite -VpnSiteLinkConnection @($vpnSiteLinkConnection1, $vpnSiteLinkConnection2)
Met het bovenstaande maakt u een resourcegroep, Virtual WAN, Virtual Network, Virtual Hub en een VpnSite met 1 VpnSiteLinks in VS - west in de resourcegroep testRG in Azure. Hierna wordt een VPN-gateway gemaakt in de virtuele hub. Zodra de gateway is gemaakt, is deze verbonden met de VpnSite met behulp van de opdracht New-AzVpnConnection met 1 VpnSiteLinkConnections met de VpnSiteLink van de VpnSite.
Parameters
-AsJob
Cmdlet op de achtergrond uitvoeren
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Confirm
U wordt 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 |
-ConnectionBandwidthInMbps
De bandbreedte die moet worden verwerkt door deze verbinding in mbps.
Type: | UInt32 |
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 |
-EnableBgp
BGP inschakelen voor deze verbinding
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-EnableInternetSecurity
Internetbeveiliging inschakelen voor deze verbinding
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-IpSecPolicy
De bandbreedte die moet worden verwerkt door deze verbinding in mbps.
Type: | PSIpsecPolicy |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Name
De resourcenaam.
Type: | String |
Aliassen: | ResourceName, VpnConnectionName |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ParentObject
De bovenliggende VpnGateway voor deze verbinding.
Type: | PSVpnGateway |
Aliassen: | ParentVpnGateway, VpnGateway |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-ParentResourceId
De resource-id van de bovenliggende VpnGateway voor deze verbinding.
Type: | String |
Aliassen: | ParentVpnGatewayId, VpnGatewayId |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-ParentResourceName
De naam van de resourcegroep.
Type: | String |
Aliassen: | ParentVpnGatewayName, VpnGatewayName |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ResourceGroupName
De naam van de resourcegroep.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RoutingConfiguration
Routeringsconfiguratie voor deze verbinding
Type: | PSRoutingConfiguration |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-SharedKey
De gedeelde sleutel die nodig is om deze verbinding in te stellen.
Type: | SecureString |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-TrafficSelectorPolicy
Een lijst met beleidsregels voor verkeersselector.
Type: | PSTrafficSelectorPolicy[] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-UseLocalAzureIpAddress
Gebruik het lokale Ip-adres van Azure als bronadres tijdens het initiƫren van de verbinding.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-UsePolicyBasedTrafficSelectors
Gebruik op beleid gebaseerde verkeerskiezers voor deze verbinding.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-VpnConnectionProtocolType
Gatewayverbindingsprotocol:IKEv1/IKEv2
Type: | String |
Geaccepteerde waarden: | IKEv1, IKEv2 |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-VpnSite
De externe VPN-site waarmee deze virtuele hub-netwerkverbinding is verbonden.
Type: | PSVpnSite |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-VpnSiteId
De externe VPN-site waarmee deze virtuele hub-netwerkverbinding is verbonden.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-VpnSiteLinkConnection
De lijst met VpnSiteLinkConnections die deze VpnConnection heeft.
Type: | PSVpnSiteLinkConnection[] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-WhatIf
Toont wat er zou gebeuren als de cmdlet wordt uitgevoerd. De cmdlet wordt niet uitgevoerd.
Type: | SwitchParameter |
Aliassen: | wi |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
Invoerwaarden
Uitvoerwaarden
Verwante koppelingen
Azure PowerShell