群晖 Frp Docker 记录

**一、Linux服务端**

1. 服务端搭建
https://hub.docker.com/r/stilleshan/frps

docker pull stilleshan/frps

2. 服务端配置启动

mkdir /etc/frp
touch /etc/frp/frps.ini
cat > /etc/frp/frps.ini << EOF
[common]
bind_port = 7000
token = noth.me  #自行修改
EOF
/etc/frp/frps.in 配置
bind_port = 7000 # 通讯端口
token = noth.me  # 认证密钥

dashboard_port = 7001 #frp面板端口 dashboard_user = admin # frp面板用户名 dashboard_pwd = 123123 # frp面板用户密码

vhost_http_port = 7002 # http监听端口 vhost_https_port = 7003 # https监听端口

tcp_mux = true # 是否启用tcp复用,默认为true allow_ports = 2000-3000,3001,3003,4000-50000 # 端口白名单 log_max_days = 7 # 保存多少天日志 log_file = frps.log log_level = info # trace, debug, info, warn, error

3. 服务端启动

docker run -d --name=frps --restart=always \
    --network host \
    -v /etc/frp/frps.ini:/frp/frps.ini  \
    stilleshan/frps

二、群晖

  1. 安装DOCKER
  2. 拉取snowdreamtech-frpc1映像
  3. 设置注意
勾选使用高权限执行容器
选择卷,添加文件-指定到你frpc.ini所在的位置装载路径为/frp/frpc.ini

三、配置文件参考

# 云主机IP
server_addr = ip
# 服务端监听端口
server_port = 10000
# 服务端认证token
token = ********

[common] server_addr = frp.noth.me # 服务器IP或者地址 server_port = 7000 # 服务器提供的端口号 token = noth.me # 服务器的token

[web_xxxxxx] # 不要服务器端其他配置重名 type = tcp # http协议,我的https不能运行 local_ip = 192.168.1.5 # 填写本地IP. local_port = 5000 # 本地端口 custom_domains = web.noth.me # 填写你的域名

[ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 5022

[synology] type = tcp
local_ip = 127.0.0.1 local_port = 5000 remote_port = 5000 use_compression = true #传输内容进行压缩 use_encryption = true #frps 和 frpc 之间的消息将被加密

四、其他

  1. 查看frp是否正常运行
docker ps
docker logs -f -t --tail=100 frps
正常运行,日志frps started successfully,无error 之类错误
  1. VPS主机访问 dashboard_port应该能正常访问

**3. 修改配置及重启

vi /root/frps/frps.ini

修改 frps.ini 配置

docker restart frps

重启 frps 容器即可生效

Frp 客户端下载

https://github.com/fatedier/frp/releases/tag/v0.39.1

完整文档
[https://gofrp.org](https://gofrp.org/docs)