I have a laptop using Kubuntu 18.04.3 and most of the time I use my phone as a Wi-Fi hotspot. Therefore, I have a limited quantity of internet connection. Until recently, everything was fine, I had to check some time the amount of mobile data left, but it was enough for my use.
But for about three weeks, my laptop uses much more internet connection than usual. While in general I was using ~1-2GB per day, I saw this number increase to 10-11GB a day. Since the amount of mobile data is important to me, I tried to check where this "leak" is coming from.
I use iftop
regularly to see where this comes from. It seems that when I use a browser (whether Firefox or Brave), after a random amount of time, one domain / address (I'm not sure about the term) downloads about 4MB (megabytes, not megabits) per second. The domains/addresses responsible are 2606:4700::6812:15e2
and 104.16.218.84
. Using whois
, it appears that both are owned by Cloudflare (but I don't know if this information is relevant here).
The second one is an IP address, so I tried to block it with iptables
but I don't know what to do with the first one. Does somebody know a way to fix this?
Edit: my first question was about how to block this kind of address but I'm looking for a solution that is more easy to implement. Currently, what I'm doing is that I very regularly check iftop
to try to identify the addresses responsible for the "leaks" of internet data. But this is not ideal since it requires my attention quite regularly and because I have the impression that each time I block an address, another takes its place.
For now, I only see two solutions:
set in place a sort of alert to automatically block an address that downloads more than a certain amount of data (but I have no idea how to do it)
or try to find the first cause of the problem and fix it directly. As I said, this problem only appeared 3 weeks ago (whereas I use my phone as Wi-Fi hotspot for about two years). I checked
dpkg.log
anddpkg.log.1
in/var/log
to see if the appearance of this problem coincided with the installation of a program. The only program I installed in this period wasclamav
, which I have removed without solving my problem.
Any idea where this can come from? A program update?
iptables
just as well. – Jos Jul 06 '20 at 07:54iptables
didn't work with this adress so I usedip6tables
and theniptables-persistent
to keep this after reboot – bretauv Jul 06 '20 at 08:09wireshark
or similar and capture all DNS lookups coming from your computer. You can then filter out only the results that actually resolve to one of the suspect IPs (which can/will change with time) to maybe see what's actually getting hit. If it's only happening when your browser is open, consider using an adblocker as well. Cloudflare also has way more IPs than you can (or should) block -- it's better to trace down the actual problem instead of trying to solve it withiptables
in this case. – Kaz Wolfe Jul 10 '20 at 23:23wireshark
but I never used it before and I don't understand what your two first sentences mean. Also, I already have an adblocker (uBlock Origin). I understand why blocking IPs is just a temporary solution, but as I said, usingwireshark
is a mystery for me. – bretauv Jul 11 '20 at 08:12