|
1 | 1 | --- |
2 | 2 | pcx_content_type: how-to |
3 | | -title: Connect WARP clients to private network |
| 3 | +title: Connect private network to WARP clients |
4 | 4 | sidebar: |
5 | 5 | label: User-to-site |
6 | 6 | order: 3 |
7 | 7 | --- |
8 | 8 |
|
9 | 9 | import { Render, Details, GlossaryTooltip, TabItem, Tabs } from "~/components"; |
10 | 10 |
|
| 11 | +This guide covers how to connect WARP client user devices to a private network behind WARP Connector. In this example, we will create a WARP Connector for subnet `10.0.0.0/24` and install it on `10.0.0.1`. |
| 12 | + |
11 | 13 | ```mermaid |
12 | 14 | flowchart LR |
13 | 15 | subgraph subnet1[Subnet 10.0.0.0/24] |
14 | 16 | router1["WARP Connector |
15 | 17 | 10.0.0.1"] |
16 | 18 | end |
17 | | - router1<-->C((Cloudflare))<-->W[WARP client] |
| 19 | + W[WARP clients]-->C((Cloudflare))-->router1 |
18 | 20 | ``` |
19 | 21 |
|
| 22 | +:::note |
| 23 | +To connect a private network using `cloudflared`, refer to [Connect private networks](/cloudflare-one/connections/connect-networks/private-net/cloudflared/). |
| 24 | +::: |
| 25 | + |
| 26 | +## Prerequisites |
| 27 | + |
| 28 | +- A Linux host [^1] on the subnet |
| 29 | +- Verify that your firewall allows inbound/outbound traffic over the [WARP IP addresses, ports, and domains](/cloudflare-one/connections/connect-devices/warp/deployment/firewall/). |
| 30 | + |
| 31 | +## 1. Install a WARP Connector |
| 32 | + |
| 33 | +<Render file="tunnel/warp-connector-install" /> |
| 34 | + |
| 35 | +## 2. (Recommended) Create a device profile |
| 36 | + |
| 37 | +<Render file="tunnel/warp-connector-device-profile" /> |
| 38 | + |
| 39 | +## 3. Route CGNAT IPs through Cloudflare |
| 40 | + |
| 41 | +WARP clients and WARP Connectors are accessed using their <GlossaryTooltip term="CGNAT IP">CGNAT IP</GlossaryTooltip>. Therefore, CGNAT IP traffic must route through Cloudflare on both the WARP Connector host and WARP client devices. |
| 42 | + |
| 43 | +1. In your WARP Connector device profile, delete `100.96.0.0/12` from the [Split Tunnel Exclude list](/cloudflare-one/connections/connect-devices/warp/configure-warp/route-traffic/split-tunnels/) (or add it to the Split Tunnel Include list). |
| 44 | +2. Repeat the previous step for all WARP client device profiles. |
| 45 | + |
| 46 | +## 4. Route traffic from subnet to WARP Connector |
| 47 | + |
| 48 | +Depending on where you installed the WARP Connector, you may need to configure other devices on the subnet to route requests through WARP Connector. |
| 49 | + |
| 50 | +### Option 1: Default gateway |
| 51 | + |
| 52 | +<Render file="tunnel/warp-connector-default-gateway" /> |
| 53 | + |
| 54 | +### Option 2: Alternate gateway |
| 55 | + |
| 56 | +<Render file="tunnel/warp-connector-alternate-gateway" /> |
| 57 | + |
20 | 58 | #### Route from subnet to WARP clients |
21 | 59 |
|
22 | | -`100.96.0.0/12` is the default CIDR for all user devices running the [WARP client](/cloudflare-one/connections/connect-devices/warp/). To connect from the subnet to user devices: |
23 | | -- On your router, add a rule that routes the destination IP `100.96.0.0/12` to the WARP Connector host machine (`10.0.0.100` in the diagram above). |
24 | | -- Ensure that CGNAT IP traffic routes through WARP on both the WARP Connector host and WARP client devices. In other words, delete `100.96.0.0/12` from the [Split Tunnel Exclude list](/cloudflare-one/connections/connect-devices/warp/configure-warp/route-traffic/split-tunnels/) in both device profiles. |
| 60 | +`100.96.0.0/12` is the default CIDR for all user devices running the [WARP client](/cloudflare-one/connections/connect-devices/warp/). On your router, add a rule that routes the destination IP `100.96.0.0/12` to the WARP Connector host machine (`10.0.0.100`). |
| 61 | + |
| 62 | +<Render file="tunnel/warp-connector-alternate-gateway-flow" /> |
| 63 | + |
| 64 | +### Option 3: Intermediate gateway |
| 65 | + |
| 66 | +<Render file="tunnel/warp-connector-intermediate-gateway" /> |
| 67 | + |
| 68 | +#### Route CGNAT IPs |
| 69 | + |
| 70 | +To route all <GlossaryTooltip term="CGNAT IP">CGNAT IP</GlossaryTooltip> traffic through WARP Connector: |
| 71 | + |
| 72 | +<Tabs> <TabItem label="Linux"> |
| 73 | + |
| 74 | +```sh |
| 75 | +sudo ip route add 100.96.0.0/12 via <WARP-CONNECTOR-IP> dev eth0 |
| 76 | +``` |
| 77 | + |
| 78 | +</TabItem> <TabItem label="macOS"> |
| 79 | + |
| 80 | +```sh |
| 81 | +sudo route -n add -net 100.96.0.0/12 <WARP-CONNECTOR-IP> |
| 82 | +``` |
| 83 | + |
| 84 | +</TabItem> |
| 85 | + |
| 86 | +<TabItem label="Windows"> |
| 87 | + |
| 88 | +```bash |
| 89 | +route /p add 100.96.0.0/12 mask 255.255.255.255 <WARP-CONNECTOR-IP> |
| 90 | +``` |
| 91 | + |
| 92 | +</TabItem> </Tabs> |
| 93 | + |
| 94 | +#### Verify routes |
| 95 | + |
| 96 | +<Render file="tunnel/warp-connector-verify-routes" /> |
| 97 | + |
| 98 | +## 4. Test the WARP Connector |
| 99 | + |
| 100 | +You can now send a request from a device behind WARP Connector to a WARP client user device. |
| 101 | + |
| 102 | +1. From **My Team** > **Devices**, determine the **Virtual IPv4** address of the WARP client device. |
| 103 | +2. From a device on the private network, run `ping <WARP-VIRTUAL-IPV4>`. |
| 104 | + |
| 105 | +```mermaid |
| 106 | + flowchart LR |
| 107 | + subgraph subnet1[Subnet 10.0.0.0/24] |
| 108 | + device1["Device |
| 109 | + 10.0.0.2"]--ping 100.96.0.21-->router1["WARP Connector |
| 110 | + 10.0.0.1"] |
| 111 | + end |
| 112 | + router1-->C((Cloudflare))-->W["WARP client |
| 113 | + 100.96.0.21"] |
| 114 | +``` |
| 115 | + |
| 116 | +[^1]: <Render file="tunnel/warp-connector-linux-packages" /> |
0 commit comments