拉不拉稀肚拉稀 发表于 2025-4-12 00:10:23

通过Cloudflare实现内网穿透,远程毗连内网服务器。

目次
前置条件
一、创建 Cloudflare Zero Trust
二、创建 Tunnel
三、客户机毗连服务器
前置条件



[*]持有一个域名并成功托管到 CF(网上有很多免费域名申讨教程,找最近发布的教程)
一、创建 Cloudflare Zero Trust

Cloudflare官网https://csdnimg.cn/release/blog_editor_html/release2.3.8/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=P1C7https://dash.cloudflare.com/


[*]左侧栏进入 Zero Trust
https://i-blog.csdnimg.cn/direct/40774d9a7d4c4d538b3a167863a5f155.png


[*]创建 Zero Trust ,选择免费操持,添加 credit card 或 PayPal (用于验证,不会扣费,也可通过修改当前页面url跳过支付方式绑定)
https://i-blog.csdnimg.cn/direct/0bb2880c325f4d61a72d9dcc4a29ce23.png
二、创建 Tunnel



[*]进入 Zero Trust 后依次点击 -->网络 -->隧道
https://i-blog.csdnimg.cn/direct/0d82692239414fe89341e404ba813fba.png


[*]使用 Cloudflare 创建隧道 
https://i-blog.csdnimg.cn/direct/bcbcccd0bf754fc1ad13d5407365e618.png


[*]输入隧道名
https://i-blog.csdnimg.cn/direct/16831c97100947e19bae5feebd0f5382.png


[*]根据服务器的情况选择对应的下载方式
https://i-blog.csdnimg.cn/direct/34fdc00726ca4d73a102fc6769f76c4e.png


[*]选择本身托管到 CF 的域名并创建一个子域,服务范例选择 SSH, URL 填写 localhost:22
https://i-blog.csdnimg.cn/direct/8e7205ddd12d416193984c8fdc5c6ddf.png
三、客户机毗连服务器



[*] 这里假设客户机为 Windows 操纵体系,下载对应的 Cloudflare 程序
Downloads · Cloudflare Zero Trust docsCloudflare Tunnel requires the installation of a lightweight server-side daemon, cloudflared, to connect your infrastructure to Cloudflare. If you are creating a tunnel through the dashboard, you can simply copy-paste the installation command shown in the dashboard.https://csdnimg.cn/release/blog_editor_html/release2.3.8/ckeditor/plugins/CsdnLink/icons/icon-default.png?t=P1C7https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/#windows


[*]  在 ssh 配置文件中参加以下内容,注意修改 HostName 为实际地点
Host CloudFlare
HostName example.com
ProxyCommand C:\Program Files (x86)\cloudflared\cloudflared.exe access ssh --hostname %h

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: 通过Cloudflare实现内网穿透,远程毗连内网服务器。