Skip to content

MagicSiteLan

Source: src/Cloudflare/MagicTransit/SiteLan.ts

A LAN attached to a Magic WAN site — describes a local network segment behind a Magic WAN Connector port (VLAN, addressing, routed subnets, NAT).

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

siteId and haLink are create-only — changing either triggers a replacement. Everything else is updated in place.

Untagged LAN with DHCP

const lan = yield* Cloudflare.MagicSiteLan("hq-lan", {
siteId: site.siteId,
physport: 2,
vlanTag: 0,
});

LAN with static addressing and a routed subnet

const lan = yield* Cloudflare.MagicSiteLan("hq-lan", {
siteId: site.siteId,
physport: 2,
vlanTag: 10,
staticAddressing: { address: "192.168.10.1/24" },
routedSubnets: [
{ prefix: "10.10.0.0/24", nextHop: "192.168.10.254" },
],
});