(Note: Azure treats ExpressRoute Gateways within the same region as a single logical routing entity sharing the same AS, but physically provisioned across primary and secondary circuits for high availability).
⚙️ BGP Peering Matrix & Neighborhoods
To achieve true deterministic routing, you will establish a cross-cloud mesh over Megaport's Virtual Cross Connects (VXCs): [1]
Megaport Router 1 (AS 100) — Primary Transit Node
- eBGP to AWS: Peering with AWS Direct Connect Gateway 1 & 2 (Remote AS 500).
- eBGP to OCI: Peering with OCI Dynamic Routing Gateway 1 (Remote AS 600).
- eBGP to Azure: Peering with Azure ExpressRoute Gateway 1 (Remote AS 700).
- iBGP Transit Link: Peering with Megaport Router 2 (Remote AS 200 via an overlay/inter-MCR link or by designating a shared cluster fabric). Note: In standard architectures, if using two different public/private ASNs, this becomes an eBGP link between your control hubs, acting as your backhaul. [1, 2, 3]
Megaport Router 2 (AS 200) — Secondary / Redundant Transit Node
- eBGP to AWS: Peering with AWS DX Gateway 1 & 2 (Remote AS 500).
- eBGP to OCI: Peering with OCI DRG 2 (Remote AS 600).
- eBGP to Azure: Peering with Azure ExpressRoute Gateway 2 (Remote AS 700). [1, 2]
🛠️ Traffic Engineering & Path Manipulation
Clouds lack sophisticated interior routing options. You must use BGP attributes at the Megaport layer to enforce strict asymmetric routing prevention and path symmetry.
1. Inbound Traffic Optimization (Into your Clouds)
- AWS Strategy (AS 500): AWS Direct Connect highly respects the BGP Local Preference attribute when receiving routes. On MPR1 (AS 100), tag prefixes learned from AWS with
Local-Pref 200. On MPR2 (AS 200), tag them withLocal-Pref 100. This forces all cloud-to-cloud and multi-cloud transit traffic out through MPR1 during steady state. [1] - OCI Strategy (AS 600): OCI DRGv2 supports complex route distributions. Set OCI DRG 1 as the primary target path by matching incoming OCI paths on MPR1 and optimizing local routing metrics. [1]
2. Outbound Traffic Optimization (From Clouds to Transit Hub)
Because the Cloud Service Providers (CSPs) control their own egress choices, you must explicitly make MPR2 look less attractive to them:
- AS-Path Prepending: When advertising your macro-allocation prefixes from MPR2 (AS 200) toward AWS, OCI, and Azure, prepend your own ASN three times (
200 200 200). This ensures all CSPs calculate the shorter path through MPR1 (AS 100) under normal operating conditions. - Azure MED Manipulation: Azure natively prioritizes paths based on ExpressRoute routing metrics. If AS-Path length isn't dynamic enough due to Azure's internal modifications, configure a lower Multi-Exit Discriminator (MED) out of MPR1 and a higher MED out of MPR2. [1]
3. Preventing Split-Brain & Transitive Loops
- No-Transit Communities: You do not want AWS to use your Megaport routers to reach public internet zones or unauthorized zones. Apply
no-exportor specific custom communities on your inbound route maps to filter leaking infrastructure prefixes. - Prefix Lists: Enforce strict policy filters. Only allow OCI production prefixes (
10.60.0.0/16) to be advertised to AWS and Azure, and vice-versa. Do not allow your transit hub to act as an accidental open relay for un-summarized cloud subnets.
Would you like the exact Terraform code to spin up the OCI DRG BGP connection to Megaport, or would you like to drill down into the failover behavior if the link between MPR1 and AWS drops?

