WARP architecture
This guide explains how the Cloudflare WARP client interacts with a device's operating system to route traffic in Gateway with WARP mode.
In Gateway with DoH mode, the IP traffic information does not apply. In Secure Web Gateway without DNS filtering mode, the DNS traffic information does not apply.
The WARP client allows organizations to have granular control over the applications an end user device can access. The client forwards DNS and network traffic from the device to Cloudflare's global network, where Zero Trust policies are applied in the cloud. On all operating systems, the WARP daemon maintains three connections between the device and Cloudflare:
Connection | Protocol | Purpose |
---|---|---|
Device orchestration | HTTPS | Perform user registration, check device posture, apply WARP profile settings. |
DoH ↗ | HTTPS | Send DNS requests to Gateway for DNS policy enforcement. |
WARP tunnel (via WireGuard or MASQUE) | UDP | Send IP packets to Gateway for network policy enforcement, HTTP policy enforcement, and private network access. |
flowchart LR subgraph Device W[WARP client] -.-> D D[DNS proxy] W -.-> V[Virtual interface] end subgraph Cloudflare A[Zero Trust account] subgraph Gateway G[DNS resolver] N[L3/L4 firewall] end end W<--Device orchestration-->A D<--DoH-->G V<--WARP tunnel-->N N --> O[(Application)]
Your Split Tunnel configuration determines what traffic is sent down the WARP tunnel. Your Local Domain Fallback configuration determines which DNS requests are sent to Gateway via DoH. Traffic to the DoH endpoint and device orchestration API endpoint do not obey Split Tunnel rules, since those connections always operate outside of the WARP tunnel.
Next, you will learn how WARP configures your operating system to apply your Local Domain Fallback and Split Tunnel routing rules. Implementation details differ between desktop and mobile clients.
The desktop client consists of two components: a service/daemon that handles all WARP functionality on your device, and a GUI wrapper that makes it easier for a user to interact with the daemon.
When you turn on WARP, WARP creates a local DNS proxy on the device and binds it to these IP addresses on port 53 (the port designated for DNS traffic):
- IPv4:
127.0.2.2
and127.0.2.3
- IPv6:
- macOS and Linux:
fd01:db8:1111::2
andfd01:db8:1111::3
- Windows:
::ffff:127.0.2.2
- macOS and Linux:
WARP then configures the operating system to send all DNS requests to these IP addresses. All network interfaces on the device will now use this local DNS proxy for DNS resolution. In other words, all DNS traffic will now be handled by the WARP client.
Based on your Local Domain Fallback configuration, WARP will either forward the request to Gateway for DNS policy enforcement or forward the request to your private DNS resolver.
- Requests to Gateway are sent over our DoH connection (outside of the WARP tunnel).
- Requests to your private DNS resolver are sent either inside or outside of the tunnel depending on your Split Tunnel configuration. For more information, refer to How the WARP client handles DNS requests.
flowchart LR D{{DNS request}}-->L["Local DNS proxy <br> (127.0.2.2 and 127.0.2.3)"]-->R{In local domain fallback?} R -- Yes --> F[Private DNS resolver] R -- No --> G[Cloudflare Gateway]
You can verify that the operating system is using WARP's local DNS proxy:
On macOS, open a terminal window and run scutil --dns
. The DNS servers should be set to WARP's local DNS proxy IPs.
On Windows, open a PowerShell window and run ipconfig
. The DNS servers should be set to WARP's local DNS proxy IPs.
On Linux, check the /etc/resolv.conf
file. The DNS servers should be set to WARP's local DNS proxy IPs.
When you turn on WARP, WARP makes three changes on the device to control if traffic is sent inside or outside of the WARP tunnel:
- Creates a virtual network interface.
- Modifies the operating system routing table according to your Split Tunnel rules.
- Modifies the operating system firewall according to your Split Tunnel rules.
flowchart LR P{{IP packet}}-->R["OS routing table"]-->F["OS firewall"] --> S{Excluded from Split Tunnels?} S -- Yes --> A[(Application)] S -- No --> U["Virtual interface<br> (172.16.0.2)"] --> G[Cloudflare Gateway]
Virtual interfaces allow the operating system to logically subdivide a physical interface, such as a network interface controller (NIC), into separate interfaces for the purposes of routing IP traffic. WARP's virtual interface is what maintains the WireGuard/MASQUE connection between the device and Cloudflare. By default, its IP address is hardcoded as 172.16.0.2
. You can use Override local interface IP to assign unique IPs per device.
To view a list of all network interfaces on the operating system:
On macOS, run ifconfig
. When WARP is turned on, you will see a utun
interface with IP address 172.16.0.2
.
On Windows, run ipconfig
. When WARP is turned on, you will see an adapter called CloudflareWARP
with IP address 172.16.0.2
.
On Linux, run ifconfig
or ip addr
. When WARP is turned on, you will see a utun
interface with IP address 172.16.0.2
.
WARP edits the system routing table to control what IP traffic goes to Gateway. The routing table indicates which network interface should handle packets to a particular IP address. By default, all traffic routes through WARP's virtual interface except for the IPs and domains on your Split Tunnel exclude list (which use the default interface on your device).
You can verify that the routing table matches your Split Tunnel rules:
To view the entire routing table on macOS, run netstat -r
.
You can also search the routing table for a domain or IP address. In this example, we see that traffic to google.com
is sent through utun3
, which is the WARP virtual interface on this device:
In contrast, this DHCP address is excluded from WARP and uses the default interface:
To view the entire routing table on Windows, run netstat -r
.
You can also search the routing table for an IP address. In this example, we see that traffic to 1.1.1.1
is sent through the WARP virtual interface:
In contrast, this DHCP address is excluded from WARP and uses the default interface:
To view the entire routing table on Linux, run ip -6 route show table all
or ip -4 route show table all
.
You can also search the routing table for an IP address. In this example, we see that traffic to 1.1.1.1
is sent through the WARP virtual interface:
In contrast, this DHCP address is excluded from WARP and uses the default interface:
WARP modifies the operating system firewall to enforce your Split Tunnel rules. This adds a layer of protection in case a service bypasses the routing table and tries to send traffic directly through another interface. For example, if traffic to 203.0.113.0
is supposed to be inspected by Gateway, we create a firewall rule that blocks 203.0.113.0
on all interfaces except for utun
.
On iOS and Android/ChromeOS, the Cloudflare One Agent installs itself as a VPN client to capture and route all traffic. The app is built on the official VPN framework for iOS and Android. For more information, refer to Apple's NetworkExtension documentation ↗ and Google's Android developer documentation ↗.
Note that ChromeOS runs the Android app in a virtual machine, rather than running a native Chrome app.