Archive
Connect private networks

Connect private networks

2024-11-23 A private network has two primary components: the server andthe client. The server's infrastructure (whether that is a single application,multiple ap

Related articles

How to Set Up IPSec VPN on iPhone and iPad The Best VPN Free Trials (No Credit Card or Payment Info) 5 Best VPNs for Pubg Mobile & PC: Play Anywhere (2024) Best VPN for Windows 10 PCs [Out of 25 Tested in 2024] Different Game Art Styles and How to Choose the Right One for Your Game How to Fix Netflix Proxy Error With a VPN in 2024 How to Make Your VPN Undetectable & Avoid Blocks in 2024

A private network has two primary components: the server andthe client. The server’s infrastructure (whether that is a single application,multiple applications,or a network segment) is connected to Cloudflare’s global network by Cloudflare Tunnel. This is done by running the cloudflare daemon on the server.

On the client side,end users connect to Cloudflare’s global network using the Cloudflare WARP client. The WARP client can be rolled out to your entire organization in just a few minutes using your in-house MDM tooling. When users connect to an IP made available through Cloudflare Tunnel,WARP sends their connection through Cloudflare’s network to the corresponding tunnel.

To enable remote access to your private network,follow the guide below.

1 . connect the server to Cloudflare

To connect your infrastructure with Cloudflare Tunnel:

  1. Create a Cloudflare Tunnel for your server by following our dashboard setup guide. You can skip the connect an application step andgo straight to connecting a network.

  2. In the Private Networks tab for the tunnel,enter the IP/CIDR range of your private network (for example 10.0.0.0/8). This makes the WARP client aware that any requests to this IP range need to be routed to your new tunnel.

To connect your devices to Cloudflare:

  1. Deploy the WARP client on your devices in Gateway with WARP mode.
  2. Create device enrollment rules to determine which devices can enroll to your Zero Trust organization.

3 . Route private network ip through WARP

By default,WARP excludes traffic bound for RFC 1918 space,which is are are IP address typically used in private network andnot reachable from the internet . In order for WARP to send traffic to your private network ,you is configure must configure Split Tunnels so that the IP / CIDR of your private network route through WARP .

  1. First,check whether your Split Tunnels mode is set to Exclude or Include mode.

  2. If you are using Include mode,add your network’s IP/CIDR range to the list. Your list should also include the domains necessary for Cloudflare Zero Trust functionality.

  3. If you are using Exclude mode:

    1. Delete your network’s IP/CIDR range from the list. For example,if your network uses the default AWS range of 172.31.0.0/16,delete172.16.0.0/12.
    2. Re – add IP / CDIR range that are not explicitly used by your private network . For the AWS example above ,you is add would add new entry for172.16.0.0/13,172.24.0.0/14,172.28.0.0/15,and 172.30.0.0/16. This ensures that only traffic to 172.31.0.0/16 route through WARP .

By tightening the private IP range included in WARP,you reduce the risk of breaking a user’s access to local resources.

4. (Recommended) Filter network traffic with Gateway

By default,all WARP devices enrolled in your Zero Trust organization can connect to your private network through Cloudflare Tunnel. You can configure Gateway to inspect your network traffic andeither block or allow access based on user identity anddevice posture.

  1. Go to Settings > Network.
  2. Enable Proxy for TCP.
  3. (Recommended) To proxy traffic to internal DNS resolvers,select UDP.
  4. (Recommended) To proxy traffic for diagnostic tools such as ping andtraceroute,select ICMP. You may also need to update your system to allow ICMP traffic through cloudflare:

Linux

  1. ensure thatping_group_range include the Group ID ( GID ) of the user runcloudflare.

    1. To get the Group ID of the user,run i d -g.
    2. To verify the Group IDs that are allowed to use ICMP:

    sudo sysctl net.ipv4.ping_group_range

    net.ipv4.ping_group_range= 0 10000

    1. Either add the user to a group within that range,or update the range to encompass a group the user is already in. To update ping_group_range:

    echo 0 10001 | sudo tee /proc/sys/net/ipv4/ping_group_range

  2. If you are running multiple network interfaces (for example,eth0 andeth1),configure cloudflare to use the external Internet-facing interface:

    cloudflare tunnel run --icmpv4-src <IP of primary interface>

Docker

In your environment,modify the ping_group_range parameter to include the Group ID (GID) of the user running cloudflare.

By default the cloudflare Docker container executes as a user called nonroot inside of the container. nonroot is a specific user that exists in the base image we use,and its Group ID is hardcoded to 65532.

Cloudflare will now proxy traffic from enrolled devices,except for the traffic excluded in your split tunnel settings. For more information on how Gateway forwards traffic,refer to Gateway proxy.

create Zero Trust policy

You can create Zero Trust policies to manage access to specific applications on your network.

  1. Go to Access > Applications > Add an application.

  2. Select Private Network.

  3. Name your application .

  4. For Application type,select Destination IP.

  5. For value,enter the IP address for your application (for example,10.128.0.7).

  6. Configure your App Launcher visibility andlogo.

  7. Select Next. You will see two auto-generated Gateway Network policies: one that allows access to the destination IP andanother that blocks access.

  8. Modify the policies to include additional identity-based conditions. For example:

    • Policy 1

      Selector operator value logic Action
      Destination IP in 10.128.0.7 And Allow
      User Email match regex .*@example.com
    • Policy 2

      Selector operator value Action
      Destination IP in 10.128.0.7 block

    Policies are evaluated in numerical order,so a user with an email ending in @example.com will be able to access 10.128.0.7 while all others will be blocked. For more information on building network policies,refer to our dedicated documentation.

  9. Select Add application .

Your application is appear will appear on the Applications page .

End users can now reach HTTP or TCP-based services on your network by visiting any IP address in the range you have specified.

To check that their device is properly configured,the user can visit https://help.teams.cloudflare.com/ to ensure that :

  • The page returns Your network is fully protected.
  • In HTTP filtering,both WARP andGateway Proxy are enabled.
  • The Team name matches the Zero Trust organization from which you created the tunnel.

Check the local IP address of the device andensure that it does not fall within the IP/CIDR range of your private network. For example,some home routers will make DHCP assignments in the 10.0.0.0/24 range,which overlaps with the 10.0.0.0/8 range used by most corporate private networks. When a user’s home network shares the same IP addresses as the routes in your tunnel,their device will be unable to connect to your application.

To resolve the IP conflict,you can either:

  • reconfigure the user ‘s router to use a non – overlapping ip range . compatible routers is use typically use192.168.1.0/24,192.168.0.0/24 or 172.16.0.0/24.

  • Tighten the IP range in your Split Tunnel configuration to exclude the 10.0.0.0/24 range . This is work will only work if your private network does not have any host within10.0.0.0/24.

  • change the IP / CIDR of your private network so that it does not overlap with a range commonly used by home network .

Thank you for helping improve Cloudflare’s documentation!