frp 多台客户端通过一台服务器连接穿透

月小升本来以为需要服务器开多个frps才能一台服务器穿透多台客户端,偶然发现其实不用,服务器不用改动,正确配置第二台客户端即可

服务器端配置和一台的配置相同到这里看 https://java-er.com/blog/frp-install/

第一台客户端frpc.ini

[common]
server_addr = 48.95.214.130
server_port = 7000
token = java-er.com
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

第二台客户端frpc.ini

[common]
server_addr = 48.95.214.130
server_port = 7000
token = java-er.com
[ssh2]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6001

两台机器都在链接服务器的7000端口

注意:1. 第二台机器写[ssh2] 和第一台区别开 2. remote_port 写6001 和第一台区别开

这样第一台机器这么frp链接(dy是第一台机器的账户)
ssh -oPort=6000 dy@48.95.214.130 -v
这样第二台机器这么frp链接(roger是第二台机器的账户)
ssh -oPort=6001 roger@48.95.214.130 -v

链接的地方靠6000和6001来区别是那个机器。

下面是第二台客户端被frp穿透的日志

服务器:提示ssh2的tcp代理通过端口6001 链接成功

[I] [service.go:340] client login info: ip [114.248.163.186:39912] version [0.28.2] hostname [] os [linux] arch [amd64]
2019/08/23 16:22:43 [I] [tcp.go:66] [cf9fe2dc6504f508] [ssh2] tcp proxy listen port [6001]
2019/08/23 16:22:43 [I] [control.go:398] [cf9fe2dc6504f508] new proxy [ssh2] success

客户端:机器2

[I] [service.go:224] login to server success, get run id [cf9fe2dc6504f508], server udp port [7001]
2019/08/23 16:22:43 [I] [proxy_manager.go:137] [cf9fe2dc6504f508] proxy added: [ssh2]
2019/08/23 16:22:43 [I] [control.go:144] [ssh2] start proxy success


This entry was posted in Linux and tagged , . Bookmark the permalink.
月小升QQ 2651044202, 技术交流QQ群 178491360
首发地址:月小升博客https://java-er.com/blog/frp-one-server-many-client/
无特殊说明,文章均为月小升原创,欢迎转载,转载请注明本文地址,谢谢
您的评论是我写作的动力

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

  

  

About Me

静水流深,水滴石穿