[GH-ISSUE #4232] The xtcp connection is down #3334

Closed
opened 2026-05-05 14:09:06 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @wuai1024 on GitHub (May 21, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4232

Describe the feature request

2024-05-21 17:27:58.704 [I] [sub/root.go:142] start frpc service for config file [frpc.yaml]
2024-05-21 17:27:58.705 [I] [client/service.go:294] try to connect to server...
2024-05-21 17:27:58.812 [I] [client/service.go:286] [5c289ba45db687ca] login to server success, get run id [5c289ba45db687ca]
2024-05-21 17:27:58.813 [I] [visitor/visitor_manager.go:121] [5c289ba45db687ca] start visitor success
2024-05-21 17:27:58.813 [I] [visitor/visitor_manager.go:172] [5c289ba45db687ca] visitor added: [mac-temp.ssh]
2024-05-21 17:27:59.330 [I] [visitor/xtcp.go:283] [5c289ba45db687ca] [mac-temp.ssh] nathole prepare success, nat type: HardNAT, behavior: BehaviorIPChanged, addresses: [103.155.100.145:6807 103.155.100.146:6807], assistedAddresses: [192.168.7.104:54777]
2024-05-21 17:28:02.003 [I] [visitor/xtcp.go:309] [5c289ba45db687ca] [mac-temp.ssh] get natHoleRespMsg, sid [1716283678f6538625a86f4f00], protocol [kcp], candidate address [45.140.88.18:34306 45.140.88.18:49620], assisted address [192.168.1.24:44500 172.18.0.1:44500 172.17.0.1:44500], detectBehavior: {Role:sender Mode:0 TTL:0 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:0}
2024-05-21 17:28:07.005 [W] [visitor/xtcp.go:316] [5c289ba45db687ca] [mac-temp.ssh] make hole error: wait detect message error: read udp4 0.0.0.0:54777: i/o timeout

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
Originally created by @wuai1024 on GitHub (May 21, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4232 ### Describe the feature request ```log 2024-05-21 17:27:58.704 [I] [sub/root.go:142] start frpc service for config file [frpc.yaml] 2024-05-21 17:27:58.705 [I] [client/service.go:294] try to connect to server... 2024-05-21 17:27:58.812 [I] [client/service.go:286] [5c289ba45db687ca] login to server success, get run id [5c289ba45db687ca] 2024-05-21 17:27:58.813 [I] [visitor/visitor_manager.go:121] [5c289ba45db687ca] start visitor success 2024-05-21 17:27:58.813 [I] [visitor/visitor_manager.go:172] [5c289ba45db687ca] visitor added: [mac-temp.ssh] 2024-05-21 17:27:59.330 [I] [visitor/xtcp.go:283] [5c289ba45db687ca] [mac-temp.ssh] nathole prepare success, nat type: HardNAT, behavior: BehaviorIPChanged, addresses: [103.155.100.145:6807 103.155.100.146:6807], assistedAddresses: [192.168.7.104:54777] 2024-05-21 17:28:02.003 [I] [visitor/xtcp.go:309] [5c289ba45db687ca] [mac-temp.ssh] get natHoleRespMsg, sid [1716283678f6538625a86f4f00], protocol [kcp], candidate address [45.140.88.18:34306 45.140.88.18:49620], assisted address [192.168.1.24:44500 172.18.0.1:44500 172.17.0.1:44500], detectBehavior: {Role:sender Mode:0 TTL:0 SendDelayMs:0 ReadTimeoutMs:5000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:0} 2024-05-21 17:28:07.005 [W] [visitor/xtcp.go:316] [5c289ba45db687ca] [mac-temp.ssh] make hole error: wait detect message error: read udp4 0.0.0.0:54777: i/o timeout ``` ### 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
Author
Owner

@xqzr commented on GitHub (May 21, 2024):

nat type: HardNAT

可能 ISP 将 NAT 类型更改为更严格的

<!-- gh-comment-id:2122336569 --> @xqzr commented on GitHub (May 21, 2024): > nat type: **HardNAT** 可能 ISP 将 NAT 类型更改为更严格的
Author
Owner

@wuai1024 commented on GitHub (May 22, 2024):

我的是全锥型网络

<!-- gh-comment-id:2123751739 --> @wuai1024 commented on GitHub (May 22, 2024): 我的是全锥型网络
Author
Owner

@fatedier commented on GitHub (May 22, 2024):

分类为 HardNAT ,无法穿透属于正常现象,文档中已经说明可用性和稳定性无法保证,在需要可靠连接的情况下,建议使用 STCP 替代。

建议可以多次尝试,以及配置 keepTunnelOpen = true 自动重试,如果还是不行建议放弃。

<!-- gh-comment-id:2123779640 --> @fatedier commented on GitHub (May 22, 2024): 分类为 HardNAT ,无法穿透属于正常现象,文档中已经说明可用性和稳定性无法保证,在需要可靠连接的情况下,建议使用 STCP 替代。 建议可以多次尝试,以及配置 `keepTunnelOpen = true` 自动重试,如果还是不行建议放弃。
Author
Owner

@wuai1024 commented on GitHub (May 22, 2024):

提供端 frpc 日志

2024-05-22 14:43:51.279 [I] [proxy/xtcp.go:72] [bb07b93ee913cc78] [ikuai.ssh-xtcp] nathole prepare success, nat type: EasyNAT, behavior: BehaviorNoChange, addresses: [117.143.124.254:9392 117.143.124.254:9392], assistedAddresses: [192.168.253.3:35594]
2024-05-22 14:43:52.290 [I] [proxy/xtcp.go:93] [bb07b93ee913cc78] [ikuai.ssh-xtcp] get natHoleRespMsg, sid [1716360230ec3bb64dfc6c37f9], protocol [kcp], candidate address [103.155.100.136:3750 103.155.100.135:3750], assisted address [192.168.6.166:58597], detectBehavior: {Role:sender Mode:2 TTL:0 SendDelayMs:3000 ReadTimeoutMs:35000 CandidatePorts:[] SendRandomPorts:1000 ListenRandomPorts:0}

访问端frpc日志:

2024-05-22 14:44:31.090 [I] [visitor/xtcp.go:283] [6cae7aba85645393] [mac-temp.ssh] nathole prepare success, nat type: HardNAT, behavior: BehaviorIPChanged, addresses: [103.155.100.148:62382 103.155.100.147:62382], assistedAddresses: [192.168.6.166:60626]
2024-05-22 14:44:31.929 [I] [visitor/xtcp.go:309] [6cae7aba85645393] [mac-temp.ssh] get natHoleRespMsg, sid [17163602708250f12fa9b2a3d2], protocol [kcp], candidate address [117.143.124.254:9457], assisted address [192.168.253.3:45388], detectBehavior: {Role:receiver Mode:2 TTL:7 SendDelayMs:0 ReadTimeoutMs:38000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:256}
2024-05-22 14:44:50.521 [E] [visitor/xtcp.go:179] [6cae7aba85645393] [mac-temp.ssh] open tunnel error: open tunnel timeout
2024-05-22 14:45:07.861 [W] [visitor/xtcp.go:146] [6cae7aba85645393] [mac-temp.ssh] keepTunnelOpenWorker get tunnel connection error: no tunnel session
2024-05-22 14:45:09.955 [W] [visitor/xtcp.go:316] [6cae7aba85645393] [mac-temp.ssh] make hole error: wait detect message timeout
<!-- gh-comment-id:2123994468 --> @wuai1024 commented on GitHub (May 22, 2024): > 提供端 frpc 日志 ``` shell 2024-05-22 14:43:51.279 [I] [proxy/xtcp.go:72] [bb07b93ee913cc78] [ikuai.ssh-xtcp] nathole prepare success, nat type: EasyNAT, behavior: BehaviorNoChange, addresses: [117.143.124.254:9392 117.143.124.254:9392], assistedAddresses: [192.168.253.3:35594] 2024-05-22 14:43:52.290 [I] [proxy/xtcp.go:93] [bb07b93ee913cc78] [ikuai.ssh-xtcp] get natHoleRespMsg, sid [1716360230ec3bb64dfc6c37f9], protocol [kcp], candidate address [103.155.100.136:3750 103.155.100.135:3750], assisted address [192.168.6.166:58597], detectBehavior: {Role:sender Mode:2 TTL:0 SendDelayMs:3000 ReadTimeoutMs:35000 CandidatePorts:[] SendRandomPorts:1000 ListenRandomPorts:0} ``` > 访问端frpc日志: ``` shell 2024-05-22 14:44:31.090 [I] [visitor/xtcp.go:283] [6cae7aba85645393] [mac-temp.ssh] nathole prepare success, nat type: HardNAT, behavior: BehaviorIPChanged, addresses: [103.155.100.148:62382 103.155.100.147:62382], assistedAddresses: [192.168.6.166:60626] 2024-05-22 14:44:31.929 [I] [visitor/xtcp.go:309] [6cae7aba85645393] [mac-temp.ssh] get natHoleRespMsg, sid [17163602708250f12fa9b2a3d2], protocol [kcp], candidate address [117.143.124.254:9457], assisted address [192.168.253.3:45388], detectBehavior: {Role:receiver Mode:2 TTL:7 SendDelayMs:0 ReadTimeoutMs:38000 CandidatePorts:[] SendRandomPorts:0 ListenRandomPorts:256} 2024-05-22 14:44:50.521 [E] [visitor/xtcp.go:179] [6cae7aba85645393] [mac-temp.ssh] open tunnel error: open tunnel timeout 2024-05-22 14:45:07.861 [W] [visitor/xtcp.go:146] [6cae7aba85645393] [mac-temp.ssh] keepTunnelOpenWorker get tunnel connection error: no tunnel session 2024-05-22 14:45:09.955 [W] [visitor/xtcp.go:316] [6cae7aba85645393] [mac-temp.ssh] make hole error: wait detect message timeout ```
Author
Owner

@wuai1024 commented on GitHub (May 22, 2024):

目前是一端为 NAT1 ,一端为 NAT4

<!-- gh-comment-id:2123995538 --> @wuai1024 commented on GitHub (May 22, 2024): 目前是一端为 NAT1 ,一端为 NAT4
Author
Owner

@wuai1024 commented on GitHub (May 22, 2024):

已成功了,谢谢大佬 @fatedier !

<!-- gh-comment-id:2124026298 --> @wuai1024 commented on GitHub (May 22, 2024): 已成功了,谢谢大佬 @fatedier !
Author
Owner

@MrMu666 commented on GitHub (Aug 29, 2024):

目前是一端为 NAT1 ,一端为 NAT4

你好,我也是这种情况,无法打洞成功,请问您是怎么解决的啊

<!-- gh-comment-id:2316594499 --> @MrMu666 commented on GitHub (Aug 29, 2024): > 目前是一端为 NAT1 ,一端为 NAT4 你好,我也是这种情况,无法打洞成功,请问您是怎么解决的啊
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#3334
No description provided.