type
status
date
slug
summary
tags
category
icon
password
前段时间写过 zerotier 的内网穿透内容,后面还会加上 caddy 的静态资源托管加反向代理,今天研究了一下 cloudflare tunnels 的穿透,功能更强大,携带了更丰富的权限配置。在这篇文章里,我简单写一下思路,更详细的内容参考官方文档.
开通zero trust: 注意这个功能需要绑定一张国际信用卡,选择 0 元白嫖套餐就好了。
创建新的管道:以下所有的操作都可以使用cloudflared这个工具在 terminal 中进行,具体可以参考文档,以下操作在 web 端讲解。给管道起一个名字,会提示你安装cloudflared,如果是arch linux 直接用pacman -S cloudflared。然后根据提供的秘钥登陆。

连接管道

设置反向代理

注意: 设置反向代理之后,会自动添加一条DNS 记录指向管道

增加权限组 Access Group: 进行到这一步,就已经把我内网 10.10.10.253的资源暴漏到公网了,下一步增加权限。打开Access Groups,增加一个组,增加一个访问权限,我这里选择的是特定的邮箱验证,也就是只有特定的邮箱才能访问页面。这里的规则includes 相当于逻辑 or, require 相当于 and, exclude 相当于否, 验证逻辑可以自由组合。

创建 Application: 将域名和策略填入(策略直接引用 Access Groups 里创建的组),验证就做完了。

最终效果:输入暴漏公网的域名253.complexity.buzz,输入邮箱(access groups允许的邮箱,如果不在这个范围内的邮箱,不会发验证码),然后输入验证码,就可以转发 10.10.10.3 的内网内容了。


- 作者:Roger
- 链接:https://rgao29.eu.org//article/bbc82993-a37d-4b3c-9056-2c5a77a16284
- 声明:没有版权,就说是你写的