22

When I type:

nmcli con show wlan0

One of the settings is:

802-11-wireless.band:                   bg

Where is this setting stored on disk?

It isn't in: /etc/sysconfig/network-scripts/ifcfg-wlan0

I've grepped everything in lib, var, etc, and usr and I haven't been able to find it.

4 Answers 4

21

NetworkManager supports various plugins, which can define new storage locations for configuration information. The currently enabled plugins can be found in /etc/NetworkManager/NetworkManager.conf:

[main]
plugins=ifupdown,keyfile

The generic default plugin is keyfile, which stores configurations in /etc/NetworkManager/system-connections directory, in files similar to Windows .ini files.

Other plugins may be distribution-specific:

  • Fedora and RedHat use ifcfg-rh, which will both read and write /etc/sysconfig/network-scripts/ifcfg-* files.

  • Debian and Ubuntu use ifupdown, which is a read-only plugin: it reads /etc/network/interfaces but does not make any changes to it. Any configuration changes you make through NetworkManager will be saved using the keyfile plugin instead.

  • SuSE apparently used to have ifcfg-suse, but it seems to be deprecated.

  • Other distributions may have their own plugins.

Having said that, the 802-11-wireless.band setting probably gets its default value from the WiFi NIC capabilities reported by the driver. It would be saved only if you wanted to explicitly restrict the NIC to only some types of WiFi networking.

If your WiFi NIC can only transmit in the 2.4 GHz band, you cannot add a or ac capabilities by just reconfiguring the software or the driver: it would require a new radio module and a new antenna tuned for the 5.0 GHz band.

3
  • One of my connections (nmcli con show) is named "System eth0" I cannot find that string anywhere in any of the files in any of the relevant directories. I wonder if Network Manager is encrypting its settings.
    – user337009
    Commented Feb 19, 2019 at 22:42
  • /etc/NetworkManager/system-connections is empty on my system (Centos 7 Arm) and none of the plugins are explicitly enabled in the config file.
    – user337009
    Commented Feb 19, 2019 at 22:44
  • When NetworkManager is integrated into a particular distribution, the distribution maintainer may also include a patch or use compile-time options to set NetworkManager's default configuration to match how things are normally done in that distribution. Thus NetworkManager on RHEL/CentOS may default to RedHat-like behavior, and on Debian and related distributions to Debian-like behavior, respectively.
    – telcoM
    Commented Aug 2, 2021 at 0:46
13

Try this command:

sudo  nmcli -f NAME,DEVICE,FILENAME connection show

It will display the following:

NAME               DEVICE  FILENAME
bridge-br0         br0     /etc/sysconfig/network-scripts/ifcfg-bridge-br0
virbr0             virbr0  /run/NetworkManager/system-connections/virbr0.nmconnection
bridge-slave-eno1  eno1    /etc/sysconfig/network-scripts/ifcfg-bridge-slave-eno1
vnet1              vnet1   /run/NetworkManager/system-connections/vnet1.nmconnection
eno2               --      /etc/sysconfig/network-scripts/ifcfg-eno2

Apparently, the configuration of each of the network devices are not created or stored in the same place when NetworkManager creates the devices.

I found the information here, A guide to configuring and managing networking in Red Hat Enterprise Linux 8, on the RedHat access site.

1
  • Great info and something to add: On my system, /etc/NetworkManager/system-connections is empty and the output lists that all configs are instead in /run/NetworkManager/system-connections while the system is running. The actual persistent configurations are netplan YAML files in /etc/netplan. Commented May 19 at 15:55
6

Check the /etc/NetworkManager/system-connections/ directory. It should contain information for all saved network connections.

Edit: The result from the command grep '802-11-wireless' `which nmcli` (which matches) implies that the formatting of the output of nmcli is done by the nmcli utility itself and not directly read from a file. Some of the data displayed on the right columns is read from somewhere though (bg in your case). You should find one of the longer ones which doesn't seem to have been formatted by the nmcli utility and grep for that.

4
  • I would up vote this if I could.
    – user337009
    Commented Feb 18, 2019 at 0:19
  • @adpatter if it solves your problem you could click the check mark.
    – Jeff Schaller
    Commented Feb 18, 2019 at 2:45
  • 1
    It's a clever approach to understanding the problem, but it doesn't answer the question of where the setting is stored on the disk - or if it is.
    – user337009
    Commented Feb 18, 2019 at 3:51
  • I tried searching for the name of one of the connections, "System eth0", but it didn't turn up anything.
    – user337009
    Commented Feb 19, 2019 at 22:45
3

Type sudo NetworkManager --print-config for it's info on settings locations.. mostly /etc/NetworkManager/system-connections/ as answered above.

It appears the some of the default settings for each new 'profile' in that directory are determined on a 'no setting equals True' logic. See my question here about that, if that is what you're reading this question for: Is there any way to disable “Automatically connect to this network when available” permanently by default?

You must log in to answer this question.