New-AzVirtualHubVnetConnection
Met de cmdlet New-AzVirtualHubVnetConnection maakt u een HubVirtualNetworkConnection-resource die een virtueel netwerk koppelt aan de Azure Virtual Hub.
Syntaxis
New-AzVirtualHubVnetConnection
-ResourceGroupName <String>
-ParentResourceName <String>
-Name <String>
-RemoteVirtualNetwork <PSVirtualNetwork>
[-EnableInternetSecurity]
[-EnableInternetSecurityFlag <Boolean>]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVirtualHubVnetConnection
-ResourceGroupName <String>
-ParentResourceName <String>
-Name <String>
-RemoteVirtualNetworkId <String>
[-EnableInternetSecurity]
[-EnableInternetSecurityFlag <Boolean>]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVirtualHubVnetConnection
-ParentObject <PSVirtualHub>
-Name <String>
-RemoteVirtualNetwork <PSVirtualNetwork>
[-EnableInternetSecurity]
[-EnableInternetSecurityFlag <Boolean>]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVirtualHubVnetConnection
-ParentObject <PSVirtualHub>
-Name <String>
-RemoteVirtualNetworkId <String>
[-EnableInternetSecurity]
[-EnableInternetSecurityFlag <Boolean>]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVirtualHubVnetConnection
-ParentResourceId <String>
-Name <String>
-RemoteVirtualNetwork <PSVirtualNetwork>
[-EnableInternetSecurity]
[-EnableInternetSecurityFlag <Boolean>]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzVirtualHubVnetConnection
-ParentResourceId <String>
-Name <String>
-RemoteVirtualNetworkId <String>
[-EnableInternetSecurity]
[-EnableInternetSecurityFlag <Boolean>]
[-RoutingConfiguration <PSRoutingConfiguration>]
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
Met de cmdlet New-AzVirtualHubVnetConnection maakt u een HubVirtualNetworkConnection-resource die een virtueel netwerk koppelt aan de Azure Virtual Hub.
Voorbeelden
Voorbeeld 1
New-AzResourceGroup -Location "West US" -Name "testRG"
$frontendSubnet = New-AzVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix "10.0.1.0/24"
$backendSubnet = New-AzVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix "10.0.2.0/24"
$remoteVirtualNetwork = New-AzVirtualNetwork -Name "MyVirtualNetwork" -ResourceGroupName "testRG" -Location "West US" -AddressPrefix "10.0.0.0/16" -Subnet $frontendSubnet,$backendSubnet
$virtualWan = New-AzVirtualWan -ResourceGroupName "testRG" -Name "myVirtualWAN" -Location "West US"
New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.1.0/24"
New-AzVirtualHubVnetConnection -ResourceGroupName "testRG" -VirtualHubName "westushub" -Name "testvnetconnection" -RemoteVirtualNetwork $remoteVirtualNetwork
Name : testvnetconnection
Id : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualHubs/westushub/hubVirtualNetworkConnections/testvnetconnection
RemoteVirtualNetwork : /subscriptions/{subscriptionId}/resourceGroups/testRG/providers/Microsoft.Network/virtualNetworks/MyVirtualNetwork
EnableInternetSecurity : False
ProvisioningState : Succeeded
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 in VS - centraal in die resourcegroep in Azure. Hierna wordt een virtuele netwerkverbinding gemaakt die het virtuele netwerk koppelt aan de virtuele hub.
Voorbeeld 2
Met de cmdlet New-AzVirtualHubVnetConnection maakt u een HubVirtualNetworkConnection-resource die een virtueel netwerk koppelt aan de Azure Virtual Hub. (automatisch gegenereerd)
New-AzVirtualHubVnetConnection -EnableInternetSecurity -Name 'testvnetconnection' -ParentResourceName 'westushub' -RemoteVirtualNetwork <PSVirtualNetwork> -ResourceGroupName 'testRG'
Voorbeeld 3
$rgName = "testRg"
$virtualHubName = "testHub"
$frontendSubnet = New-AzVirtualNetworkSubnetConfig -Name frontendSubnet -AddressPrefix "10.0.1.0/24"
$backendSubnet = New-AzVirtualNetworkSubnetConfig -Name backendSubnet -AddressPrefix "10.0.2.0/24"
$remoteVirtualNetwork = New-AzVirtualNetwork -Name "MyVirtualNetwork" -ResourceGroupName $rgName -Location "West US" -AddressPrefix "10.0.0.0/16" -Subnet $frontendSubnet,$backendSubnet
$rt1 = Get-AzVHubRouteTable -ResourceGroupName $rgName -VirtualHubName $virtualHubName -Name "defaultRouteTable"
$rt2 = Get-AzVHubRouteTable -ResourceGroupName $rgName -VirtualHubName $virtualHubName -Name "noneRouteTable"
$route1 = New-AzStaticRoute -Name "route1" -AddressPrefix @("10.20.0.0/16", "10.30.0.0/16")-NextHopIpAddress "10.90.0.5"
$routingconfig = New-AzRoutingConfiguration -AssociatedRouteTable $rt1.Id -Label @("testLabel") -Id @($rt2.Id) -StaticRoute @($route1)
AssociatedRouteTable : "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/hubRouteTables/defaultRouteTable"
PropagatedRouteTables : {
"Labels": [
"testLabel"
],
"Ids": [
{
"Id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/hubRouteTables/noneRouteTable"
}
]
}
VnetRoutes : {
"StaticRoutes": [
{
"Name": "route1",
"AddressPrefixes": [
"10.20.0.0/16",
"10.30.0.0/16"
],
"NextHopIpAddress": "10.90.0.5"
}
]
}
New-AzVirtualHubVnetConnection -ResourceGroupName $rgName -VirtualHubName $virtualHubName -Name "testvnetconnection" -RemoteVirtualNetwork $remoteVirtualNetwork -RoutingConfiguration $routingconfig
Met het bovenstaande maakt u een nieuwe routeringsconfiguratie en maakt u statische routes in de routeringsconfiguratie met de volgende hop als een opgegeven IP-adres. Deze routeringsconfiguratie kan vervolgens worden doorgegeven aan de opdracht New-AzVirtualHubVnetConnection als parameter -RoutingConfiguration.
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 |
-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 |
-EnableInternetSecurity
Internetbeveiliging inschakelen voor deze verbinding
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-EnableInternetSecurityFlag
Internetbeveiliging inschakelen voor deze verbinding
Type: | Nullable<T>[Boolean] |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-Name
De resourcenaam.
Type: | String |
Aliassen: | ResourceName, HubVirtualNetworkConnectionName |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-ParentObject
De bovenliggende resource.
Type: | PSVirtualHub |
Aliassen: | VirtualHub, ParentVirtualHub |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-ParentResourceId
De bovenliggende resource.
Type: | String |
Aliassen: | VirtualHubId, ParentVirtualHubId |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-ParentResourceName
De naam van de resourcegroep.
Type: | String |
Aliassen: | VirtualHubName, ParentVirtualHubName |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RemoteVirtualNetwork
Het externe virtuele netwerk waarmee deze virtuele hubverbinding is verbonden.
Type: | PSVirtualNetwork |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-RemoteVirtualNetworkId
Het externe virtuele netwerk waarmee deze virtuele hubverbinding is verbonden.
Type: | String |
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 |
-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
Uitvoerwaarden
Verwante koppelingen
Azure PowerShell