ExpressRoute在中國已經Preview了。shell
本篇文章講介紹ExpressRoute如何配置。ide
Express Route的邏輯拓撲結構:ui
在配置Express Route以前,須要作VLAN和IP地址的規劃:ssr
Router部署 |
IP Prefix it |
Peeringio |
VLAN IDtable |
Primarytest |
172.16.1.0/30import |
Private |
555 |
Secondary |
172.16.2.0/30 |
Private |
555 |
Primary |
172.16.1.4/30 |
Public |
556 |
Secondary |
172.16.2.4/30 |
Public |
556 |
因爲Express Route要求都是冗餘配置,因此全部的內容都是兩個:兩個VLAN,兩根連接,public/private peering。
規劃好後,在Azure上作以下配置:
Import-Module 'C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\ExpressRoute\ExpressRoute.psd1'
Get-AzureDedicatedCircuitServiceProvider
Name DedicatedCircuitLocations DedicatedCircuitBandwidths
---- ------------------------- --------------------------
Beijing Telecom Ethernet Beijing 200Mbps:200, 500Mbps:500, 1Gbps:1000, 10Gbps:10000
New-AzureDedicatedCircuit -CircuitName hwtest200 -Bandwidth 200 -Location Beijing -ServiceProviderName "Beijing Telecom Ethernet"
CircuitName : hwtest200
Location : Beijing
ServiceKey : xxxxxxxxxxxxx
ServiceProviderName : beijing telecom ethernet
ServiceProviderProvisioningState : NotProvisioned
Sku : Standard
Status : Enabled
其中SeviceKey是標識這條Circuit的惟一標識符,須要把串數字提供給電信。
目前的狀態是NotProvisioned,等電信作好專線後,其狀態將轉換爲Provisoned。
在Powershell中定義變量:
$ServiceKey = "02a830bf-817d-45fd-b5dd-08312cf61682"
$MD5Hash = "dfeaf10390e560aea745ccba53e044ed"
$private_Subnet_Primary = "172.16.1.0/30"
$private_Subnet_Secondary = "172.16.2.0/30"
$public_Subnet_Primary = "172.16.1.4/30"
$public_Subnet_Secondary = "172.16.2.4/30"
$ASN = 65002
$VLANPrivate = "555"
$VLANPublic = "556"
New-AzureBGPPeering -ServiceKey $ServiceKey `
-PrimaryPeerSubnet $private_Subnet_Primary `
-SecondaryPeerSubnet $private_Subnet_Secondary `
-PeerAsn $ASN `
-VlanId $VLANPrivate `
–AccessType Private
AdvertisedPublicPrefixes :
AdvertisedPublicPrefixesState :
AzureAsn : 12076
CustomerAutonomousSystemNumber : 0
PeerAsn : 65002
PrimaryAzurePort : BTEXP-BJB-06GMR-CIS-1-PRI-A
PrimaryPeerSubnet : 172.16.1.0/30
RoutingRegistryName :
SecondaryAzurePort : BTEXP-BJB-06GMR-CIS-2-SEC-A
SecondaryPeerSubnet : 172.16.2.0/30
State : Enabled
VlanId : 555
New-AzureBGPPeering -ServiceKey $ServiceKey `
-PrimaryPeerSubnet $public_Subnet_Primary `
-SecondaryPeerSubnet $public_Subnet_Secondary `
-PeerAsn $ASN `
-VlanId $VLANPublic `
-AccessType Public
AdvertisedPublicPrefixes :
AdvertisedPublicPrefixesState :
AzureAsn : 12076
CustomerAutonomousSystemNumber : 0
PeerAsn : 65002
PrimaryAzurePort : BTEXP-BJB-06GMR-CIS-1-PRI-A
PrimaryPeerSubnet : 172.16.1.4/30
RoutingRegistryName :
SecondaryAzurePort : BTEXP-BJB-06GMR-CIS-2-SEC-A
SecondaryPeerSubnet : 172.16.2.4/30
State : Enabled
VlanId : 556
New-AzureDedicatedCircuitLink -ServiceKey $ServiceKey -VNetName $Vnet