You are not logged in.

#1 2024-01-16 05:57:59

honiw55841
Member
Registered: 2024-01-16
Posts: 1

Is there a way to limit the daily internet data usage on a network?

I use a WiFi network to access the internet.

I would like to limit the amount of data that is downloaded to a certain limit say 1GB. After 1GB is used, the WiFi connection should be disconnected.

Is there any software that can be used to limit the daily data usage?

Thanks

Offline

#2 2024-01-16 09:35:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,042

Re: Is there a way to limit the daily internet data usage on a network?

No idea whether there's some ready-to-use software*, but you could monitor /sys/class/net/*/statistics/rx_bytes and take the NIC down if your daily quota is exceeded
(You'll have to store the value before typically a reboot but actually everytime the nic gets taken down and offset it with its 00:00 value)

To do this w/ iptables/nftables, see
https://unix.stackexchange.com/question … -interface
https://aur.archlinux.org/packages?K=xtables

*Sure you actually want to?
And if you need to download a 1.1GB large file you'll have to start at 23:58 to not exceed the quota of either day?
And tx_bytes is not a problem?

I guess you're trying to solve some other issue and this is actually an https://en.wikipedia.org/wiki/XY_problem ?

Online

#3 2024-01-16 10:05:40

d.ALT
Member
Registered: 2019-05-10
Posts: 959

Re: Is there a way to limit the daily internet data usage on a network?

seth wrote:

*Sure you actually want to?

I never got myself in the needs of (neither in Win10, nor Android), but I think OP is looking for Metered Connections as in Windows or Android


<49,17,III,I>    Fama di loro il mondo esser non lassa;
<50,17,III,I>    misericordia e giustizia li sdegna:
<51,17,III,I>    non ragioniam di lor, ma guarda e passa.

Offline

#4 2024-01-16 12:03:24

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,096

Re: Is there a way to limit the daily internet data usage on a network?

It seems NetworkManager has supported metered connections since 2015 .

https://blogs.gnome.org/lkundrak/2015/0 … -and-more/
https://unix.stackexchange.com/question … ed-network


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2024-01-16 13:55:04

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,232

Re: Is there a way to limit the daily internet data usage on a network?

But the metered setting would likely not get honored by the vast majority of tools and from what I'm seeing you can't actually enforce a particular limit just via the NetworkManager integration (... which probably would be nice to have and make the most sense...) but from what I've seen this is just something announced via dbus and tools need to actually listen and take appropriate warning steps when this is the case.

Online

Board footer

Powered by FluxBB