Skip to content

MagicSiteWan

Source: src/Cloudflare/MagicTransit/SiteWan.ts

A WAN attached to a Magic WAN site — describes an uplink on a Magic WAN Connector port (addressing, VLAN, load-balancing priority). Cloudflare automatically creates IPsec tunnels over each WAN.

Requires a Magic WAN subscription — accounts without it receive a typed MagicWanUnauthorized error (Cloudflare code 1025).

siteId is create-only — changing it triggers a replacement. Everything else is updated in place.

DHCP uplink

const wan = yield* Cloudflare.MagicSiteWan("hq-wan", {
siteId: site.siteId,
physport: 1,
});

Static uplink with priority

const wan = yield* Cloudflare.MagicSiteWan("hq-wan", {
siteId: site.siteId,
physport: 1,
priority: 10,
staticAddressing: {
address: "203.0.113.10/24",
gatewayAddress: "203.0.113.1",
},
});