使用 Azure CLI 配置 ExpressRoute DirectConfigure ExpressRoute Direct by using the Azure CLI

使用 ExpressRoute Direct,可以直接连接到 Microsoft 战略性分布在全球的对等互连位置的的全球网络。ExpressRoute Direct gives you the ability to directly connect to Microsoft's global network through peering locations strategically distributed across the world. 有关详细信息,请参阅关于 ExpressRoute Direct ConnectFor more information, see About ExpressRoute Direct Connect.

创建资源Create the resource

  1. 登录到 Azure 并选择包含 ExpressRoute 的订阅。Sign in to Azure and select the subscription that contains ExpressRoute. ExpressRoute Direct 资源和 ExpressRoute 线路必须位于同一订阅中。The ExpressRoute Direct resource and your ExpressRoute circuits must be in the same subscription. 在 Azure CLI 中,请运行下列命令:In the Azure CLI, run the following commands:

    az login
    

    检查该帐户的订阅:Check the subscriptions for the account:

    az account list 
    

    选择要为其创建 ExpressRoute 线路的订阅:Select the subscription for which you want to create an ExpressRoute circuit:

    az account set --subscription "<subscription ID>"
    
  2. 将你的订阅重新注册到 Microsoft.Network 以访问 expressrouteportslocation 和 expressrouteport APIRe-register your subscription to Microsoft.Network to access the expressrouteportslocation and expressrouteport APIs

    az provider register --namespace Microsoft.Network
    
  3. 列出支持 ExpressRoute Direct 的所有位置:List all locations where ExpressRoute Direct is supported:

    az network express-route port location list
    

    示例输出Example output

    [
    {
     "address": "21715 Filigree Court, DC2, Building F, Ashburn, VA 20147",
     "availableBandwidths": [],
     "contact": "support@equinix.com",
     "id": "/subscriptions/<subscriptionID>/providers/Microsoft.Network/expressRoutePortsLocations/Equinix-Ashburn-DC2",
     "location": null,
     "name": "Equinix-Ashburn-DC2",
     "provisioningState": "Succeeded",
     "tags": null,
     "type": "Microsoft.Network/expressRoutePortsLocations"
    },
    {
     "address": "1950 N. Stemmons Freeway, Suite 1039A, DA3, Dallas, TX 75207",
     "availableBandwidths": [],
     "contact": "support@equinix.com",
     "id": "/subscriptions/<subscriptionID>/providers/Microsoft.Network/expressRoutePortsLocations/Equinix-Dallas-DA3",
     "location": null,
     "name": "Equinix-Dallas-DA3",
     "provisioningState": "Succeeded",
     "tags": null,
     "type": "Microsoft.Network/expressRoutePortsLocations"
    },
    {
     "address": "111 8th Avenue, New York, NY 10011",
     "availableBandwidths": [],
     "contact": "support@equinix.com",
     "id": "/subscriptions/<subscriptionID>/providers/Microsoft.Network/expressRoutePortsLocations/Equinix-New-York-NY5",
     "location": null,
     "name": "Equinix-New-York-NY5",
     "provisioningState": "Succeeded",
     "tags": null,
     "type": "Microsoft.Network/expressRoutePortsLocations"
    },
    {
     "address": "11 Great Oaks Blvd, SV1, San Jose, CA 95119",
     "availableBandwidths": [],
     "contact": "support@equinix.com",
     "id": "/subscriptions/<subscriptionID>/providers/Microsoft.Network/expressRoutePortsLocations/Equinix-San-Jose-SV1",
     "location": null,
     "name": "Equinix-San-Jose-SV1",
     "provisioningState": "Succeeded",
     "tags": null,
     "type": "Microsoft.Network/expressRoutePortsLocations"
    },
    {
     "address": "2001 Sixth Ave., Suite 350, SE2, Seattle, WA 98121",
     "availableBandwidths": [],
     "contact": "support@equinix.com",
     "id": "/subscriptions/<subscriptionID>/providers/Microsoft.Network/expressRoutePortsLocations/Equinix-Seattle-SE2",
     "location": null,
     "name": "Equinix-Seattle-SE2",
     "provisioningState": "Succeeded",
     "tags": null,
     "type": "Microsoft.Network/expressRoutePortsLocations"
    }
    ]
    
  4. 确定上一步骤中列出的某个位置是否具有可用带宽:Determine whether one of the locations listed in the preceding step has available bandwidth:

    az network express-route port location show -l "Equinix-Ashburn-DC2"
    

    示例输出Example output

    {
    "address": "21715 Filigree Court, DC2, Building F, Ashburn, VA 20147",
    "availableBandwidths": [
     {
       "offerName": "100 Gbps",
       "valueInGbps": 100
     }
    ],
    "contact": "support@equinix.com",
    "id": "/subscriptions/<subscriptionID>/providers/Microsoft.Network/expressRoutePortsLocations/Equinix-Ashburn-DC2",
    "location": null,
    "name": "Equinix-Ashburn-DC2",
    "provisioningState": "Succeeded",
    "tags": null,
    "type": "Microsoft.Network/expressRoutePortsLocations"
    }
    
  5. 创建 ExpressRoute Direct 资源,该资源基于在上一步骤中所选择的位置。Create an ExpressRoute Direct resource that's based on the location you chose in the preceding steps.

    ExpressRoute Direct 同时支持 QinQ 和 Dot1Q 封装。ExpressRoute Direct supports both QinQ and Dot1Q encapsulation. 如果选择了 QinQ,则会为每个 ExpressRoute 线路动态分配 S-Tag,并且每个线路在整个 ExpressRoute Direct 资源中将是唯一的。If you select QinQ, each ExpressRoute circuit is dynamically assigned an S-Tag and is unique throughout the ExpressRoute Direct resource. 线路上的每个 C-Tag 在该线路上必须是唯一的,但在整个 ExpressRoute Direct 资源中不必唯一。Each C-Tag on the circuit must be unique on the circuit but not across the ExpressRoute Direct resource.

    如果选择了 Dot1Q 封装,则必须在整个 ExpressRoute Direct 资源中管理 C-Tag (VLAN) 的唯一性。If you select Dot1Q encapsulation, you must manage uniqueness of the C-Tag (VLAN) across the entire ExpressRoute Direct resource.

    重要

    ExpressRoute Direct 只能采用一种封装类型。ExpressRoute Direct can be only one encapsulation type. 在创建 ExpressRoute Direct 资源后,无法更改封装类型。You can't change the encapsulation type after you create the ExpressRoute Direct resource.

    az network express-route port create -n $name -g $RGName --bandwidth 100 gbps  --encapsulation QinQ | Dot1Q --peering-location $PeeringLocationName -l $AzureRegion 
    

    备注

    还可以将“封装”属性设置为“Dot1Q”。You also can set the Encapsulation attribute to Dot1Q.

    示例输出Example output

    {
    "allocationDate": "Wednesday, October 17, 2018",
    "bandwidthInGbps": 100,
    "circuits": null,
    "encapsulation": "Dot1Q",
    "etag": "W/\"<etagnumber>\"",
    "etherType": "0x8100",
    "id": "/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRoutePorts/Contoso-Direct",
    "links": [
     {
       "adminState": "Disabled",
       "connectorType": "LC",
       "etag": "W/\"<etagnumber>\"",
       "id": "/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRoutePorts/Contoso-Direct/links/link1",
       "interfaceName": "HundredGigE2/2/2",
       "name": "link1",
       "patchPanelId": "PPID",
       "provisioningState": "Succeeded",
       "rackId": "RackID",
       "resourceGroup": "Contoso-Direct-rg",
       "routerName": "tst-09xgmr-cis-1",
       "type": "Microsoft.Network/expressRoutePorts/links"
     },
     {
       "adminState": "Disabled",
       "connectorType": "LC",
       "etag": "W/\"<etagnumber>\"",
       "id": "/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRoutePorts/Contoso-Direct/links/link2",
       "interfaceName": "HundredGigE2/2/2",
       "name": "link2",
       "patchPanelId": "PPID",
       "provisioningState": "Succeeded",
       "rackId": "RackID",
       "resourceGroup": "Contoso-Direct-rg",
       "routerName": "tst-09xgmr-cis-2",
       "type": "Microsoft.Network/expressRoutePorts/links"
     }
    ],
    "location": "chinaeast",
    "mtu": "1500",
    "name": "Contoso-Direct",
    "peeringLocation": "Equinix-Ashburn-DC2",
    "provisionedBandwidthInGbps": 0.0,
    "provisioningState": "Succeeded",
    "resourceGroup": "Contoso-Direct-rg",
    "resourceGuid": "02ee21fe-4223-4942-a6bc-8d81daabc94f",
    "tags": null,
    "type": "Microsoft.Network/expressRoutePorts"
    }  
    

使用此过程来执行第 1 层测试。Use this process to conduct a layer 1 test. 请确保每个交叉连接在主端口和辅助端口的每个路由器上都有正确的补丁。Ensure that each cross-connection is properly patched into each router in the primary and secondary ports.

  1. 将链接设置为“启用”。Set links to Enabled. 重复此步骤以将每个链接设置为“启用”。Repeat this step to set each link to Enabled.

    Links[0] 是主端口,Links[1] 是辅助端口。Links[0] is the primary port and Links[1] is the secondary port.

    az network express-route port update -n Contoso-Direct -g Contoso-Direct-rg --set links[0].adminState="Enabled"
    
    az network express-route port update -n Contoso-Direct -g Contoso-Direct-rg --set links[1].adminState="Enabled"
    

    示例输出Example output

    {
    "allocationDate": "Wednesday, October 17, 2018",
    "bandwidthInGbps": 100,
    "circuits": null,
    "encapsulation": "Dot1Q",
    "etag": "W/\"<etagnumber>\"",
    "etherType": "0x8100",
    "id": "/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRoutePorts/Contoso-Direct",
    "links": [
     {
       "adminState": "Enabled",
       "connectorType": "LC",
       "etag": "W/\"<etagnumber>\"",
       "id": "/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRoutePorts/Contoso-Direct/links/link1",
       "interfaceName": "HundredGigE2/2/2",
       "name": "link1",
       "patchPanelId": "PPID",
       "provisioningState": "Succeeded",
       "rackId": "RackID",
       "resourceGroup": "Contoso-Direct-rg",
       "routerName": "tst-09xgmr-cis-1",
       "type": "Microsoft.Network/expressRoutePorts/links"
     },
     {
       "adminState": "Enabled",
       "connectorType": "LC",
       "etag": "W/\"<etagnumber>\"",
       "id": "/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRoutePorts/Contoso-Direct/links/link2",
       "interfaceName": "HundredGigE2/2/2",
       "name": "link2",
       "patchPanelId": "PPID",
       "provisioningState": "Succeeded",
       "rackId": "RackID",
       "resourceGroup": "Contoso-Direct-rg",
       "routerName": "tst-09xgmr-cis-2",
       "type": "Microsoft.Network/expressRoutePorts/links"
     }
    ],
    "location": "westus",
    "mtu": "1500",
    "name": "Contoso-Direct",
    "peeringLocation": "Equinix-Ashburn-DC2",
    "provisionedBandwidthInGbps": 0.0,
    "provisioningState": "Succeeded",
    "resourceGroup": "Contoso-Direct-rg",
    "resourceGuid": "<resourceGUID>",
    "tags": null,
    "type": "Microsoft.Network/expressRoutePorts"
    }
    

    使用相同的过程来关闭端口,方法是使用 AdminState = "Disabled"Use the same procedure to down the ports by using AdminState = "Disabled".

创建线路Create a circuit

默认情况下,可以在包含 ExpressRoute Direct 资源的订阅中创建 10 条线路。By default, you can create 10 circuits in the subscription that contains the ExpressRoute Direct resource. Microsoft 支持部门可以增加默认限制。Microsoft Support can increase the default limit. 你负责跟踪预配的和已使用的带宽。You're responsible for tracking provisioned and utilized bandwidth. 预配带宽是 ExpressRoute Direct 资源上所有线路的带宽总和。Provisioned bandwidth is the sum of the bandwidth of all the circuits on the ExpressRoute Direct resource. 利用带宽是基础物理接口的物理用法。Utilized bandwidth is the physical usage of the underlying physical interfaces.

只能在 ExpressRoute Direct 上使用其他线路带宽来支持上面概述的场景。You can use additional circuit bandwidths on ExpressRoute Direct only to support the scenarios outlined here. 带宽为 40 Gbps 和 100 Gbps。The bandwidths are 40 Gbps and 100 Gbps.

SkuTier 可以为“本地”、“标准”或“高级”。SkuTier can be Local, Standard, or Premium.

SkuFamily 只能为 MeteredData。SkuFamily can only be MeteredData. ExpressRoute Direct 不支持“无限制”。Unlimited is not supported on ExpressRoute Direct.

在 ExpressRoute Direct 资源上创建线路:Create a circuit on the ExpressRoute Direct resource:

az network express-route create --express-route-port "/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRoutePorts/Contoso-Direct" -n "Contoso-Direct-ckt" -g "Contoso-Direct-rg" --sku-family MeteredData --sku-tier Standard --bandwidth 100 Gbps

其他带宽包括 5 Gbps、10 Gbps 和 40 Gbps。Other bandwidths include 5 Gbps, 10 Gbps, and 40 Gbps.

示例输出Example output

{
"allowClassicOperations": false,
"allowGlobalReach": false,
"authorizations": [],
"bandwidthInGbps": 100.0,
"circuitProvisioningState": "Enabled",
"etag": "W/\"<etagnumber>\"",
"expressRoutePort": {
  "id": "/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRoutePorts/Contoso-Direct",
  "resourceGroup": "Contoso-Direct-rg"
},
"gatewayManagerEtag": "",
"id": "/subscriptions/<subscriptionID>/resourceGroups/Contoso-Direct-rg/providers/Microsoft.Network/expressRouteCircuits/ERDirect-ckt-cli",
"location": "westus",
"name": "ERDirect-ckt-cli",
"peerings": [],
"provisioningState": "Succeeded",
"resourceGroup": "Contoso-Direct-rg",
"serviceKey": "<serviceKey>",
"serviceProviderNotes": null,
"serviceProviderProperties": null,
"serviceProviderProvisioningState": "Provisioned",
"sku": {
  "family": "MeteredData",
  "name": "Standard_MeteredData",
  "tier": "Standard"
},
"stag": null,
"tags": null,
"type": "Microsoft.Network/expressRouteCircuits"
}  

后续步骤Next steps

有关 ExpressRoute Direct 的详细信息,请参阅概述For more information about ExpressRoute Direct, see the overview.