惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
L
LINUX DO - 热门话题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
博客园_首页
MongoDB | Blog
MongoDB | Blog
V
V2EX
GbyAI
GbyAI
量子位
Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
B
Blog
Microsoft Security Blog
Microsoft Security Blog
S
SegmentFault 最新的问题
O
OpenAI News
N
News and Events Feed by Topic
博客园 - Franky
爱范儿
爱范儿
Forbes - Security
Forbes - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V2EX - 技术
V2EX - 技术
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
News and Events Feed by Topic
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
人人都是产品经理
人人都是产品经理
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
阮一峰的网络日志
阮一峰的网络日志
D
DataBreaches.Net
Last Week in AI
Last Week in AI
罗磊的独立博客
Spread Privacy
Spread Privacy
Recent Announcements
Recent Announcements
The Cloudflare Blog
Google DeepMind News
Google DeepMind News
AWS News Blog
AWS News Blog
The Register - Security
The Register - Security
Y
Y Combinator Blog
J
Java Code Geeks
I
Intezer

puzzle9 blog

webdav - puzzle9 blog parser video tencent - puzzle9 blog wstunnel - puzzle9 blog rclone - puzzle9 blog debian 转换为 pve - puzzle9 blog nfs - puzzle9 blog caddy - puzzle9 blog webhookd 发布 - puzzle9 blog win 系统部署 by WinRM - puzzle9 blog hl7 初探 - puzzle9 blog realm 端口转发 - puzzle9 blog airflow - puzzle9 blog mysql 迁移到 mssql - puzzle9 blog 租房啊 - puzzle9 blog cr660x 路由器研究 - puzzle9 blog hs8145v 光猫研究 - puzzle9 blog dae 跨墙 - puzzle9 blog ZeroTier 打洞 🕊 - puzzle9 blog WireGuard 组网 - puzzle9 blog
rathole 穿透 - puzzle9 blog
2025-06-10 · via puzzle9 blog

要说 什么简单 省心

唯有 穿透

就是有点耗 流量红尘

定义

这是个内网穿透工具 类似于 frp nps

安装

alpine

1
2
3
4
wget https://mirror.nju.edu.cn/alpine/edge/testing/x86_64/rathole-0.5.0-r0.apk
apk add ./rathole-0.5.0-r0.apk

mkdir /etc/rathole

/etc/init.d/ratholec

1
2
3
4
5
6
7
8
9
10
11
12
13
#!/sbin/openrc-run

name="Rathole Client Service"
description="Rathole Client Service"
command="/usr/bin/rathole"
command_args="-c /etc/rathole/rathole.toml"
pidfile="/run/$SVCNAME.pid"
command_background=true

depend() {
need net
after firewall
}
1
2
3
chmod +x /etc/init.d/ratholec
rc-service ratholec start
rc-update add ratholec

debian

1
2
3
4
5
6
apt install unzip
wget https://github.com/yujqiao/rathole/releases/download/v0.5.0/rathole-x86_64-unknown-linux-gnu.zip
unzip -d /usr/bin/ rathole-x86_64-unknown-linux-gnu.zip
chmod +x /usr/bin/rathole

mkdir /etc/rathole

/etc/systemd/system/ratholes.service

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[Unit]
Description=Rathole Server Service
After=network.target

[Service]
Type=simple
Restart=on-failure
RestartSec=5s
LimitNOFILE=1048576
User=root

WorkingDirectory=/etc/rathole
ExecStart=/usr/bin/rathole -s /etc/rathole/rathole.toml

[Install]
WantedBy=multi-user.target
1
systemctl enable ratholes.service --now

openwrt

/etc/init.d/rathole

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh /etc/rc.common

START=99
USE_PROCD=1
PROG=/data/rathole/rathole

start_service() {
procd_open_instance
procd_set_param command "$PROG" -c /data/rathole/rathole.toml
procd_set_param respawn
procd_close_instance
}

stop_service() {
killall rathole
}

配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
[server]

bind_addr = "0.0.0.0:2333"
default_token = "rathole"

[client]

remote_addr = "{ip}:2333"
default_token = "rathole"


[server.transport]
type = "noise"
[server.transport.noise]
local_private_key = "nKdq0NUp3pcnRzfQEtFI/Qe/GdO6zYh1G56etEZgeIo="

[client.transport]
type = "noise"
[client.transport.noise]
remote_public_key = "OZgtXqojrnphLrNL/o8tFYxkRDCPNaoRfRxbuMOgqHg="


[server.services.go]
bind_addr = "0.0.0.0:16070"


[client.services.go]
local_addr = "127.0.0.1:6070"

这个配置文件可以写到一起 他是用 命令 去区分 当前是运行的 服务端 --server 还是 客户端 --client
置于区分是不是同一个服务 用的是 services.{name} 进行区分的
这个keyrathole --genkey 生成

运行

supervisor

1
2
3
4
[program:rathole]
command=rathole --client /data/rathole/config.toml
directory=/data/rathole
user=root