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-set...
[
2] https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedeskto...
[3]
https://developer.gnome.org/NetworkManager/stable/gdbus-org.freedesktop.N...
[
4] https://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/src/de...