[GH-ISSUE #1854] xtcp 远程客户端没有获取公网ip,无法p2p #1462

Closed
opened 2026-05-05 12:55:34 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @yyget on GitHub (Jun 12, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1854

frp 0.33.0
服务端环境centos 7 (有公网ip)
远程客户端环境centos 7 (无公网ip)
本地客户端环境win10 (无公网ip)
服务端已配置 udp
远程客户端配置

[webdav2] 
type = xtcp                        
sk = 123456                        
local_ip = 127.0.0.1               
local_port = 9800   

本地客户端配置

[p2p_webdav_visitor]
type = xtcp
role = visitor
server_name = webdav2
sk = 123456
bind_addr = 127.0.0.1
bind_port = 9800

远程客户端debug日志
2020/06/12 16:18:12 [I] [proxy.go:388] [3cbe17d558cd5023] [webdav2] nat hole connection make success, sid [1591949892182bfb2d6f47ae27]
2020/06/12 16:18:12 [D] [proxy.go:770] [3cbe17d558cd5023] [webdav2] join connections, localConn(l[127.0.0.1:58886] r[127.0.0.1:9800]) workConn(l[192
.168.126.4:36732] r[1.192.35.170:6744])
2020/06/12 16:18:12 [D] [proxy.go:778] [3cbe17d558cd5023] [webdav2] join connections closed

查看这一句
workConn(l[192.168.126.4:36732] r[1.192.35.170:6744])
126.4是远程客户端的dhcp地址,并不是公网ip。35.170是本地客户端的公网ip。
请问大神这是什么造成的,我应该怎么做。

Originally created by @yyget on GitHub (Jun 12, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1854 frp 0.33.0 服务端环境centos 7 (有公网ip) 远程客户端环境centos 7 (无公网ip) 本地客户端环境win10 (无公网ip) 服务端已配置 udp 远程客户端配置 ``` [webdav2] type = xtcp sk = 123456 local_ip = 127.0.0.1 local_port = 9800 ``` 本地客户端配置 ``` [p2p_webdav_visitor] type = xtcp role = visitor server_name = webdav2 sk = 123456 bind_addr = 127.0.0.1 bind_port = 9800 ``` 远程客户端debug日志 2020/06/12 16:18:12 [I] [proxy.go:388] [3cbe17d558cd5023] [webdav2] nat hole connection make success, sid [1591949892182bfb2d6f47ae27] 2020/06/12 16:18:12 [D] [proxy.go:770] [3cbe17d558cd5023] [webdav2] join connections, localConn(l[127.0.0.1:58886] r[127.0.0.1:9800]) workConn(l[192 .168.126.4:36732] r[1.192.35.170:6744]) 2020/06/12 16:18:12 [D] [proxy.go:778] [3cbe17d558cd5023] [webdav2] join connections closed 。 查看这一句 workConn(l[192.168.126.4:36732] r[1.192.35.170:6744]) 126.4是远程客户端的dhcp地址,并不是公网ip。35.170是本地客户端的公网ip。 请问大神这是什么造成的,我应该怎么做。
Author
Owner

@xqzr commented on GitHub (Jun 12, 2020):

使用xtcp建议访问者或客户端有公网IP

<!-- gh-comment-id:643230195 --> @xqzr commented on GitHub (Jun 12, 2020): 使用xtcp建议访问者或客户端有公网IP
Author
Owner

@bigbryant commented on GitHub (Jul 7, 2020):

一个可能的解决方案,把远程客户端的frpc架设在主路由器上。我之前也是假设在机器上永远是timeout,后来假设在路由器上就可以穿透了,猜测是nat层级多了之后穿透的难度就增加了,你可以试试

<!-- gh-comment-id:654735993 --> @bigbryant commented on GitHub (Jul 7, 2020): 一个可能的解决方案,把远程客户端的frpc架设在主路由器上。我之前也是假设在机器上永远是timeout,后来假设在路由器上就可以穿透了,猜测是nat层级多了之后穿透的难度就增加了,你可以试试
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1462
No description provided.