Sunday, August 24, 2014

windows 10 - Set/unset mobile connections as metered


In my notebook I have a Sierra Wireless 4G/LTE module and Windows 10 Pro Anniversary Update.
I would like to avoid Windows to download updates when I am connected through the mobile connection.
Even better it would be to disable downloads only in peak hours and allow them otherwise.


For Wi-Fi connections it is possible to set the option "Metered connection", clicking on the connection properties in "Network & Internet -> Wi-Fi". I don't see the equivalent setting for mobile connections under "Network & Internet -> Cellular".


I might set anyway a "Data limit" for mobile connections in "Network & Internet -> Data usage".
Will "Data limit", once set, block updates?


I have seen that I can set cost parameters for mobile connection mycon in netsh with:


netsh mbn set profileparameter name="myconn" cost=type

The type can be: Unrestricted, Fixed, Variable.
Will Fixed or Variable block updates?


What are other possibilities to block updates for specific connections or times ?


Answer



Background info


In a similar question on answers.microsoft.com the OP sees the "Metered connection" switch in the mobile connection options, but it is disabled. A Microsoft representative says:



That UI toggle in the cellular page is deprecated and no longer used. We are aware of the confusion surrounding the toggle and are investigating a resolution. Thank you for your feedback and sorry for the confusion!



Given the current interface, "resolution" has consisted in removing the switch. But IMHO the confusion increases, since now we are unable to change the connection cost status, plus the UI is totally clueless about it.


As regard the netsh command mentioned in my answer, strange as it may seem (in the same thread) a Microsoft wiki author discourages its usage, since:



there is, as yet, no published Command reference beyond the Windows 7 one so information is sparse. [The] command should not have been posted in this thread.



The suggested way for affecting the connection cost of the mobile connection consists in modifying values in the registry.


Solution(s)


First, identify the registry key:


HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\DefaultMediaCost


  1. If you just want to know which is the status of your connection:
    check the value names 3G and 4G of DefaultMediaCost: if they are set to 1 the related mobile connections will be unmetered; a value of 2 sets the related connections to "metered". Expect to find a 1 as a value.


  2. If you want to change the values named above:
    note that the key DefaultMediaCostis set by drivers and therefore the owner is the "TrustedInstaller" account. To be able to modify it, you need to right click on DefaultMediaCost, choose permissions and set yourself as the Owner through the dialog "Advanced" properties. Set the replace-subcontainers checkbox before applying the changes. Once you Owner, set also Full Control checkbox.


  3. If you need to switch values often:
    set them to metered, right click on DefaultMediaCost and export them as a reg file. Set them to unmetered and export again. Double click on the metered/unmetered reg file as needed.



Note that modifications are per connection type and not per single connection.
Unfortunately the changes in DefaultMediaCost require reboot, which makes inconvenient a scheduling of the peak/non-peak hour DefaultMediaCost`.


As regard data limits, based on the following Microsoft Guidelines, I infer that, under a variable or approaching data cap, the policy is to download only high priority Windows updates, but "allow users to explicitly [...] download lower priority updates".


EDIT


@HeySora notes that Windows 1903 made 2 the default choice for both 3G and 4G networks, thus making cellular connections metered at each reboot


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...