Skip to content

Commit d461be9

Browse files
committed
create resolver policy, add IPv6
1 parent cc27929 commit d461be9

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

src/content/docs/cloudflare-one/connections/connect-networks/private-net/cloudflared/connect-private-hostname.mdx

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ Figures 1 and 2 illustrate the flow of DNS and network traffic when a user conne
2929
2. Based on the configured resolver policies, Gateway determines that `wiki.internal.local` should be resolved by a custom DNS resolver. Therefore, Gateway sends the DNS request down Cloudflare Tunnel to the private network where the custom DNS resolver is located.
3030
3. `cloudflared` does a DNS lookup to figure out what the origin IP is for `wiki.internal.local`.
3131
4. The Gateway resolver now knows that the origin IP is `10.0.0.5`.
32-
5. Rather than responding to the DNS query with the actual origin IP, Gateway responds with a random IP address from the CGNAT range `100.80.0.0/16` (for example, `100.80.0.1`). This CGNAT IP is called the initial resolved IP.
33-
6. Gateway's network engine stores the mapping between the private hostname, initial resolved IP, and the actual IP.
34-
7. The WARP client receives the initial resolved IP (`100.80.0.1`) in the DNS response for `wiki.internal.local`.
32+
5. Rather than responding to the DNS query with the actual origin IP, Gateway responds with a random IP address from the following CGNAT range:
33+
- **IPv4**: `100.80.0.0/16`
34+
- **IPv6**: `2606:4700:0cf1:4000::/64`
35+
36+
The selected CGNAT IP is called the initial resolved IP.
37+
6. Gateway's network engine stores the mapping between the private hostname (`wiki.internal.local`), initial resolved IP (`100.80.0.1`), and the actual IP (`10.0.0.5`).
38+
7. The WARP client receives the initial resolved IP (`100.80.0.1`) in the DNS response.
3539

3640
As shown in Figure 2 below, the WARP client will now send `wiki.internal.local` traffic to the initial resolved IP. The initial resolved IP mechanism is required because Gateway's network engine operates at L3/L4 and can only see IPs (not hostnames) when processing the connection. Because the packet's destination IP falls within the designated CGNAT range, Gateway knows that it corresponds to a hostname route and can apply hostname-based policies. Traffic that passes your Gateway policies will route through Cloudflare Tunnel to the application's actual origin IP.
3741

@@ -43,7 +47,7 @@ To learn more about hostname routing, refer to the [Cloudflare blog]().
4347

4448
This section covers how to enable remote access to a private hostname application using `cloudflared` and WARP.
4549

46-
### 1. Connect the server to Cloudflare
50+
### 1. Connect the application to Cloudflare
4751

4852
<Render file="tunnel/create-tunnel"/>
4953

@@ -59,7 +63,23 @@ This section covers how to enable remote access to a private hostname applicatio
5963

6064
10. Select **Complete setup**.
6165

62-
### 2. Set up the client
66+
### 2. Connect the DNS server to Cloudflare
67+
68+
Route the IP address of your internal DNS resolver through the tunnel.
69+
70+
### 3. Create a resolver policy
71+
72+
1. [Create a Gateway resolver policy](cloudflare-one/policies/gateway/resolver-policies/#create-a-resolver-policy) that matches the following traffic:
73+
74+
| Selector | Operator | Value |
75+
| -------- | -------- | ---------------------- |
76+
| Host | in | `wiki.internal.local` |
77+
78+
2. Under **Configure custom DNS resolvers**, enter the IPv4 and/or IPv6 address of your internal DNS resolver. The dropdown menu will not populate until you type in the full IP address.
79+
80+
3. From the dropdown menu, select the `- Private` routing option and the [virtual network](/cloudflare-one/connections/connect-networks/private-net/cloudflared/tunnel-virtual-networks/) where the DNS resolver is located.
81+
82+
### 4. Set up the client
6383

6484
<Details header="Feature availability">
6585

@@ -80,15 +100,13 @@ This section covers how to enable remote access to a private hostname applicatio
80100

81101
<Render file="tunnel/warp-to-tunnel-client" />
82102

83-
### 3. Route private network IPs through WARP
103+
### 5. Route private network IPs through WARP
84104

85105
- Initial resolved IP CGNAT range: `100.80.0.0/16`
86106
- Private network CIDR where the application is located, e.g. `10.0.0.0/8`. (Still need to know the IP range of the network. Do not need to know the specific IP of the application)
87107
- Internal DNS resolver IP
88108

89-
### 4. Create a resolver policy
90-
91-
### 5. (Recommended) Filter network traffic with Gateway
109+
### 6. (Recommended) Filter network traffic with Gateway
92110

93111
#### Enable Gateway proxy for TCP and UDP
94112
#### Zero Trust policies
@@ -102,7 +120,7 @@ Option 2: create a Gateway network policy using the SNI selector https://develop
102120
Self-hosted private apps and Gateway network policies are not currently supported for services on non-443 ports. You can only create a Gateway DNS policy.
103121

104122

105-
### 6. Connect as a user
123+
### 7. Connect as a user
106124

107125

108126

0 commit comments

Comments
 (0)