共用方式為


New-AzExpressRouteConnection

建立 ExpressRoute 連線,將 ExpressRoute 閘道連線到內部部署 ExpressRoute 線路

語法

ByExpressRouteGatewayName (預設值)

New-AzExpressRouteConnection
    -ResourceGroupName <String>
    -ExpressRouteGatewayName <String>
    -Name <String>
    -ExpressRouteCircuitPeeringId <String>
    [-AuthorizationKey <String>]
    [-RoutingWeight <UInt32>]
    [-EnableInternetSecurity]
    [-RoutingConfiguration <PSRoutingConfiguration>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByExpressRouteGatewayObject

New-AzExpressRouteConnection
    -ExpressRouteGatewayObject <PSExpressRouteGateway>
    -Name <String>
    -ExpressRouteCircuitPeeringId <String>
    [-AuthorizationKey <String>]
    [-RoutingWeight <UInt32>]
    [-EnableInternetSecurity]
    [-RoutingConfiguration <PSRoutingConfiguration>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByExpressRouteGatewayResourceId

New-AzExpressRouteConnection
    -ParentResourceId <String>
    -Name <String>
    -ExpressRouteCircuitPeeringId <String>
    [-AuthorizationKey <String>]
    [-RoutingWeight <UInt32>]
    [-EnableInternetSecurity]
    [-RoutingConfiguration <PSRoutingConfiguration>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

在內部部署 ExpressRoute 線路 BGP 對等互連至虛擬中樞內的 ExpressRoute 閘道之間建立 ExpressRoute 連線。

範例

範例 1

New-AzResourceGroup -Location "West Central US" -Name "testRG"
$virtualWan = New-AzVirtualWan -ResourceGroupName testRG -Name myVirtualWAN -Location "West Central US"
$virtualHub = New-AzVirtualHub -VirtualWan $virtualWan -ResourceGroupName "testRG" -Name "westushub" -AddressPrefix "10.0.0.1/24"
New-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw" -VirtualHubId $virtualHub.Id -MinScaleUnits 2
$ExpressRouteGateway = Get-AzExpressRouteGateway -ResourceGroupName "testRG" -Name "testExpressRoutegw"
$ExpressRouteCircuit = New-AzExpressRouteCircuit -ResourceGroupName "testRG" -Name "testExpressRouteCircuit" -Location "West Central US" -SkuTier Premium -SkuFamily MeteredData -ServiceProviderName "Equinix" -PeeringLocation "Silicon Valley" -BandwidthInMbps 200
Add-AzExpressRouteCircuitPeeringConfig -Name "AzurePrivatePeering" -ExpressRouteCircuit $ExpressRouteCircuit -PeeringType AzurePrivatePeering -PeerASN 100 -PrimaryPeerAddressPrefix "123.0.0.0/30" -SecondaryPeerAddressPrefix "123.0.0.4/30" -VlanId 300
$ExpressRouteCircuit = Set-AzExpressRouteCircuit -ExpressRouteCircuit $ExpressRouteCircuit
$ExpressRouteCircuitPeeringId = $ExpressRouteCircuit.Peerings[0].Id
New-AzExpressRouteConnection -ResourceGroupName $ExpressRouteGateway.ResourceGroupName -ExpressRouteGatewayName $ExpressRouteGateway.Name -Name "testConnection" -ExpressRouteCircuitPeeringId $ExpressRouteCircuitPeeringId -RoutingWeight 20
ExpressRouteCircuitPeeringId       : Microsoft.Azure.Commands.Network.Models.PSResourceId
AuthorizationKey                   :
RoutingWeight                      : 20
ProvisioningState                  : Succeeded
Name                               : testConnection
Etag                               : W/"4580a2e2-2fab-4cff-88eb-92013a76b5a8"
Id                                 : /subscriptions/{subscriptionId}/resourceGroups/ps9361/providers/Microsoft.Network/ExpressRouteGateways/testExpressRoutegw/expressRouteConnections/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": []
                                       }
                                     }

上述內容會在美國中西部建立資源群組、虛擬 WAN、虛擬網路、虛擬中樞、Express Route 閘道,以及 Azure 中 「testRG」資源群組中具有私人對等互連的 ExpressRoute 線路。 建立閘道之後,就會使用 New-AzExpressRouteConnection 命令連線到 ExpressRoute 線路對等互連。

參數

-AsJob

在背景執行 Cmdlet

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-AuthorizationKey

從 ExpressRoute 線路擁有者取得的金鑰,以便能夠建立與不同訂用帳戶中的閘道的連線。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False
別名:參閱

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

參數屬性

類型:IAzureContextContainer
預設值:None
支援萬用字元:False
不要顯示:False
別名:AzContext, AzureRmContext, AzureCredential

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-EnableInternetSecurity

啟用此 ExpressRoute 閘道連線的因特網安全性

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ExpressRouteCircuitPeeringId

要建立此 Express Route 閘道連線的 Express Route 線路對等互連的資源識別碼。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ExpressRouteGatewayName

資源組名。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByExpressRouteGatewayName
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ExpressRouteGatewayObject

此連線的父 ExpressRouteGateway。

參數屬性

類型:PSExpressRouteGateway
預設值:None
支援萬用字元:False
不要顯示:False
別名:ExpressRouteGateway

參數集

ByExpressRouteGatewayObject
Position:Named
必要:True
來自管線的值:True
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-Name

資源名稱。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False
別名:資源名稱, ExpressRoute連線名稱

參數集

(All)
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-ParentResourceId

此連線的父 ExpressRouteGateway 資源識別碼。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False
別名:ExpressRouteGatewayId

參數集

ByExpressRouteGatewayResourceId
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:True
來自剩餘引數的值:False

-ResourceGroupName

資源組名。

參數屬性

類型:String
預設值:None
支援萬用字元:False
不要顯示:False

參數集

ByExpressRouteGatewayName
Position:Named
必要:True
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-RoutingConfiguration

此連線的路由配置

參數屬性

類型:PSRoutingConfiguration
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-RoutingWeight

需要指派給此連線的封包路由權重。

參數屬性

類型:UInt32
預設值:None
支援萬用字元:False
不要顯示:False

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 指令未執行。

參數屬性

類型:SwitchParameter
預設值:None
支援萬用字元:False
不要顯示:False
別名:威斯康星州

參數集

(All)
Position:Named
必要:False
來自管線的值:False
來自管線按屬性名稱的值:False
來自剩餘引數的值:False

CommonParameters

此 Cmdlet 支援常見參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters

輸入

PSExpressRouteGateway

String

輸出

PSExpressRouteConnection