frp地址

github地址

https://github.com/fatedier/frp

服务端配置

下载解压

1
2
wget https://github.com/fatedier/frp/releases/download/v0.36.2/frp_0.36.2_linux_amd64.tar.gz
tar -zxf frp_0.36.2_linux_amd64.tar.gz

配置文件

frps.ini为服务端配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
[common]
#客户端连接服务器端口
bind_port = 7007
#设置客户端token,对应客户端有页需要配置,
token = oXsSBt4WwkPaR+/Q0bCszCtNWEA=

## server dashboard
#dashboard 用户名
dashboard_user = admin
#dashboard 密码
dashboard_pwd = 1q2w3e4r!
#dashboard 端口,启动成功后可通过浏览器访问如http://ip:8007
dashboard_port = 8007

生成随机token命令

1
cat /dev/urandom | tr -dc a-zA-Z0-9#@= | head -c32;echo

ftps启动

1
nohup ./frps.ini  -c frps.ini

客户端配置

下载解压

1
2
wget https://github.com/fatedier/frp/releases/download/v0.36.2/frp_0.36.2_linux_amd64.tar.gz
tar -zxf frp_0.36.2_linux_amd64.tar.gz

如果是win系统,下载zip包即可

配置文件

frpc.ini为客户端配置文件

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
29
30
31
32
33
34
35
[common]
## server configuration
server_addr = 218.60.xx.xxx
server_port = 7007
token = oXsSBt4WwkPaR+/Q0bCszCtNWEA=

## client dashboard
admin_addr = 192.168.2.190
admin_port = 7004
admin_user = admin
admin_pwd = 5t6y7u8i#

[mstsc]
type = tcp
local_ip = 192.168.2.117
local_port = 3389
remote_port = 9833

[wordpress]
type = tcp
local_ip = 192.168.2.103
local_port = 8082
remote_port = 8082

[Synology]
type = tcp
local_ip = 192.168.2.190
local_port = 5000
remote_port = 5001

[Photo Station]
type = tcp
local_ip = 192.168.2.190
local_port = 80
remote_port = 5002

访问

服务访问

例如[matsc]配置,可通过218.60.xx.xxx:9833来访问192.168.2.117的3389端口

dashboard面板访问

注意:

1
2
1. 服务器端要开启bind_port端口和所有remote_port端口以及服务端的dashboard端口
2. local_ip和local_port不一定非得指定在客户端本机,可以指定到任意可访问节点