订阅以接收新文章的通知:

宣布适用于 Linux 的 WARP 和代理模式

2021/06/17

10 分钟阅读时间

去年 10 月,我们发布了桌面版 WARP,为数十亿台设备免费提供更安全、更快捷的互联网使用方式。同时,我们让企业客户能够将 WARP 与 Cloudflare for Teams 相结合使用。通过 WARP 路由来自地球上任何地方的设备的所有企业流量,我们都能够无缝地支持高级功能,例如安全 Web 网关浏览器隔离,以及未来的数据丢失防护平台。

今天,我们很高兴地宣布 Cloudflare WARP for Linux,以及在所有桌面平台上,能够将 WARP 用于单个应用程序而不是整个设备。

什么是 WARP?

WARP 的理念是,即使不知道 “VPN” 代表什么的人员也应该能够轻松获得 VPN 提供的保护。不幸的是,它也是为我们这些对传统企业 VPN 太熟悉的人而构建的,他们需要创新的无缝解决方案来应对始终连接的世界的挑战。

输入我们自己的名为 BoringTun 的 WireGuard 实现。

WARP 应用程序使用 BoringTun 来加密来自您设备的流量并将其直接发送到 Cloudflare 的边缘,确保中间没有人窥探您正在做的事情。如果您正在访问的站点已经是 Cloudflare 客户,则内容会立即发送到您的设备。借助 WARP+,我们使用 Argo Smart Routing 可以通过我们的全局网络数据中心使用最短路径到达您要连接的任何人。

结合 1.1.1.1(世界上最快的公共 DNS 解析器)的强大功能,WARP 可确保您的流量安全、私密且快速。由于您在 Internet 上所做的几乎所有事情都是从 DNS 请求开始的,因此在您的所有设备上选择最快的 DNS 服务器几乎可以加速您在网上所做的一切。

将 WARP 引入 Linux

去年,当我们构建桌面客户端的基础时,我们知道我们将交付 Linux 客户端。如果您曾经发布过这种规模的软件,您就会知道在所有主要操作系统上维护客户端是一项艰巨(且容易出错)的任务。为了避免这些陷阱,我们用 Rust 编写了产品的核心,它允许跨平台共享 95% 的代码。

在内部,我们将此公共代码称为共享后台程序(或服务,对于 Windows 熟人),它允许我们的工程师可以花更少的时间跨多个平台复制代码,同时确保大多数质量改进同时惠及每个人。真正酷的是,数百万现有的 WARP 用户已经帮助我们巩固了 Linux 的代码库!

另外 5% 的代码分为两个主要部分:操作系统的用户界面和特点。目前,我们放弃了 Linux 上的 UI,而是努力支持三个发行版:

  • Ubuntu
  • 红帽企业 Linux
  • CentOS

我们希望在未来添加更多发行版支持,所以如果你最喜欢的发行版本不存在,请不要绝望—客户端实际上可能已经与其他基于 Debian 和 Redhat 的发行版一起使用,所以请试一试。如果我们错过了您最喜欢的发行版本,我们很乐意在我们的社区论坛中收到您的来信。

那么如果没有 UI—控制 WARP 的机制是什么?当然是命令行!敏锐的观察者可能已经注意到,每个客户端都附带了一个名为 warp-cli 的可执行文件。这个与平台无关的接口已经是我们的一些工程师与后台程序交互的首选机制,并且是您在 Linux 上与 WARP 交互的主要方式。

为 Linux 安装 Cloudflare WARP

经验丰富的 Linux 开发人员可以直接跳转到https://pkg.cloudflareclient.com/install。链接我们的存储库后,根据您的发行版,使用 sudo apt install cloudflare-warp 或开始 sudo yum install cloudflare-warp

有关更详细的安装说明,请访问我们的 WARP 客户端文档

使用命令行界面

一旦您安装 WARP 后,您可以通过一个命令开始使用 CLI:

warp-cli --help

CLI 将显示以下输出。

~$ warp-cli --help
WARP 0.2.0
Cloudflare
CLI to the WARP service daemon
 
USAGE:
    warp-cli [FLAGS] [SUBCOMMAND]
 
FLAGS:
        --accept-tos    Accept the Terms of Service agreement
    -h, --help          Prints help information
    -l                  Stay connected to the daemon and listen for status changes and DNS logs (if enabled)
    -V, --version       Prints version information
 
SUBCOMMANDS:
    register                    Registers with the WARP API, will replace any existing registration (must be run
                                before first connection)
    teams-enroll                Enroll with Cloudflare for Teams
    delete                      Deletes current registration
    rotate-keys                 Generates a new key-pair, keeping the current registration
    status                      Asks the daemon to send the current status
    warp-stats                  Retrieves the stats for the current WARP connection
    settings                    Retrieves the current application settings
    connect                     Asks the daemon to start a connection, connection progress should be monitored with
                                -l
    disconnect                  Asks the daemon to stop a connection
    enable-always-on            Enables always on mode for the daemon (i.e. reconnect automatically whenever
                                possible)
    disable-always-on           Disables always on mode
    disable-wifi                Pauses service on WiFi networks
    enable-wifi                 Re-enables service on WiFi networks
    disable-ethernet            Pauses service on ethernet networks
    enable-ethernet             Re-enables service on ethernet networks
    add-trusted-ssid            Adds a trusted WiFi network, for which the daemon will be disabled
    del-trusted-ssid            Removes a trusted WiFi network
    allow-private-ips           Exclude private IP ranges from tunnel
    enable-dns-log              Enables DNS logging, use with the -l option
    disable-dns-log             Disables DNS logging
    account                     Retrieves the account associated with the current registration
    devices                     Retrieves the list of devices associated with the current registration
    network                     Retrieves the current network information as collected by the daemon
    set-mode                    
    set-families-mode           
    set-license                 Attaches the current registration to a different account using a license key
    set-gateway                 Forces the app to use the specified Gateway ID for DNS queries
    clear-gateway               Clear the Gateway ID
    set-custom-endpoint         Forces the client to connect to the specified IP:PORT endpoint
    clear-custom-endpoint       Remove the custom endpoint setting
    add-excluded-route          Adds an excluded IP
    remove-excluded-route       Removes an excluded IP
    get-excluded-routes         Get the list of excluded routes
    add-fallback-domain         Adds a fallback domain
    remove-fallback-domain      Removes a fallback domain
    get-fallback-domains        Get the list of fallback domains
    restore-fallback-domains    Restore the fallback domains
    get-device-posture          Get the current device posture
    override                    Temporarily override MDM policies that require the client to stay enabled
    set-proxy-port              Set the listening port for WARP proxy (127.0.0.1:{port})
    help                        Prints this message or the help of the given subcommand(s)


您只需使用两个命令即可开始连接到 Cloudflare 的网络。第一个命令 ,register 将提示您进行身份验证。第二个命令 ,connect 将启用客户端,创建从您的设备到 Cloudflare 网络的 WireGuard 隧道。

~$ warp-cli register
Success
~$ warp-cli connect
Success

连接客户端后,验证它是否正常工作的最佳方法是运行我们的 trace 命令:

~$ curl https://www.cloudflare.com/cdn-cgi/trace/

并寻找以下输出:

warp=on

想要从加密 WARP 中的所有流量切换到只使用我们的 1.1.1.1 DNS 解析器吗?使用 warp-cli set-mode 命令:

~$ warp-cli help set-mode
warp-cli-set-mode 
 
USAGE:
    warp-cli set-mode [mode]
 
FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
 
ARGS:
    <mode>     [possible values: warp, doh, warp+doh, dot, warp+dot, proxy]
~$ warp-cli set-mode doh
Success

使用 1.1.1.1 for Families 保护自己免受恶意软件的侵害同样简单,它可以在启用 WARP 或直接 DNS 模式下使用:

~$ warp-cli set-families-mode --help
warp-cli-set-families-mode 
 
USAGE:
    warp-cli set-families-mode [mode]
 
FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information
 
ARGS:
    <mode>     [possible values: off, malware, full]
~$ warp-cli set-families-mode malware
Success

关于 Cloudflare for Teams 支持的说明

Cloudflare for Teams 支持正在进行中,就像我们的其他客户一样,它将在相同的包裹中提供。请继续关注应用内更新,或联系您的客户经理以在测试版可用时收到通知。

我们需要反馈

如果您遇到错误,请使用以下 sudo warp-diag feedback 命令向我们发送反馈:

~$ sudo warp-diag feedback

对于所有其他功能,warp-cli --help 请在此处查看或查看我们的文档

WARP 作为本地代理

当 WARP 于 2019 年推出时,我们的首选目标之一是易于使用。您打开 WARP,来自您设备的所有流量都被加密到我们的边缘。在客户端的所有版本中,我们一直将其作为重点。打开一个大开关,您就受到保护。

然而,随着我们的成长,所以对我们的客户有要求。今年早些时候,我们发布了拆分隧道和本地域回退,作为 Cloudflare for Teams 客户从 WARP 中排除某些路由的一种方式。我们的消费者客户可能已经注意到,在上一个版本中也悄悄添加了这一点。我们从希望以一种附加模式部署 WARP 的客户那里听说:单一应用程序。今天,我们还宣布我们的客户能够在所有桌面客户端中以本地代理模式运行 WARP。

当 WARP 配置为本地代理时,只有您配置为使用代理(HTTPS 或 SOCKS5)的应用程序将通过 WARP 发送其流量。这允许您选择加密的流量(例如,您的网络浏览器或特定应用程序),而其他所有内容都将通过 Internet 保持打开状态。

由于此功能将 WARP 限制为仅配置为使用本地代理的应用程序,默认情况下不会对 Internet 上的所有其他流量进行加密,因此我们将其隐藏在高级菜单中。打开它:

1. 导航至 Preferences (首选项) -> Advanced (高级)并单击 Configure Proxy (配置代理)按钮。

2. 在打开的对话框中,选中该框并配置要侦听的端口。

3. 这将启用您可以选择的新模式:

要将应用程序配置为使用代理,您需要为地址指定 127.0.0.1,并为端口指定值(默认为 40000)。例如,如果您使用 Firefox,配置将如下所示:

立即下载

您可以通过访问 https://one.one.one.one 立即开始使用这些功能。我们非常高兴听到您的反馈。Warp 产品新闻 Cloudflare for Teams 1.1.1.1 Cloudflare 网关

我们保护整个企业网络,帮助客户高效构建互联网规模的应用程序,加速任何网站或互联网应用程序抵御 DDoS 攻击,防止黑客入侵,并能协助您实现 Zero Trust 的过程

从任何设备访问 1.1.1.1,以开始使用我们的免费应用程序,帮助您更快、更安全地访问互联网。要进一步了解我们帮助构建更美好互联网的使命,请从这里开始。如果您正在寻找新的职业方向,请查看我们的空缺职位
Cloudflare Gateway (CN)WARP (CN)Cloudflare Zero Trust (CN)1.1.1.1 (CN)Product News (CN)

在 X 上关注

Kyle Krum|@KyleKrum
Cloudflare|@cloudflare

相关帖子

2023年6月21日 13:01

聚焦 Zero Trust:我们的速度是最快的,请看真凭实据

在 42% 的测试场景中,Cloudflare 是最快速的安全 Web 网关,是所有此类服务提供商中速度最快的。Cloudflare 比 Zscaler 快 46%,比 Netskope 快 56%,比 Palo Alto for ZTNA 快 10%,并且在 RBI 场景下比 Zscaler 快 64%...