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

qbittorent can use the stun server to query the port of the public network ip to help some users who do not have a public network ip to obtain better connectivity. #19487

Open
OXERIS opened this issue Aug 19, 2023 · 1 comment
Labels
Feature request Network Issues related to network connectivity

Comments

@OXERIS
Copy link

OXERIS commented Aug 19, 2023

Suggestion

At present in China, many users cannot obtain public network IPv4 addresses from operators . this means they have poor connectivity under IPv4 and cannot get many uploads. In this situation, TCP hole punching is a good solution.

In the Full Cone NAT environment, all requests sent with the same internal IP address and port are mapped to a specific external IP address and port. Moreover, any external host can communicate with the internal host by sending packets to the mapped external IP address and port. Therefore, if a set of mapping relationships can be continuously maintained, the effect of listening on a certain external IP address and port can be realized.

We can use the local port A to initiate a TCP long connection to maintain the NAT port mapping relationship, and use the STUN server address to obtain the corresponding public network IP and corresponding public network port B. Finally, use the port reuse feature to monitor port A at the same time to provide external services. We only need to fill in the port number of the public network port B in the listening port of qbittorrent,and configure port forwarding on the router, forward port A to the intranet port filled with the port number of B,so that some users can achieve the effect similar to having a public network ip.

Someone used a script, combined with the port forwarding function of the router, to achieve this function。

I think qbittorent should be able to integrate such a function to help more users get better connectivity.

Use case

qBittorrent NAT TCP Hole Punching
https://github.com/Mythologyli/qBittorrent-NAT-TCP-Hole-Punching/tree/master

Another use case, but it's just in Chinese
https://www.cometbbs.com/t/%E5%9F%BA%E4%BA%8Estun%E7%A9%BF%E9%80%8F%E5%B7%A5%E5%85%B7lucky%EF%BC%8C%E4%BD%BFbt%E5%AE%A2%E6%88%B7%E7%AB%AF%E7%BB%BF%E7%81%AF%E3%80%81%E5%BC%80%E6%94%BEtcp%E7%AB%AF%E5%8F%A3%E7%9A%84%E5%8A%9E%E6%B3%95%EF%BC%88%E8%BF%9B%E5%8C%96%E7%89%88%EF%BC%89/82042/48

Extra info/examples/attachments

No response

@OXERIS OXERIS changed the title 可以利用stun服务器,查询公网ip的端口,以帮助部分没有公网ip的用户获得更好的连接性。 qbittorent can use the stun server to query the port of the public network ip to help some users who do not have a public network ip to obtain better connectivity. Aug 19, 2023
@thalieht thalieht added the Network Issues related to network connectivity label Aug 19, 2023
@Mythologyli
Copy link

After TCP hole punching, qBittorrent can report the public IPv4 address and port detected by STUN to the tracker, instead of the listening port in settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Network Issues related to network connectivity
Projects
None yet
Development

No branches or pull requests

3 participants