Get-AzVHubRouteTable
擷取與 VirtualHub 相關聯的中樞路由表資源。
語法
Get-AzVHubRouteTable
-ResourceGroupName <String>
-HubName <String>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzVHubRouteTable
-VirtualHub <PSVirtualHub>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Get-AzVHubRouteTable
-ParentResourceId <String>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
取得與指定虛擬中樞相關聯的指定中樞路由表。
範例
範例 1
New-AzVirtualWan -ResourceGroupName "testRg" -Name "testWan" -Location "westcentralus" -VirtualWANType "Standard" -AllowVnetToVnetTraffic -AllowBranchToBranchTraffic
$virtualWan = Get-AzVirtualWan -ResourceGroupName "testRg" -Name "testWan"
New-AzVirtualHub -ResourceGroupName "testRg" -Name "testHub" -Location "westcentralus" -AddressPrefix "10.0.0.0/16" -VirtualWan $virtualWan
$virtualHub = Get-AzVirtualHub -ResourceGroupName "testRg" -Name "testHub"
$fwIp = New-AzFirewallHubPublicIpAddress -Count 1
$hubIpAddresses = New-AzFirewallHubIpAddress -PublicIP $fwIp
New-AzFirewall -Name "testFirewall" -ResourceGroupName "testRg" -Location "westcentralus" -Sku AZFW_Hub -VirtualHubId $virtualHub.Id -HubIPAddress $hubIpAddresses
$firewall = Get-AzFirewall -Name "testFirewall" -ResourceGroupName "testRg"
$route1 = New-AzVHubRoute -Name "private-traffic" -Destination @("10.30.0.0/16", "10.40.0.0/16") -DestinationType "CIDR" -NextHop $firewall.Id -NextHopType "ResourceId"
New-AzVHubRouteTable -ResourceGroupName "testRg" -VirtualHubName "testHub" -Name "testRouteTable" -Route @($route1) -Label @("testLabel")
Get-AzVHubRouteTable -ResourceGroupName "testRg" -VirtualHubName "testHub" -Name "testRouteTable"
Name : testRouteTable
Id : /subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/hubRouteTables/testRouteTable
ProvisioningState : Succeeded
Labels : {testLabel}
Routes : [
{
"Name": "private-traffic",
"DestinationType": "CIDR",
"Destinations": [
"10.30.0.0/16",
"10.40.0.0/16"
],
"NextHopType": "ResourceId",
"NextHop": "/subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/azureFirewalls/testFirewall"
}
]
AssociatedConnections : []
PropagatingConnections : []
此命令會取得虛擬中樞的中樞路由表。
範例 2
$rgName = "testRg"
$virtualHubName = "testHub"
Get-AzVHubRouteTable -ResourceGroupName $rgName -VirtualHubName $virtualHubName
Name : defaultRouteTable
Id : /subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/hubRouteTables/defaultRouteTable
ProvisioningState : Succeeded
Labels : {testLabel}
Routes : []
AssociatedConnections : []
PropagatingConnections : []
Name : noneRouteTable
Id : /subscriptions/testSub/resourceGroups/testRg/providers/Microsoft.Network/virtualHubs/testHub/hubRouteTables/noneRouteTable
ProvisioningState : Succeeded
Labels : {testLabel}
Routes : []
AssociatedConnections : []
PropagatingConnections : []
此命令會列出指定 VirtualHub 中的所有中樞路由表。
參數
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-HubName
父資源名稱。
類型: | String |
別名: | VirtualHubName, ParentVirtualHubName, ParentResourceName |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Name
資源名稱。
類型: | String |
別名: | ResourceName, VirtualHubRouteTableName |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | True |
-ParentResourceId
父資源標識碼。
類型: | String |
別名: | VirtualHubId, ParentVirtualHubId |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ResourceGroupName
資源組名。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-VirtualHub
父資源。
類型: | PSVirtualHub |
別名: | ParentObject, ParentVirtualHub |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |