- aside from removing my tun interface
I have tested a VPN kill switch in multiple scenarios (achieving similar results) as follows:
Hardware
- bare metal Linux Mint 19 system
- Linux Mint 20 virtual machine on Proxmox 6
- Ubuntu 18.04 LXC container on Proxmox 6
VPN Clients (tested via GUI and command-line)
- PIA using “VPN Killswitch: Always”
- Mullvad using “Always require VPN”
Bittorrent Software
- qBittorrent-nox versions 4.3.1 and 4.3.2 configured to use network interface tun0
- Transmission 2.92
I connected to the VPN and started an Ubuntu 20.10 server torrent. Since the file is around 1 gb, for testing I decided to limit the download speed to 50 kb. Once I connected to enough peers, at around 10-20 seconds, I enabled the kill switch (disconnected but did not quit the VPN). Downloading continued for another 1 to 3 minutes before finally winding down. Peer download speeds fluctuated up and down multiple times, but eventually did average down as expected. Interestingly, though, the number of completed 256 kb pieces did increase by 1 or 2 before finally stopping. So parts did continue to download
Then I tested with a download speed limit of 1 kb. In most cases, the torrent finally stopped after approximately 8 to 10 minutes. That’s certainly not a trivial time difference from the previous test
When the kill switch was enabled, I could not issue a ping, traceroute, etc from the command-line, so it appears something was definitely working. The tun0 interface disappeared from ifconfig, and it no longer showed as an available interface in qBittorrent, as expected. The thing for the life of me that I cannot understand is how could a download possibly continue? Even though tun0 does not show up via ifconfig, is it still there? And does it have a buffer that takes some time to clear, especially when the lower download speed limit affords more connected peers a longer time to finally wind down? Maybe the torrent clients use buffers?
Update: Just ran another qBittorrent test (PIA/Mullvad) on a Windows 7 VM and the peers disappear/wind down within just a couple of seconds. Looks like this is a Linux issue