Cloudflare setup:修订间差异
跳到导航
跳到搜索
无编辑摘要 |
无编辑摘要 |
||
(未显示2个用户的5个中间版本) | |||
第1行: | 第1行: | ||
=== 内网穿透 === | === 内网穿透 === | ||
Zero Trust -> Access -> Tunnels | Zero Trust -> Networks -> Tunnels | ||
Zero Trust -> Access -> Tunnels(2023 old) | |||
====Create a tunnel==== | ====Create a tunnel==== | ||
第8行: | 第9行: | ||
* Install and run a connector | * Install and run a connector | ||
# 内网主机 | # 内网主机 | ||
https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-x86_64.rpm | # https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-x86_64.rpm | ||
yum localinstall cloudflared.rpm | # yum localinstall cloudflared.rpm | ||
cloudflared service install | cloudflared service install <token> | ||
每个 tunnel 均需要一个 token,如果已经建立过需要更新,那么先删除,再安装: | |||
cloudflared service uninstall | |||
创建 tunnel,还会在相应的域名 DNS 下创建 CNAME 记录,若删除 tunnel,需要同步删除相应的 DNS 解析。 | |||
==== Public hostnames ==== | ==== Public hostnames ==== | ||
===== HTTP ===== | ===== HTTP ===== | ||
Add public hostname for <nowiki>http://localhost:8088</nowiki> | * Add public hostname for <nowiki>http://localhost:8088</nowiki> | ||
p88.server.com --> <nowiki>http://127.0.0.1:8088</nowiki> | p88.server.com --> <nowiki>http://127.0.0.1:8088</nowiki> | ||
第26行: | 第31行: | ||
ssh ssh.server.com | ssh ssh.server.com | ||
=== DNS === | |||
# 在域名提供商 nameserver 中指向 cloudflare(carrera.ns.cloudflare.com, matteo.ns.cloudflare.com) | |||
# 在 cloudflare 建立 DNS 解析,如:A 类解析 mwbbs.eu.org 132.145.61.120。如果某些地区无法正确解析,可以选择:不通过 proxy 处理 | |||
[[分类:Doc]] | |||
[[分类:Help]] |
2024年7月29日 (一) 10:58的最新版本
内网穿透
Zero Trust -> Networks -> Tunnels
Zero Trust -> Access -> Tunnels(2023 old)
Create a tunnel
- Name your tunnel TEST
- Choose your environment
- Install and run a connector
# 内网主机 # https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-x86_64.rpm # yum localinstall cloudflared.rpm cloudflared service install <token>
每个 tunnel 均需要一个 token,如果已经建立过需要更新,那么先删除,再安装:
cloudflared service uninstall
创建 tunnel,还会在相应的域名 DNS 下创建 CNAME 记录,若删除 tunnel,需要同步删除相应的 DNS 解析。
Public hostnames
HTTP
- Add public hostname for http://localhost:8088
p88.server.com --> http://127.0.0.1:8088
SSH
- Add public hostname for localhost:22
ssh.server.com --> ssh://127.0.0.1:22
- Client
# /usr/local/bin/cloudflared .ssh/config Host ssh.server.com ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h ssh ssh.server.com
DNS
- 在域名提供商 nameserver 中指向 cloudflare(carrera.ns.cloudflare.com, matteo.ns.cloudflare.com)
- 在 cloudflare 建立 DNS 解析,如:A 类解析 mwbbs.eu.org 132.145.61.120。如果某些地区无法正确解析,可以选择:不通过 proxy 处理