Files
nexus/openclaw/xingyao/frp/frp-config-notes.md
2026-03-24 05:58:31 +08:00

347 lines
7.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# FRP 配置详细笔记
> 更新时间: 2026-03-24
## 概述
本文档记录 macmini、ubuntu2、NAS 三个服务器上的 FRPFast Reverse Proxy客户端配置信息。
---
## 服务器配置总览
| 服务器 | FRP目录 | 配置文件 |
|--------|---------|----------|
| macmini | `/opt/frp/frp_0.65.0_darwin_arm64` | `frpc.toml` |
| ubuntu2 | `/opt/frp/frp_0.65.0_linux_amd64` | `frpc.toml` |
| NAS | `/opt/frp_0.65.0_linux_amd64` | `frpc.toml` |
> ⚠️ **注意**: NAS 的 FRP 目录路径与其他服务器不同,没有中间的 `frp/` 子目录
---
## FRP 服务器信息
| 配置项 | 值 |
|--------|-----|
| serverAddr | 192.227.222.142 (VPS1) |
| serverPort | 7000 |
| auth.token | Gg8sqHJVgh42KQ0oTatMjl6AywWqAzaaT0B77a4qD46tXtoH9j9mXb2k1YitObhs |
| webServer.addr | 127.0.0.1 |
| webServer.port | 7400 |
| webServer.user | admin |
| webServer.password | admin |
---
## 1. MacMini 配置
### 基本信息
- **FRP目录**: `/opt/frp/frp_0.65.0_darwin_arm64`
- **配置文件**: `frpc.toml`
- **运行用户**: root (通过 tmux 管理)
### 代理配置列表
| 名称 | 类型 | LocalPort | RemotePort | 说明 |
|------|------|------------|-------------|------|
| macmini-ssh | tcp | 22 | 60026 | SSH反向代理 |
| n8n | tcp | 5678 | 15679 | n8n自动化工具 |
| vaultwarden | tcp | 5151 | 15151 | 密码管理器 |
| it-tools | tcp | 8999 | 18999 | IT工具集合 |
| drawio | tcp | 8085 | 18085 | 绘图工具 |
### 完整配置文件内容
```toml
# frpc.toml
# 客户端配置文件
# 服务器地址与认证
serverAddr = "192.227.222.142"
serverPort = 7000
auth.method = "token"
auth.token = "Gg8sqHJVgh42KQ0oTatMjl6AywWqAzaaT0B77a4qD46tXtoH9j9mXb2k1YitObhs"
# 日志配置
log.level = "info"
log.maxDays = 3
log.disablePrintColor = false
# 管理界面(可选)
webServer.addr = "127.0.0.1"
webServer.port = 7400
webServer.user = "admin"
webServer.password = "admin"
# 代理配置
[[proxies]]
name = "macmini-ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 60026
[[proxies]]
name = "n8n"
type = "tcp"
localIP = "127.0.0.1"
localPort = 5678
remotePort = 15679
[[proxies]]
name = "vaultwarden"
type = "tcp"
localIP = "127.0.0.1"
localPort = 5151
remotePort = 15151
[[proxies]]
name = "it-tools"
type = "tcp"
localIP = "127.0.0.1"
localPort = 8999
remotePort = 18999
[[proxies]]
name = "drawio"
type = "tcp"
localIP = "127.0.0.1"
localPort = 8085
remotePort = 18085
```
---
## 2. Ubuntu2 配置
### 基本信息
- **FRP目录**: `/opt/frp/frp_0.65.0_linux_amd64`
- **配置文件**: `frpc.toml`
- **运行用户**: root (通过 tmux 管理)
### 代理配置列表
| 名称 | 类型 | LocalPort | RemotePort | 说明 |
|------|------|------------|-------------|------|
| ubuntu2-ssh | tcp | 22 | 60024 | SSH反向代理 |
| tk-dev | tcp | 8888 | 18889 | TikTok开发环境 |
### 完整配置文件内容
```toml
# frpc.toml
# 客户端配置文件
# 服务器地址与认证
serverAddr = "192.227.222.142"
serverPort = 7000
auth.method = "token"
auth.token = "Gg8sqHJVgh42KQ0oTatMjl6AywWqAzaaT0B77a4qD46tXtoH9j9mXb2k1YitObhs"
# 日志配置
log.level = "info"
log.maxDays = 3
log.disablePrintColor = false
# 管理界面(可选)
webServer.addr = "127.0.0.1"
webServer.port = 7400
webServer.user = "admin"
webServer.password = "admin"
# 示例1SSH 反向代理(将本地 22 端口暴露到服务器的 60024 端口)
[[proxies]]
name = "ubuntu2-ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 60024
[[proxies]]
name = "tk-dev"
type = "tcp"
localIP = "127.0.0.1"
localPort = 8888
remotePort = 18889
```
---
## 3. NAS 配置
### 基本信息
- **FRP目录**: `/opt/frp_0.65.0_linux_amd64` (⚠️ 注意:路径不同)
- **配置文件**: `frpc.toml`
- **运行用户**: root
### 代理配置列表
| 名称 | 类型 | LocalPort | RemotePort | 说明 |
|------|------|------------|-------------|------|
| nas | tcp | 5000 | 15000 | DSM管理界面 |
| navidrome | tcp | 4533 | 14533 | 音乐服务器 |
| calibre | tcp | 8083 | 18083 | 电子书管理 |
| webdav | tcp | 5005 | 65005 | WebDAV服务 |
| miniflux | tcp | 8080 | 18080 | RSS阅读器 |
| zipline | tcp | 3333 | 13333 | URL短链接 |
| nas_ssh | tcp | 22 | 60023 | SSH反向代理 |
| mysql | tcp | 3307 | 63307 | MySQL数据库 |
| nas_web | tcp | 80 | 10080 | Web服务 |
| jellyfin | tcp | 8096 | 18096 | 媒体服务器 |
### 完整配置文件内容
```toml
# FRP Client Configuration for NAS
# Converted from frpc.ini
serverAddr = "192.227.222.142"
serverPort = 7000
[auth]
token = "Gg8sqHJVgh42KQ0oTatMjl6AywWqAzaaT0B77a4qD46tXtoH9j9mXb2k1YitObhs"
[[proxies]]
name = "nas"
type = "tcp"
localIP = "127.0.0.1"
localPort = 5000
remotePort = 15000
[[proxies]]
name = "navidrome"
type = "tcp"
localIP = "127.0.0.1"
localPort = 4533
remotePort = 14533
[[proxies]]
name = "calibre"
type = "tcp"
localIP = "127.0.0.1"
localPort = 8083
remotePort = 18083
[[proxies]]
name = "webdav"
type = "tcp"
localIP = "127.0.0.1"
localPort = 5005
remotePort = 65005
[[proxies]]
name = "miniflux"
type = "tcp"
localIP = "127.0.0.1"
localPort = 8080
remotePort = 18080
[[proxies]]
name = "zipline"
type = "tcp"
localIP = "127.0.0.1"
localPort = 3333
remotePort = 13333
[[proxies]]
name = "nas_ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 60023
[[proxies]]
name = "mysql"
type = "tcp"
localIP = "127.0.0.1"
localPort = 3307
remotePort = 63307
[[proxies]]
name = "nas_web"
type = "tcp"
localIP = "127.0.0.1"
localPort = 80
remotePort = 10080
[[proxies]]
name = "jellyfin"
type = "tcp"
localIP = "127.0.0.1"
localPort = 8096
remotePort = 18096
```
---
## 端口映射汇总
### 按 RemotePort 排序
| RemotePort | 服务器 | 服务名称 |
|------------|--------|----------|
| 60022 | ubuntu1 | ssh |
| 60023 | NAS | nas_ssh |
| 60024 | ubuntu2 | ubuntu2-ssh |
| 60026 | macmini | macmini-ssh |
| 10080 | NAS | nas_web |
| 13333 | NAS | zipline |
| 14533 | NAS | navidrome |
| 15000 | NAS | nas |
| 15151 | macmini | vaultwarden |
| 15679 | macmini | n8n |
| 18083 | NAS | calibre |
| 18085 | macmini | drawio |
| 18096 | NAS | jellyfin |
| 18889 | ubuntu2 | tk-dev |
| 18999 | macmini | it-tools |
| 63307 | NAS | mysql |
| 65005 | NAS | webdav |
---
## FRP 管理命令
### 查看状态
```bash
# SSH到服务器后连接tmux会话
ssh <服务器名>
tmux attach -t frpc
```
### 重启FRP
```bash
# 在tmux中按 Ctrl+C 停止,然后重新运行
./frpc -c frpc.toml
```
### 常用命令速查
| 服务器 | SSH别名 | FRP目录 | TMUX会话 |
|--------|---------|---------|----------|
| macmini | `ssh macmini` | /opt/frp/frp_0.65.0_darwin_arm64 | frpc |
| ubuntu1 | `ssh ubuntu1` | /opt/frp/frp_0.65.0_linux_amd64 | frpc |
| ubuntu2 | `ssh ubuntu2` | /opt/frp/frp_0.65.0_linux_amd64 | frpc |
| NAS | `ssh nas` | /opt/frp_0.65.0_linux_amd64 | frpc |
---
## 相关域名映射
| 域名 | 目标服务 | RemotePort |
|------|----------|------------|
| n8n.ishenwei.online | n8n | 15679 |
| vaultwarden.ishenwei.online | vaultwarden | 15151 |
| it-tools.ishenwei.online | it-tools | 18999 |
| drawio.ishenwei.online | drawio | 18085 |
| tk-dev.ishenwei.online | tk-dev | 18889 |
| nas.ishenwei.online | DSM | 15000 |
| navidrome.ishenwei.online | navidrome | 14533 |
| calibre.ishenwei.online | calibre-web | 18083 |
| jellyfin.ishenwei.online | jellyfin | 18096 |
| zipline.ishenwei.online | zipline | 13333 |
---
> 📝 笔记记录时间: 2026-03-24 by 星曜