NetworkManager's Metered property (was: Re: DNF and PackageKit background data usage)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2016-10-31 at 12:31 -0400, Matthew Miller wrote:
> On Mon, Oct 31, 2016 at 09:23:06AM -0700, Adam Williamson wrote:
> > 
> > For that matter, I'm fairly sure I've seen background update
> > downloading happen when I was using an Android wifi tether
> > connection. I'm pretty sure I remember it blowing my data cap one
> > month when I was using my laptop on the bus.
> 
> As far as I can see, the default is "unknown". You can set
> "CONNECTION_METERED=yes" in the
> /etc/sysconfig/network-scripts/ifcfg-[whatever] file to change it on
> a
> per-device basis.
> 
> The man page for NetworkManager.conf doesn't document this as one of
> the properties which can have its default overridden (and says that
> anything not documented can't be overridden). I took that at its
> word;
> possibly worth testing anyway. :)


Hi,


In NetworkManager this works as follows:


(1) There is the per-connection property "connection.metered" [1]. It
can be "yes", "no", "unknown". "unknown" is the default and prompts NM
to do some basic heuristics.

 $ nmcli -f connection.metered connection show $NAME
 $ nmcli connection update $NAME connection.metered yes


(2) Then there is the Device's metered property in the D-Bus API [2].
If you activate a connection that has "connection.metered" explicitly
set to "yes" or "no", that's it.
Otherwise, NM will set the device property to "guess-yes" or "guess-
no". For example,
  - WWAN connections are "guess-yes"
  - if there is a DHCP option ANDROID_METERED, it is "guess-yes".
See [4].

  $ nmcli -f GENERAL.METERED device show $DEVICE


(3) Finally, there is the Manager's metered property [3]. This combines
the metered property of multiple devices into one. PackageKit would
only care about this

  $ busctl get-property org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager Metered



best,
Thomas


[1] https://developer.gnome.org/NetworkManager/stable/nm-settings.html#nm-settings.property.connection.metered
[2] https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.Device.html#gdbus-property-org-freedesktop-NetworkManager-Device.Metered
[3] https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.NetworkManager.html#gdbus-property-org-freedesktop-NetworkManager.Metered
[4] https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/devices/nm-device.c?id=58482a8feccc58db8d5a7eae9a004ce691e0c502#n10272

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux