Skip to content
AnswerWell geo Documentation

Research · 8 min read · Answerwell

WAN Tunnel Endpoints, Static Routes and BGP Peering

How to steer traffic over IPsec or GRE WAN tunnels: static routes, priorities, BGP, cloud on-ramps, and verification in Cloudflare WAN.

This page summarises Cloudflare documentation on Cloudflare WAN (also called Magic WAN in parts of the docs): you build tunnel endpoints on Cloudflare and on your router, firewall, or cloud VPN, then configure routes so traffic from Cloudflare’s network reaches your sites, VPC subnets, and branch LANs. Most third-party guides in the same doc set repeat that pattern—tunnels first, static routes (or BGP peering) second—not a separate product model.

WAN routes: what a static route does on Cloudflare

Section titled “WAN routes: what a static route does on Cloudflare”

A WAN route tells Cloudflare which prefix (CIDR block) to send toward a tunnel or next hop after packets enter the WAN connector fabric.

WAN routes define the IP network segments (such as 10.0.0.0/24) that are reachable via a GRE or IPsec tunnel. To add a WAN route, refer to the WAN Connectors documentation.

— Cloudflare, Add routes

On the customer side you also add routes (VPC route tables, firewall static routes, SD-WAN site subnets) so return traffic and east–west flows use the same tunnels. Cloudflare’s side is configured under Networks → Routes → WAN Routes or via the Magic routes API described in Create a static route.

Static routes vs BGP peering: which routing mode to choose

Section titled “Static routes vs BGP peering: which routing mode to choose”

After tunnel endpoints exist, steering traffic is the next step. Cloudflare documents two options:

Now that you have set up your tunnel endpoints, you need to configure routes to direct your traffic through Cloudflare. You have two routing options:

Static routes: Best for simple, stable networks where routes rarely change. You manually define each route. BGP peering: Best for dynamic environments with frequently changing routes, multiple prefixes, or when you need automatic failover. Requires enabling BGP on your tunnel during creation.

— Cloudflare, Configure tunnel endpoints

Option Fits when You must
Static routes Fixed site subnets, cloud VPC CIDRs, predictable prefixes Create each route in the dashboard or API; mirror routes on the peer (e.g. Google Cloud VPN, Fortinet)
BGP peering Many prefixes, frequent changes, automatic failover Enable BGP when creating the tunnel; follow Configure routes for peering setup

Learning-path material states the same goal in one line: create tunnels on both sides, then configure static routes or dynamic routes with BGP peering to steer traffic via next-hop from Cloudflare’s network to connected networks (Configure tunnels and routes).

Create a static route: dashboard fields and API

Section titled “Create a static route: dashboard fields and API”

Static route creation is the operational heart of most deployments.

Log in to Cloudflare One ↗︎, and go to Networks. Go to Routes > WAN Routes, and select Create to add a new route. Enter a descriptive name for your route in Description. In Prefix, enter your range of IP addresses. For example, 10.10.10.100/24. In Tunnel/Next hop, select a tunnel for your route from the tunnels you created in Configure tunnel endpoints. Choose the Priority for your route. Lower numbers have higher priorities.

— Cloudflare, Create a static route

Optional fields matter in production: Weight (load sharing among equal-priority routes), Region code (scope), and Test routes before commit. For automation, the same page documents POST to https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/magic/routes with token permissions Magic WAN Write or Magic Transit Write.

Typical prefix values from integration guides:

Route priority, longest-prefix match and ECMP

Section titled “Route priority, longest-prefix match and ECMP”

Priority chooses among routes to the same prefix via different tunnels. Longest-prefix match always wins over priority when prefixes differ.

Cloudflare routing applies longest-prefix match. A more specific static route (like /30) always takes precedence over a less specific one (like /29), regardless of tunnel priority — unless you remove the more specific route. Keep this in mind when configuring priorities for your routes.

— Cloudflare, Create a static route

For two tunnels to the same site subnet, Fortinet’s guide documents default priority 100 on both routes so Cloudflare uses ECMP (equal cost multipath) across tunnels; for active/passive, raise the backup tunnel’s priority (e.g. 150—higher number means lower priority):

By default, the static routes are defined with the priority set to 100. Cloudflare leverages Equal Cost Multipath Routing (ECMP) and will load balance the traffic equally across the two tunnels. If you prefer to use an Active/Passive model, you can leave the default value for the first route set to 100, and set the value for the second tunnel to 150 (higher value is a lower priority).

— Cloudflare, Fortinet

Azure Virtual WAN repeats the same knob: same priority for ECMP, lower priority number on the primary tunnel for active/backup (Microsoft Azure Virtual WAN).

Route summarization (fewer static entries)

Section titled “Route summarization (fewer static entries)”

If you onboarded several adjacent /24 networks, you can advertise one supernet instead of many /24 routes:

If you have multiple onboarded /24 subnets that belong to a larger contiguous block, you can configure a summary static route for the corresponding supernet (like a /23 or a /22) instead of adding each /24 individually.

— Cloudflare, Traffic steering

Cloud on-ramps: propagated routes into cloud VPCs

Section titled “Cloud on-ramps: propagated routes into cloud VPCs”

For cloud on-ramps, Cloudflare can push summarized routes into linked cloud route tables so workloads send RFC1918 (and carrier-grade NAT) space toward WAN:

By default, Cloudflare installs the following summarized routes in your cloud route tables to direct traffic to Cloudflare WAN:

10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 100.64.0.0/10

— Cloudflare, Cloud on-ramps

You can replace those defaults under Routes → WAN configuration → Propagated routes to cloud networks (Configure cloud on-ramps). For full default-route steering from Azure, Microsoft often blocks 0.0.0.0/0 on Local Network Gateway address space; Cloudflare documents summarising as 0.0.0.0/1 and 128.0.0.0/1 (Microsoft Azure VPN Gateway).

When Cloudflare creates tunnels and routes for you

Section titled “When Cloudflare creates tunnels and routes for you”

Cloudflare One Appliance and Virtual Appliance deployments do not let you hand-edit those objects:

Cloudflare One Appliance automatically creates IPsec tunnels and static routes for you. You cannot configure these manually.

— Cloudflare, Configure hardware Appliance

Inspect tunnels under Connectors (IPsec/GRE tab) and routes on the Routes page—the same pattern applies to the Virtual Appliance guide.

IPsec tunnel endpoints: settings that must align with routes

Section titled “IPsec tunnel endpoints: settings that must align with routes”

Routes point at tunnels; tunnel parameters must match the peer. Common dashboard fields across guides:

Field Role
Interface address Inner /30 or /31 on the Cloudflare side (pair with peer’s address)
Customer endpoint Peer public IP (WAN IP, cloud VPN gateway IP)
Cloudflare endpoint Anycast IP from Leased IPs
Pre-shared key Must match IKE on the peer
Health check Type/direction/target (e.g. bidirectional Reply on GCP)

Cisco Meraki examples show Routing: Static with Private Subnets listed on the peer (Cisco Meraki MX (static routing)). pfSense and Ubiquiti flows create Cloudflare tunnels first, then WAN routes with Prefix = local LAN and Tunnel/Next hop = the tunnel.

IPv6 rides the same GRE tunnel; you add IPv6 Interface address on create/edit:

Since IPv6 works over an existing IPv4 tunnel, you need to select either an existing IPv4 GRE tunnel or create a new one to test IPv6.

— Cloudflare, Configure IPv6 (beta)

Each tunnel consumes a /127 from the account’s allocated /96; addresses ::0 and ::1 are reserved for Cloudflare.

Policy-based routing for tunnel health checks (Linux peers)

Section titled “Policy-based routing for tunnel health checks (Linux peers)”

On Linux with strongSwan, ICMP replies to Cloudflare probes may leave via the Internet unless you add policy-based routing so health-check source traffic uses the VTI—see strongSwan for ip rule / viatunicmp examples.

  1. Routes before tunnels — Configure tunnel endpoints assumes endpoints exist; Tunnel/Next hop must reference a live tunnel.
  2. Ignoring longest-prefix match — A more specific static route overrides priority on a broader prefix (Create a static route).
  3. One-sided routing — Cloudflare WAN static routes do not replace VPC or firewall routes; cloud guides (Oracle Cloud, Google Cloud VPN) require routes on both sides.
  4. Mismatched PSK or IKE IDs — Peers must use the Cloudflare User ID / FQDN where documented (pfSense, SonicWall).
  5. Azure Active/Active endpoint confusion — Both tunnels may share one Cloudflare endpoint IP when Azure builds two connections to the same remote address (Microsoft Azure VPN Gateway).
  6. VeloCloud / SD-WAN health subnets — Omitting tunnel interface /32 site subnets can break health checks (Velocloud).
  1. In Cloudflare One, open Networks → Connectors and confirm IPsec or GRE tunnels show expected Customer endpoint, Cloudflare endpoint, and health-check settings (Configure hardware Appliance describes the IPsec/GRE tunnels tab).

  2. Open Networks → Routes → WAN Routes and verify each Prefix points to the correct Tunnel/Next hop and Priority matches your ECMP or active/passive design (Create a static route).

  3. Use Test routes when creating or changing a route, as recommended in Create a static route.

  4. On the peer device or cloud VPC, confirm return paths (e.g. show ip route on Furukawa Electric FITELnet where a * marks a valid FIB route).

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact wording you are asking about so it can be corrected.