Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtcp希望能增加 -u,是用upnp连接打洞 #4244

Closed
1 of 11 tasks
wuai1024 opened this issue May 27, 2024 · 7 comments
Closed
1 of 11 tasks

xtcp希望能增加 -u,是用upnp连接打洞 #4244

wuai1024 opened this issue May 27, 2024 · 7 comments

Comments

@wuai1024
Copy link

Describe the feature request

目前需要将 提供端 frpc 使用 dmz 给暴漏出去,这样设置后,别的ip就无法利用剩余的端口了。

出口路由器一般会支持设置 upnp 希望能是用一个参数,让 frpc 去局域网中查找提供 upnp 服务的。

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
@xqzr
Copy link

xqzr commented May 28, 2024

#1823

@wuai1024
Copy link
Author

如果考虑到支持这个功能,我可以提供测试环境,或者帮忙测试。

@xqzr
Copy link

xqzr commented May 28, 2024

或者 增加选项,设置 UDP 打洞数据包的 源端口。这样,在路由器(网关)“端口映射”设置的 源端口,也有机会 获得 NAT1。

@fatedier
Copy link
Owner

fatedier commented May 29, 2024

upnp 相关的内容在 #4112 中跟进,你可以使用对应的 PR 编译进行测试。

也可以反馈当前 p2p 打洞两端的环境和日志,有助于帮助我们进行优化。

@wuai1024
Copy link
Author

wuai1024 commented Jun 6, 2024

upnp 相关的内容在 #4112 中跟进,你可以使用对应的 PR 编译进行测试。

也可以反馈当前 p2p 打洞两端的环境和日志,有助于帮助我们进行优化。

xtcpproxy 端日志:

2024-06-06 14:50:56.021 [I] [proxy/xtcp.go:72] [5e414b2fc219fc0f] [ikuai.ssh] nathole prepare success, nat type: EasyNAT, behavior: BehaviorNoChange, addresses: [2.2.2.2:9361 2.2.2.2:9361], assistedAddresses: [192.168.253.3:49192]
2024-06-06 14:50:56.030 [I] [proxy/xtcp.go:93] [5e414b2fc219fc0f] [ikuai.ssh] get natHoleRespMsg, sid [1717656655e974dc6a4af62f69], protocol [quic], candidate address [103.155.100.146:36738 103.155.100.145:36738], assisted address [192.168.6.21:49262 192.168.11.3:49262], detectBehavior: {Role:receiver Mode:1 TTL:7 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[{From:36733 To:36743}] SendRandomPorts:0 ListenRandomPorts:0}
2024-06-06 14:50:56.040 [I] [proxy/xtcp.go:72] [5e414b2fc219fc0f] [ikuai.drive] nathole prepare success, nat type: EasyNAT, behavior: BehaviorNoChange, addresses: [2.2.2.2:9362 2.2.2.2:9362], assistedAddresses: [192.168.253.3:49416]
2024-06-06 14:50:56.048 [I] [proxy/xtcp.go:93] [5e414b2fc219fc0f] [ikuai.drive] get natHoleRespMsg, sid [1717656655b4ca0d05af26398f], protocol [quic], candidate address [103.155.100.134:42432 103.155.100.133:42432], assisted address [192.168.6.21:65156 192.168.11.3:65156], detectBehavior: {Role:receiver Mode:1 TTL:7 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[{From:42427 To:42437}] SendRandomPorts:0 ListenRandomPorts:0}
2024-06-06 14:50:57.066 [I] [proxy/xtcp.go:109] [5e414b2fc219fc0f] [ikuai.ssh] establishing nat hole connection successful, sid [1717656655e974dc6a4af62f69], remoteAddr [3.3.3.3:49262]
2024-06-06 14:50:57.069 [I] [proxy/xtcp.go:109] [5e414b2fc219fc0f] [ikuai.drive] establishing nat hole connection successful, sid [1717656655b4ca0d05af26398f], remoteAddr [3.3.3.3:65156]

xtcpvisitors 端日志:

2024-06-06 14:50:53.202 [I] [visitor/visitor_manager.go:121] [985f1072d95b89c5] start visitor success
2024-06-06 14:50:53.202 [I] [visitor/visitor_manager.go:121] [985f1072d95b89c5] start visitor success
2024-06-06 14:50:53.202 [I] [visitor/visitor_manager.go:172] [985f1072d95b89c5] visitor added: [mac.nacos mac.ikuai mac.synology-ssh mac.hp-print mac.sonar mac.stabe-diffusion mac.sshd-frpc-ssh mac.sshd-frpc-web mac.ssh mac.drive]
2024-06-06 14:50:53.221 [I] [client/control.go:168] [985f1072d95b89c5] [mac.proxy] start proxy success
2024-06-06 14:50:53.740 [I] [visitor/xtcp.go:283] [985f1072d95b89c5] [mac.ssh] nathole prepare success, nat type: HardNAT, behavior: BehaviorIPChanged, addresses: [103.155.100.146:36738 103.155.100.145:36738], assistedAddresses: [192.168.6.21:49262 192.168.11.3:49262]
2024-06-06 14:50:53.747 [I] [visitor/xtcp.go:283] [985f1072d95b89c5] [mac.drive] nathole prepare success, nat type: HardNAT, behavior: BehaviorIPChanged, addresses: [103.155.100.134:42432 103.155.100.133:42432], assistedAddresses: [192.168.6.21:65156 192.168.11.3:65156]
2024-06-06 14:50:55.128 [I] [visitor/xtcp.go:309] [985f1072d95b89c5] [mac.ssh] get natHoleRespMsg, sid [1717656655e974dc6a4af62f69], protocol [quic], candidate address [2.2.2.2:9361], assisted address [192.168.253.3:49192], detectBehavior: {Role:sender Mode:1 TTL:0 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:0}
2024-06-06 14:50:55.146 [I] [visitor/xtcp.go:309] [985f1072d95b89c5] [mac.drive] get natHoleRespMsg, sid [1717656655b4ca0d05af26398f], protocol [quic], candidate address [2.2.2.2:9362], assisted address [192.168.253.3:49416], detectBehavior: {Role:sender Mode:1 TTL:0 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:0}
2024-06-06 14:50:55.166 [I] [visitor/xtcp.go:320] [985f1072d95b89c5] [mac.ssh] establishing nat hole connection successful, sid [1717656655e974dc6a4af62f69], remoteAddr [2.2.2.2:9361]
2024-06-06 14:50:55.168 [I] [visitor/xtcp.go:320] [985f1072d95b89c5] [mac.drive] establishing nat hole connection successful, sid [1717656655b4ca0d05af26398f], remoteAddr [2.2.2.2:9362]

目前 proxy 在 NAT1 环境下,visitors 在 NAT4 环境下,打洞成功!

@fatedier
Copy link
Owner

fatedier commented Jun 6, 2024

@wuai1024 成功的是原生版本还是 upnp PR 编译出来的版本?

我们希望收集的是默认情况下无法成功,开启 upnp 后成功的场景。

@xqzr
Copy link

xqzr commented Jun 6, 2024

proxy 在 NAT1 环境下,visitors 在 NAT4 环境下,打洞成功!

符合预期

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants