FRPC和NPS使用方法
🙄请按照这个方法来尝试连接
下面是整理好的 FRPC 使用说明,分为「中文版本」和「English Version」。 示例配置里的内容已全部脱敏,只保留参数名,方便你直接发给客户。
一、中文版本(给客户看的说明)
1. 您将从服务提供方收到什么?
FRPC使用说明
下载地址
- github:Releases · fatedier/frp
你会得到的东西
你会用本 FRP 穿透服务之前,您会从服务提供方收到以下信息(请妥善保管,不要公开):
- serverAddr:FRPS 服务器地址(IP 或域名)
- serverPort:FRPS 端口(例如
7000) - user:您的专属用户名
- token:与该用户对应的密钥
- 可用的 remotePort 列表:允许您使用的远程端口(例如一组端口号)
下文中的所有占位符(如
<SERVER_ADDR>)都需要您替换为服务提供方给您的实际值。
FRPC使用方法(Linux)
2. 准备工作
在您的电脑上创建一个目录,例如:
1
2mkdir -p ~/frp-client
cd ~/frp-client下载适用于您系统的
frpc客户端程序(Linux / Windows / macOS), 然后放到该目录下,并确保有执行权限(Linux):1
chmod +x ./frpc
3. 创建配置文件 frpc.toml
在同一目录下创建文件 frpc.toml,内容示例如下(请务必使用英文和数字,不要写入中文):
1 | # ===== Basic connection settings ===== |
字段说明
serverAddr:替换为服务提供方给你的服务器 IP 或域名,例如"1.2.3.4"。serverPort:替换为服务端端口号,例如7000(不需要引号)。user:替换为服务提供方给你的用户名。token:替换为服务提供方给你的 token。localIP:本地要暴露的服务 IP,一般为"127.0.0.1"或你本机的内网地址。localPort:本地服务端口,例如你的 Web 服务是80,SSH 是22。remotePort:必须从服务提供方给你的「可用端口列表」中选择一个端口号(不加引号)。
注意:请删除示例中的尖括号
< >,直接填写具体的值,例如:
1
2
3
4
5 serverAddr = "1.2.3.4"
serverPort = 7000
user = "u123"
token = "abc123xyz"
remotePort = 10001
4. 如何启动 FRPC
Linux / macOS
在 frpc 和 frpc.toml 所在目录执行:
1 | ./frpc -c frpc.toml |
Windows
在命令提示符(cmd)中进入 frpc.exe 所在目录:
1 | frpc.exe -c frpc.toml |
看到类似输出且无报错,即表示连接成功。
5. 如何添加更多转发服务
如果您已经有一个工作正常的配置,例如 HTTP 转发:
1 | [[proxies]] |
想要再增加一个 SSH 转发,只需要 复制一份 [[proxies]] 块,并修改其中几项:
1 | [[proxies]] |
注意事项:
- 每个
name必须唯一。 - 每个
remotePort必须来自服务提供方给你的「可用端口列表」,且不能重复使用同一个端口。 - 修改完
frpc.toml后,需要重启frpc使配置生效。
6. 常见问题
- FRPC 启动后立即退出
- 检查
serverAddr、serverPort、user、token是否填写正确。 - 检查你的网络是否能访问服务端 IP 和端口。
- 检查
- FRPC 启动正常,但外部访问不上
- 确认本地服务(例如 Web / SSH)在
localIP:localPort上已经正常监听。 - 确认你使用的
remotePort在服务提供方给你的端口范围之内。 - 确认客户端和服务端之间没有额外防火墙阻挡。
- 确认本地服务(例如 Web / SSH)在
二、English Version (For Customers)
1. What information will you receive?
Before using this FRP tunneling service, you will receive the following values from your provider:
- serverAddr: FRPS server address (IP or domain)
- serverPort: FRPS port (e.g.
7000) - user: your dedicated username
- token: the token bound to this user
- Allowed remotePort list: the remote ports you are allowed to use
All placeholders like
<SERVER_ADDR>below must be replaced with the actual values your provider gives you.
2. Preparation
Create a working directory, for example:
1
2mkdir -p ~/frp-client
cd ~/frp-clientDownload the
frpcclient binary for your system (Linux / Windows / macOS) and place it in this directory. On Linux, make it executable:1
chmod +x ./frpc
3. Create the frpc.toml configuration file
In the same directory, create a file named frpc.toml with the following content:
1 | # ===== Basic connection settings ===== |
Field description
serverAddr: replace with the server IP or domain provided by your provider, e.g."1.2.3.4".serverPort: replace with the FRPS port, e.g.7000(no quotes).user: replace with the username you received.token: replace with the token you received.localIP: the IP of your local service, usually"127.0.0.1"or your LAN IP.localPort: the port of your local service, e.g.80for HTTP,22for SSH.remotePort: must be one of the ports from the allowed port list given by your provider (no quotes).
Important: remove the angle brackets
< >and fill in real values, for example:
1
2
3
4
5 serverAddr = "1.2.3.4"
serverPort = 7000
user = "u123"
token = "abc123xyz"
remotePort = 10001
4. How to start FRPC
Linux / macOS
Run in the directory where frpc and frpc.toml are located:
1 | ./frpc -c frpc.toml |
Windows
Open Command Prompt (cmd), go to the folder where frpc.exe is located, and run:
1 | frpc.exe -c frpc.toml |
If there are no error messages and the process keeps running, the connection is likely established.
5. How to add more proxies
If you already have one working proxy, for example:
1 | [[proxies]] |
and you want to expose another service (for example SSH), copy the whole [[proxies]] block and modify a few fields:
1 | [[proxies]] |
Notes:
- Each
namemust be unique. - Each
remotePortmust come from the allowed remote port list provided by your provider, and you should not reuse the same port for different proxies. - After editing
frpc.toml, restartfrpcto apply the changes.
6. FAQ
- FRPC exits immediately after start
- Check if
serverAddr,serverPort,user, andtokenare correct. - Check your network connectivity to the server IP and port.
- Check if
- FRPC is running, but you cannot access the service from outside
- Make sure your local service is actually listening on
localIP:localPort. - Make sure the
remotePortyou use is within the allowed range from your provider. - Make sure there is no firewall blocking the traffic between client and server.
- Make sure your local service is actually listening on