源项目地址:https://github.com/fatedier/frp

  1. linux安装

下载对应的包解压
设置开机自启,新建服务

vim /etc/systemd/system/frps.service

写入内容

[Unit]
# 服务名称,可自定义
Description = frp server
After = network.target syslog.target
Wants = network.target

[Service]
Type = simple
# 启动frps的命令,需修改为您的frps的安装路径
ExecStart = /path/to/frps -c /path/to/frps.ini

[Install]
WantedBy = multi-user.target
  • 启动frp

systemctl start frps

  • 停止frp

systemctl stop frps

  • 重启frp

systemctl restart frps

  • 查看frp状态

systemctl status frps

  • 配置 frps 开机自启

systemctl enable frps

服务端基本配置
[common]
bind_port= 12345                   #和客户端连接的端口
kcp_bind_port = 12345              #和客户端连接的端口
dashboard_user= admin              #面板用户名
dashboard_pwd= 123456              #面板密码
dashboard_port= 1234               #面板端口
token = 123456789000               #客户端连接密钥
客户端基本配置
[common]
server_addr = 123.1.152.1          #服务端地址
server_port = 12345                #服务端连接端口
token = 123456789000               #服务端密钥

[debian-ssh]                       #端口说明
type = tcp                         #连接类型
local_ip = 127.0.0.1               #本地IP
local_port = 100                   #本地端口
remote_port = 101                  #服务端端口

[range:debian-web]                 #range:为范围端口标记
type = tcp
local_ip = 127.0.0.1
local_port = 10049-10065,13306
remote_port = 10049-10065,13306

Windows和Docker启动方式大同小异,配置文件是一模一样的