Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Comprehensive Cloudflare platform skill covering Workers, D1, R2, KV, AI, Durable Objects, and security.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/network-interconnect/patterns.md
1# CNI Patterns23See [README.md](README.md) for overview.45## High Availability67**Critical:** Design for resilience from day one.89**Requirements:**10- Device-level diversity (separate hardware)11- Backup Internet connectivity (no SLA on CNI)12- Network-resilient locations preferred13- Regular failover testing1415**Architecture:**16```17Your Network A ──10G CNI v2──> CF CCR Device 118│19Your Network B ──10G CNI v2──> CF CCR Device 220│21CF Global Network (AS13335)22```2324**Capacity Planning:**25- Plan across all links26- Account for failover scenarios27- Your responsibility2829## Pattern: Magic Transit + CNI v23031**Use Case:** DDoS protection, private connectivity, no GRE overhead.3233```typescript34// 1. Create interconnect35const ic = await client.networkInterconnects.interconnects.create({36account_id: id,37type: 'direct',38facility: 'EWR1',39speed: '10G',40name: 'magic-transit-primary',41});4243// 2. Poll until active44const status = await pollUntilActive(id, ic.id);4546// 3. Configure Magic Transit tunnel via Dashboard/API47```4849**Benefits:** 1500 MTU both ways, simplified routing.5051## Pattern: Multi-Cloud Hybrid5253**Use Case:** AWS/GCP workloads with Cloudflare.5455**AWS Direct Connect:**56```typescript57// 1. Order Direct Connect in AWS Console58// 2. Get LOA + VLAN from AWS59// 3. Send to CF account team (no API)60// 4. Configure static routes in Magic WAN6162await configureStaticRoutes(id, {63prefix: '10.0.0.0/8',64nexthop: 'aws-direct-connect',65});66```6768**GCP Cloud Interconnect:**69```701. Get VLAN attachment pairing key from GCP Console712. Create via Dashboard: Interconnects → Create → Cloud Interconnect → Google72- Enter pairing key, name, MTU, speed733. Configure static routes in Magic WAN (BGP routes from GCP ignored)744. Configure custom learned routes in GCP Cloud Router75```7677**Note:** Dashboard-only. No API/SDK support yet.7879## Pattern: Multi-Location HA8081**Use Case:** 99.99%+ uptime.8283```typescript84// Primary (NY)85const primary = await client.networkInterconnects.interconnects.create({86account_id: id,87type: 'direct',88facility: 'EWR1',89speed: '10G',90name: 'primary-ewr1',91});9293// Secondary (NY, different hardware)94const secondary = await client.networkInterconnects.interconnects.create({95account_id: id,96type: 'direct',97facility: 'EWR2',98speed: '10G',99name: 'secondary-ewr2',100});101102// Tertiary (LA, different geography)103const tertiary = await client.networkInterconnects.interconnects.create({104account_id: id,105type: 'partner',106facility: 'LAX1',107speed: '10G',108name: 'tertiary-lax1',109});110111// BGP local preferences:112// Primary: 200113// Secondary: 150114// Tertiary: 100115// Internet: Last resort116```117118## Pattern: Partner Interconnect (Equinix)119120**Use Case:** Quick deployment, no colocation.121122**Setup:**1231. Order virtual circuit in Equinix Fabric Portal1242. Select Cloudflare as destination1253. Choose facility1264. Send details to CF account team1275. CF accepts in portal1286. Configure BGP129130**No API automation** – partner portals managed separately.131132## Failover & Security133134**Failover Best Practices:**135- Use BGP local preferences for priority136- Configure BFD for fast detection (v1)137- Test regularly with traffic shift138- Document runbooks139140**Security:**141- BGP password authentication142- BGP route filtering143- Monitor unexpected routes144- Magic Firewall for DDoS/threats145- Minimum API token permissions146- Rotate credentials periodically147148## Decision Matrix149150| Requirement | Recommended |151|-------------|-------------|152| Collocated with CF | Direct |153| Not collocated | Partner |154| AWS/GCP workloads | Cloud |155| 1500 MTU both ways | v2 |156| VLAN tagging | v1 |157| Public peering | v1 |158| Simplest config | v2 |159| BFD fast failover | v1 |160| LACP bundling | v1 |161162## Resources163164- [Magic Transit Docs](https://developers.cloudflare.com/magic-transit/)165- [Magic WAN Docs](https://developers.cloudflare.com/magic-wan/)166- [Argo Smart Routing](https://developers.cloudflare.com/argo/)167