nomytwins

杭州联通宽带内网转发 cloudflare 的隧道实现 web 访问的经历

  •  
  •   nomytwins · Oct 9, 2023 · 2262 views
    This topic created in 1132 days ago, the information mentioned may be changed or developed.

    电信转了联通发现上行提到了 100M 以上,尝试将内外的 web 服务转发到公网。 经过筛选发现 cloudflare 的 tunnel 服务可以实现端口转发到公网,但是需要在 openwrt 或者 centos 、win 上面安装相关的插件,实现数据转发。 方案一、首先尝试了 openwrt 的 web 服务端口转发,在 op 上安装了相关的软件安装失败 方案二、在 openwrt 尝试通过 docker 安装 centos 、ubuntu 系统实现 web 服务搭建和转发插件搭建,无法安装转发插件失败 方案三、在内外单独一台主机的方案还在尝试,未完待续

    12 replies  •  2023-10-12 16:22:28 +08:00
    totoro625
    totoro625
    Oct 9, 2023
    1
    docker run --name tunnel --restart="unless-stopped" -d cloudflare/cloudflared:latest tunnel --protocol http2 --no-autoupdate run --token xxx

    token 获取: https://one.dash.cloudflare.com/
    建议放在软路由下面,穿透速度的好坏完全依赖你的翻墙速度
    nomytwins
    nomytwins
    OP
    Oct 9, 2023
    2
    @totoro625 不能直通吗?我用 openclash 按说不需要翻就能直通
    nomytwins
    nomytwins
    OP
    Oct 9, 2023
    3
    @totoro625 openwrt 上面的 docker 无限重启
    nomytwins
    nomytwins
    OP
    Oct 10, 2023
    4
    更新成功:
    docker 下拉取 cloudflare/cloudflared:latest
    启动方式一、执行命令 docker run --name tunnel --restart="unless-stopped" -d cloudflare/cloudflared:latest tunnel --protocol http2 --no-autoupdate run --token xxx
    启动方式二、增加容器复制命令即可
    nomytwins
    nomytwins
    OP
    Oct 10, 2023
    5
    docker 的命令行里面填入的是 tunnel run --token xxxxx 不要写其他
    goodryb
    goodryb
    Oct 10, 2023
    6
    杭州联通我记得是给公网 IP 的,直接端口转发出去
    nomytwins
    nomytwins
    OP
    Oct 10, 2023
    7
    @goodryb 给公网 ip ,但是不如独立域名 443 80 香啊
    PXW139
    PXW139
    Oct 12, 2023
    8
    如果只是图一个 80/443 端口访问,要不试试 iframe 套娃访问,访问速度比套 cf 快多了
    nomytwins
    nomytwins
    OP
    Oct 12, 2023
    9
    @PXW139 那在外部不得部署个 web 服务,这个内网开机就能一直用
    PXW139
    PXW139
    Oct 12, 2023
    10
    @nomytwins Cloudflare Pages
    nomytwins
    nomytwins
    OP
    Oct 12, 2023
    11
    @PXW139 frame 会把自己的 ip 暴露吧
    PXW139
    PXW139
    Oct 12, 2023
    12
    @nomytwins 那就没办法咯,安全与方便不可兼得,做好安全防护,家宽谁没事做来打你 XD
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1858 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 1949ms · UTC 06:05 · PVG 14:05 · LAX 22:05 · JFK 01:05
    ♥ Do have faith in what you're doing.