mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2026-03-02 22:57:32 -05:00
bind ip address to network interface seems to require restart if ip address has been changed #5314
Labels
No labels
Accessibility
AppImage
Bounty
Build system
CI
Can't reproduce
Code cleanup
Confirmed bug
Confirmed bug
Core
Crash
Data loss
Discussion
Docker
Documentation
Duplicate
Feature
Feature request
Feature request
Feature request
Filters
Flatpak
GUI
Has workaround
I2P
Invalid
Libtorrent
Look and feel
Meta
NSIS
Network
Not an issue
OS: *BSD
OS: Linux
OS: Windows
OS: macOS
PPA
Performance
Project management
Proxy/VPN
Qt bugs
Qt6 compat
RSS
Search engine
Security
Temp folder
Themes
Translations
Triggers
Waiting diagnosis
Waiting info
Waiting upstream
Waiting web implementation
Watched folders
WebAPI
WebUI
autoCloseOldIssue
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/qBittorrent#5314
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sopor on GitHub (Mar 9, 2017).
In the advanced settings i can bind qBT to my network interface instead of my IP address and that sounds like a very good idea but even if the optional IP address is set to 'All addresses' it still require a restart of qBT if my IP address has been changed. I'm aware that both settings require restart but for me that is if i change the settings and not if the IP address get changed. If this require a restart then i can't find any use of this feature. So i wondering if something is wrong or this need to be fixed?
qBT 3.3.10
Windows 7
@WhosAsking commented on GitHub (Mar 11, 2017):
IINM, this is a fundamental issue of an Internet-using server like qBittorrent (peer-to-peer programs are both client and server). One of the first things the program has to do is declare to the TCP/IP stack that it is listening: a process known as binding. That involves telling it which interfaces/addresses and ports it is using. In order to change something this fundamental, it has to release the bind and then re-bind, but that means peers and so on have to find you again. All in all, it can get pretty complicated, thus why it's left for something to be done the next time it starts up.
@brainchild0 commented on GitHub (Jan 12, 2018):
@WhosAsking I am afraid I don't understand your objection to releasing the previous bindings, then rebinding under a new IP address, in the case that the previously used interface or local address becomes unavailable. Is it strictly a question of design complexity, or do you believe that such a change would result in unwanted behavior?
I suggest that preserving the previous peer connections should not be a driving consideration, because as the original report correctly indicates, once a particular local address is lost and replaced with a new one, not only is it impossible to maintain the previous connections, but the overall feature has limited usefulness unless the application attempts to make new connections using the new address.
Broadly, then, the application should maintain connections over one interface and address at a time, and certain events should cause it to break connections over and unbind from a previous address, and begin again with a new one. Do you agree with this suggestion, and if not, would you please offer your reasoning?
@hdcTenBasePid commented on GitHub (Jan 17, 2018):
Two bits worth, I tend to agree with @brainchild0 .
@hdcTenBasePid commented on GitHub (Feb 28, 2018):
qBitTorrentx64/v4.0.4, Windows 10x64 Home, 1709 16299.192
OK, as far as I can tell it's fixed with v4.04, not a 100% with v4.0.3.
In my testing I can now start qBitTorrent with:
No internet connection, then connect and qBt will only use the interface selected. If 'Any Interface' or a 'Named Interface' is the connection then qBt connects, no restart.
After (1) connect to a VPN. qBt will now connect to the 'Named Interface'^ for that VPN, change the interface if necessary (Options->Advanced, Network Interface), without needing a restart.
After (2) disconnect from the VPN^^ application and use another VPN^^^ application and service. Change the 'Named Interface' to the new VPN and qBt connects without a restart.
Terminate VPN and Network connection and redo either (1) or (2) and qBt connects with no restart required.
With no 'Named Interface' connection available there is no libtorrent interface leakage.
I believe that's the functionality we all wanted on the torrent side. Great work team!
#7235, #7540, #7892, #8258
Not sure if this is a worry but:
^ You would not use 'Any Interface' whilst using a VPN, unless it's application had an in-built Firewall.
^^ OpenVPN TAP based.
^^^ Proprietary App TAP based with Firewall.
@senposage commented on GitHub (Mar 2, 2018):
fullstop: folks jumping the gun here a bit
I can still reproduce the issue here on 4.0.4
remember you need to have both the interface AND the ip set in the options for the binding to work correctly
if you just set the ip it will use your public IP until the vpn is up. which defeats the point of binding
( I don't know why it does this qbt should not be changing any user defined settings if the ip is not valid it should use it anyway and then wait for the interface to become valid)
now if your only connection is though the vpn this isn't a problem if its not and e.g you want to start the vpn on demand for torrent tasks it still doesn't detect the interface state change correctly
@senposage commented on GitHub (Mar 2, 2018):
if you set the interface to the TAP adapter it does indeed come up when the vpn comes online. however it still displays RED incoming connection state and still complains about in the log also takes a good 30 seconds to come up
3/2/2018 12:26 AM - qBittorrent failed listening on interface vpn.ip.here.0 port: TCP/4242. Reason: The requested address is not valid in its context.
@senposage commented on GitHub (Mar 2, 2018):
I uploaded a video of the issue in-action make sure to pay attention to what I am saying in the video particularly the bit about bind to IP's scope not being limited to the selected interface which I think part of the issue there and qbit continuing to use the public ip interface even after the vpn is established
https://youtu.be/X_pq_oBi8a4
@Dodgexander commented on GitHub (Mar 13, 2018):
Just wanted to add that I still have this problem also in 4.04.
I am binding to my virtual network adaptor for my VPN, but as soon as I change IP in my VPN software qBitorrent requires a restart for it connect to trackers.
A good way to see if its working or not is to test a known working torrent with lots of trackers.
Once you change the ip of the binded VPN interface all those trackers will gradually appear as not working and in the message field you get the message: "the requested address is not valid in its context".
@Sopor commented on GitHub (Oct 17, 2018):
I'm running 4.1.2 and i still have the same issue. Nothing has been changed. If i get a new IP address i need to restart qBT.
@UIEa4z7odDF9Xpl3 commented on GitHub (Feb 1, 2019):
Just repeating Sopor for v4.1.5, same issue. My VPN provider has decided to start changing my IP several times a day, connection stays live, qBT is bound to its interface, All IP Addresses, but all torrents cease until I restart the qBT.
@jafo5236 commented on GitHub (Feb 12, 2019):
Check out this app I found. https://github.com/dynamichael/qConnectionSitter It watches the network interface for disconnect/reconnect and restarts qBittorrent when the connection is re-established.
Having this built into qBittorrent would be the best solution, but this has resolved the issue of having to manually restart qBittorrent every time my VPN disconnects/reconnects.
@senposage commented on GitHub (Apr 9, 2019):
bumping this, this is getting tiresome maby target for 5.0 ?
@Marenz commented on GitHub (May 14, 2019):
I can confirm this issue and would love a fix
@bazg177 commented on GitHub (Feb 15, 2020):
I wrote a script to re-bind qBittorrent to a specified interface, it updates the config and restarts qBittorent if your IP has changed. See here: https://github.com/bazg177/qBittorrent-binder/blob/master/qBittorrent-binder.bat
@ghost commented on GitHub (May 4, 2022):
I think this was fixed in 4.2.x since it supports Interface/IP address changes without requiring a restart.
@bazg177 commented on GitHub (May 4, 2022):
Great, will check this out