For AI agents: the complete documentation index is available at https://www.tteam.icu/zh/llms.txt, the full documentation bundle is available at https://www.tteam.icu/zh/llms-full.txt, and this page is available as Markdown at https://www.tteam.icu/zh/blog/ops/%E3%80%90%E5%AE%9E%E7%94%A8%E7%9A%84%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%B0%8F%E6%8A%80%E5%B7%A7%E3%80%91frp%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F.md.
← 返回博客

FRP内网穿透配置指南

AI 总结AI 生成

FRP 的拓扑很直接:公网服务器运行 frps,内网机器运行 frpc,由客户端主动把服务映射出去。

  1. 在服务端用一键脚本安装 frps。
  2. 在 frpc.ini 中填写服务器、令牌和转发规则。
  3. 按运行环境选择 Windows 或 Docker 启动客户端。

文中的配置文件可以直接替换地址和端口后使用。

服务端安装

一键安装脚本GitHub地址: https://github.com/MvsCode/frps-onekey

wget https://code.aliyun.com/MvsCode/frps-onekey/raw/master/install-frps.sh -O ./install-frps.sh
chmod 700 ./install-frps.sh
./install-frps.sh install

本地客户端配置

创建 frpc.ini 配置文件:

[common]
server_addr = 服务器IP
server_port = 服务器端口
token = 访问令牌

[name]
type = tcp
local_ip = 本地IP
local_port = 本地端口
remote_port = 外网访问端口

启动客户端

Windows系统

frpc.exe -c ./frpc.ini

Docker运行

docker run -d --network host --name frpc --restart=always -v /data/docker/frpc/frpc.ini:/frp/frpc.ini stilleshan/frpc