Traffic steering (2)

Last updated Oct 12, 2026

Cloudflare Virtual Network routing table

When traffic enters Cloudflare's network, it needs to reach the correct destination in your infrastructure — a specific data center, office, or cloud environment. Traffic steering controls how Cloudflare makes these routing decisions.

The Cloudflare Virtual Network is a virtual network overlay, private to your account, that spans all Cloudflare data centers globally. This overlay network provides:

The Cloudflare Virtual Network supports routing the Cloudflare WAN traffic through anycast tunnels using GRE and Internet Protocol Security (IPsec) or CNI with Dataplane v2. You can add entries to the Cloudflare Virtual Network routing table through static route configuration or through routes learned through BGP peering. Traffic can also be routed automatically according to tracked flow state.

Note

For a conceptual overview of virtual networks, including how they work across Cloudflare products, refer to Virtual networks. Cloudflare WAN connections (IPsec, GRE, CNI) currently use only the default virtual network.

Allowed IP ranges

The following IPv4 address ranges are allowed in the Cloudflare Virtual Network routing table:

  • RFC 1918 ↗︎ address space, specifically 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16.

When using Cloudflare WAN and Cloudflare Tunnel together, consider the IP ranges utilized in the static routes of Cloudflare Tunnel when selecting static routes for Cloudflare WAN. For more information, refer to Cloudflare Tunnel.

For prefixes outside RFC 1918, contact your Cloudflare customer service manager.

Default routing

If traffic does not match any route you have configured in the virtual network, Cloudflare applies default behavior based on the destination address type:

  • Public (Internet-routable) addresses: Traffic exits to the Internet.
  • Private addresses (RFC 1918 ↗︎ or CGNAT/RFC 6598 ↗︎): Traffic is dropped (null routed), because private addresses are not routable on the public Internet and Cloudflare has no path to deliver them without a matching route.

Route prioritization

Cloudflare WAN steers traffic along tunnel routes based on route entry priorities.

  • Lower values have greater priority.
  • When the priority values for prefix entries match, Cloudflare uses equal-cost multi-path (ECMP) packet forwarding to route traffic. You can apply an optional weight value to static routes to modify ECMP tunnel distribution.
  • 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.
  • When BGP and static routes have the same prefix and priority, Cloudflare enforces priority by preferring static routes over BGP routes. This ensures that manually configured static routes take precedence unless you explicitly deprioritize them.

Set priority and weights for static routes

The priority value for static routes is directly configured as part of the route object in the Cloudflare dashboard or through the API. For example:

Prefix NextHop Priority
10.10.10.100/24 TUNNEL_1_IAD 200
10.10.10.100/24 TUNNEL_2_IAD 200
10.10.10.100/24 TUNNEL_3_ATL 100
10.10.10.100/24 TUNNEL_4_ATL 100

In this example, tunnels with priority of 100 are preferred to tunnels with priority of 200 because lower numbers have greater priority.

Optionally, you can assign weights to distribute traffic more effectively among multiple tunnels. Weight values determine traffic proportion, with higher weights receiving more traffic. The maximum weight value is 256.

In the following example, TUNNEL_2_IAD is likely to receive twice as much traffic as TUNNEL_1_IAD.

Prefix NextHop Priority Weight
10.10.10.100/24 TUNNEL_1_IAD 100 64
10.10.10.100/24 TUNNEL_2_IAD 100 128
10.10.10.100/24 TUNNEL_3_ATL 100 192
10.10.10.100/24 TUNNEL_4_ATL 100 255

Aside from priority, scoping static routes to specific geographic regions also impacts how traffic is steered. Refer to Scoping routes to specific regions for more details.

Set priority for BGP routes

When BGP advertises a route, Cloudflare automatically adds it to the Cloudflare Virtual Network routing table with a default priority of 100 which applies to all regions. However, if a static route exists with the same prefix and priority, the static route always takes precedence over the BGP route. Set a different priority for static routes (more or less than 100) depending on which you want to prioritize. Lower values have greater priority.

Additionally, when multiple BGP routes exist with the same prefix length and priority, ECMP distributes traffic across them using equal-cost multi-path (ECMP) routing.

Change route priorities with BGP attributes

Cloudflare supports traffic engineering through BGP communities and AS prepending. You can use these traffic routing techniques to set route priorities and perform traffic engineering across multiple interconnects.

BGP communities for setting route priority

The default BGP route priority is 100. This base priority can be adjusted using communities. For example, when a route is tagged with the community 13335:60010 its priority is set to 10. This makes it a higher priority than the default of 100 because lower numeric priorities are preferred.

The community values supported for setting base route priority are:

  • 13335:60010: Set base route priority to 10
  • 13335:60050: Set base route priority to 50
  • UNSET: Set base route priority to 100
  • 13335:60150: Set base route priority to 150
  • 13335:60200: Set base route priority to 200
  • 13335:60901: Set base route priority to 501000
  • 13335:60902: Set base route priority to 1001000

Setting multiple base priority communities in the same prefix update message is a misconfiguration. In this situation, Cloudflare prefers the highest priority (lowest integer value).

AS path prepending for adjusting route priority

For each additional mention of your ASN in the received AS path, Cloudflare adds 10 to the route's base priority. By increasing the priority number, the route becomes less preferred.

For example, if your ASN is 65000 then the BGP UPDATE to Cloudflare will be:

# No change to base priority.
AS_PATH: 65000 65200

# Add 10 to base priority for 1 prepend of 65000
AS_PATH: 65000 65000 65200

# Add 20 to base priority for 2 prepend of 65000
AS_PATH: 65000 65000 65000 65200

How communities and prepends work together

Cloudflare adjusts route priority when using AS prepending with communities. For example, if a route is tagged with 13335:60150, the base priority is set to 150. If you prepend your ASN twice, Cloudflare adds 10 for each prepend, increasing the route priority to 180.

Automatic Return Routing

Automatic Return Routing (ARR) allows Cloudflare to track network flows from your Cloudflare WAN (formerly Magic WAN) connected locations, ensuring return traffic is routed back to the connection where it was received without requiring static or dynamic routes. This functionality requires Unified Routing mode.

Instead of relying on static or dynamic routes for the return path, Cloudflare WAN learns flows and remembers which connection a given flow arrived on. For any matching return traffic, Cloudflare WAN uses this learned state to choose the next hop. This simplifies configuration, reduces the number of routes you must manage, and helps preserve symmetry for stateful traffic.

ARR provides the following benefits:

  • Removes the need for return routes: For supported traffic types like new TCP connections (TCP SYN), UDP, and ICMP echo traffic, Cloudflare WAN no longer requires a routing table entry to return traffic to the originating tunnel or interconnect.
  • Maintains symmetric routing for flows: Responses to a given flow (for example, a TCP session) return over the same Cloudflare WAN connection that carried the initial request — important for stateful firewalls and middleboxes.
  • Supports overlapping IP space: Because the return path is tied to the learned connection state instead of a destination prefix in the routing table, Automatic Return Routing can support scenarios where different sites use overlapping private address space.
  • Operates per connection: You decide which IPsec / GRE tunnels or network interconnects should use this behavior by enabling the feature on each connection.

How ARR works

When traffic that is eligible for Automatic Return Routing (ARR) arrives on a connection with ARR enabled, Cloudflare WAN creates a flow entry that records:

  • The source and destination IP addresses
  • The relevant ports or identifiers, depending on the protocol
  • The connection (tunnel or interconnect) that the traffic arrived on

For any subsequent packets that match this flow and require a next hop, Cloudflare WAN:

  1. Checks for a matching Automatic Return Routing flow.
  2. If a match exists, routes the packet back to the same connection where the flow was learned, instead of consulting the Cloudflare Virtual Network routing table.

The initial request from your network to the Internet still uses your configured static or BGP routes. ARR only affects the return path for supported traffic after the flow is learned.

Traffic and destinations affected

Automatic Return Routing applies when:

  • Traffic is received on a tunnel or network interconnect where the feature is enabled.
  • The received traffic is one of:
  • New TCP connections (TCP SYN)
  • UDP
  • ICMP echo (ping) requests
  • The traffic is destined for:
  • Internet egress through Cloudflare
  • A Cloudflare One Client
  • A private network connected to Cloudflare through Cloudflare Tunnel
  • A private network connected to Cloudflare through Cloudflare Mesh

ARR does not change routing for traffic between Cloudflare WAN connections (for example, traffic from one IPsec/GRE tunnel or interconnect to another). That traffic continues to follow your configured Cloudflare WAN routes.

Unified Routing mode

Unified Routing mode is the Cloudflare One data plane that uses a single routing fabric for all supported connection types. It routes traffic across the Cloudflare One Client, Cloudflare Tunnel, IPsec, GRE, and Cloudflare Network Interconnect (CNI) in one system.

In the Cloudflare WAN dashboard, routing mode appears where you manage routes:

  • Routing mode: Unified — your account is on the unified data plane and supports the new routing features.
  • Routing mode: Legacy — your account uses the previous data plane and does not support all unified routing features.

Compare routing modes

Unified Routing is generally available and is our recommended routing mode for all new accounts.

Area Legacy Routing Unified Routing
Routing fabric Uses separate routing systems for Zero Trust and WAN routes. Uses one routing fabric across all supported connection types.
Route selection Applies longest-prefix match within each routing system. For cross-system traffic, a Zero Trust route can take precedence over a more specific WAN route. Applies longest-prefix match across supported connection types. When prefix lengths match, Zero Trust routes take precedence.
Cloudflare service source IPs Uses public Cloudflare source IPs for traffic sent to private networks. Uses a dedicated, non-Internet-routable private source range. You can configure the IPv4 range.
Cloudflare Mesh and Cloudflare WAN Does not support traffic between Mesh and WAN connections. Supports Mesh and WAN connections in the same account.
Load Balancing with WAN origins Supported. Traffic uses public Cloudflare source IPs. Generally available. Traffic uses dedicated private Cloudflare source IPs.
BGP over CNI Closed beta and not available to new customers. Closed beta and not available to new customers.
IPv6 Beta for Magic Transit only. Beta for Cloudflare WAN and Magic Transit.

Use features available only with Unified Routing

The following features require Unified Routing.

Feature Availability with Unified Routing
Automatic Return Routing Generally available for Internet return traffic. Routing between WAN connections is not available.
BGP over IPsec and GRE Generally available.
Cloudflare source IPs Generally available.
Custom Cloudflare One Client device subnets with Cloudflare WAN Generally available.
Cloudflare Mesh and Cloudflare WAN interoperability Generally available.