NetworkManager.conf - NetworkManager configuration file
/etc/NetworkManager/NetworkManager.conf, /etc/NetworkManager/conf.d/name.conf, /run/NetworkManager/conf.d/name.conf, /usr/lib/NetworkManager/conf.d/name.conf, /var/lib/NetworkManager/NetworkManager-intern.conf
NetworkManager.conf is the configuration file for NetworkManager. It is used to set up various aspects of NetworkManager's behavior. The location of the main file and configuration directories may be changed through use of the --config, --config-dir, --system-config-dir, and --intern-config argument for NetworkManager, respectively.
If a default NetworkManager.conf is provided by your distribution's packages, you should not modify it, since your changes may get overwritten by package updates. Instead, you can add additional .conf files to the /etc/NetworkManager/conf.d directory. These will be read in order, with later files overriding earlier ones. Packages might install further configuration snippets to /usr/lib/NetworkManager/conf.d. This directory is parsed first, even before NetworkManager.conf. Scripts can also put per-boot configuration into /run/NetworkManager/conf.d. This directory is parsed second, also before NetworkManager.conf. The loading of a file /run/NetworkManager/conf.d/name.conf can be prevented by adding a file /etc/NetworkManager/conf.d/name.conf. Likewise, a file /usr/lib/NetworkManager/conf.d/name.conf can be shadowed by putting a file of the same name to either /etc/NetworkManager/conf.d or /run/NetworkManager/conf.d.
NetworkManager can overwrite certain user configuration options via D-Bus or other internal operations. In this case it writes those changes to /var/lib/NetworkManager/NetworkManager-intern.conf. This file is not intended to be modified by the user, but it is read last and can shadow user configuration from NetworkManager.conf.
Certain settings from the configuration can be reloaded at runtime either by sending SIGHUP signal or via D-Bus' Reload call.
The configuration file format is so-called key file (sort of ini-style format). It consists of sections (groups) of key-value pairs. Lines beginning with a '#' and blank lines are considered comments. Sections are started by a header line containing the section enclosed in '[' and ']', and ended implicitly by the start of the next section or the end of the file. Each key-value pair must be contained in a section.
For keys that take a list of devices as their value, you can specify devices by their MAC addresses or interface names, or "*" to specify all devices. See the section called “Device List Format” below.
Minimal system settings configuration file looks like this:
As an extension to the normal keyfile format, you can also append a value to a previously-set list-valued key by doing:
The default value and the number of available plugins is distro-specific. See the section called “PLUGINS” below for the available plugins. Note that NetworkManager's native keyfile plugin is always appended to the end of this list (if it doesn't already appear earlier in the list).
If this key is missing, it defaults to internal. If the chosen plugin is not available, clients are looked for in this order: dhclient, dhcpcd, internal.
When the default wired connection is deleted or saved to a new persistent connection by a plugin, the device is added to a list in the file /var/lib/NetworkManager/no-auto-default.state to prevent creating the default connection for that device again.
See the section called “Device List Format” for the syntax how to specify a device.
no-auto-default=00:22:68:5c:5d:c4,00:1e:65:ff:aa:ee no-auto-default=eth0,eth1 no-auto-default=*
See the section called “Device List Format” for the syntax how to specify a device.
default: NetworkManager will update the hostname with the one provided via DHCP or reverse DNS lookup of the IP address on the connection with the default route or on any connection with the property hostname.only-from-default set to 'false'. Connections are considered in order of increasing value of the hostname.priority property. In case multiple connections have the same priority, connections activated earlier are considered first. If no hostname can be determined in such way, the hostname will be updated to the last one set outside NetworkManager or to 'localhost.localdomain'.
dhcp: this is similar to 'default', with the difference that after trying to get the DHCP hostname, reverse DNS lookup is not done. Note that selecting this option is equivalent to setting the property 'hostname.from-dns-lookup' to 'false' globally for all connections in NetworkManager.conf.
none: NetworkManager will not manage the transient hostname and will never set it.
If the key is unspecified, default is used, unless /etc/resolv.conf is a symlink to /run/systemd/resolve/stub-resolv.conf, /run/systemd/resolve/resolv.conf, /lib/systemd/resolv.conf or /usr/lib/systemd/resolv.conf. In that case, systemd-resolved is chosen automatically.
default: NetworkManager will update /etc/resolv.conf to reflect the nameservers provided by currently active connections. The rc-manager setting (below) controls how this is done.
dnsmasq: NetworkManager will run dnsmasq as a local caching nameserver, using "Conditional Forwarding" if you are connected to a VPN, and then update resolv.conf to point to the local nameserver. It is possible to pass custom options to the dnsmasq instance by adding them to files in the "/etc/NetworkManager/dnsmasq.d/" directory. Note that when multiple upstream servers are available, dnsmasq will initially contact them in parallel and then use the fastest to respond, probing again other servers after some time. This behavior can be modified passing the 'all-servers' or 'strict-order' options to dnsmasq (see the manual page for more details).
systemd-resolved: NetworkManager will push the DNS configuration to systemd-resolved
unbound: NetworkManager will talk to unbound and dnssec-triggerd, using "Conditional Forwarding" with DNSSEC support. /etc/resolv.conf will be managed by dnssec-trigger daemon.
none: NetworkManager will not modify resolv.conf. This implies rc-manager unmanaged
Note that the plugins dnsmasq, systemd-resolved and unbound are caching local nameservers. Hence, when NetworkManager writes /run/NetworkManager/resolv.conf and /etc/resolv.conf (according to rc-manager setting below), the name server there will be localhost only. NetworkManager also writes a file /run/NetworkManager/no-stub-resolv.conf that contains the original name servers pushed to the DNS plugin.
When using dnsmasq and systemd-resolved per-connection added dns servers will always be queried using the device the connection has been activated on.
If you configure dns=none or make /etc/resolv.conf immutable with chattr +i, NetworkManager will ignore this setting and always choose unmanaged (below).
auto: if systemd-resolved plugin is configured via the dns setting or if it gets detected as main DNS plugin, NetworkManager will update systemd-resolved without touching /etc/resolv.conf. Alternatively, if resolvconf or netconfig are enabled at compile time and the respective binary is found, NetworkManager will automatically use it. Note that if you install or uninstall these binaries, you need to reload the rc-manager setting with SIGHUP or systemctl reload NetworkManager. As last fallback it uses the symlink option (see next).
symlink: If /etc/resolv.conf is a regular file or does not exist, NetworkManager will write the file directly. If /etc/resolv.conf is instead a symlink, NetworkManager will leave it alone. Unless the symlink points to the internal file /run/NetworkManager/resolv.conf, in which case the symlink will be updated to emit an inotify notification. This allows the user to conveniently instruct NetworkManager not to manage /etc/resolv.conf by replacing it with a symlink.
file: NetworkManager will write /etc/resolv.conf as regular file. If it finds a symlink to an existing target, it will follow the symlink and update the target instead. In no case will an existing symlink be replaced by a file. Note that older versions of NetworkManager behaved differently and would replace dangling symlinks with a plain file.
resolvconf: NetworkManager will run resolvconf to update the DNS configuration.
netconfig: NetworkManager will run netconfig to update the DNS configuration.
unmanaged: don't touch /etc/resolv.conf.
none: deprecated alias for symlink.
Note that this setting is complementary to the dns setting. You can keep this enabled while using dns set to another DNS plugin alongside systemd-resolved, or dns set to systemd-resolved to configure the system resolver to use systemd-resolved.
If systemd-resolved is enabled, the connectivity check resolves the hostname per-device.
RLIMIT_CORE: set ulimit -c unlimited to write out core dumps. Beware, that a core dump can contain sensitive information such as passwords or configuration settings.
fatal-warnings: set g_log_set_always_fatal() to core dump on warning messages from glib. This is equivalent to the --g-fatal-warnings command line option.
This section contains keyfile-plugin-specific options, and is normally only used when you are not using any other distro-specific plugin.
See the section called “Device List Format” for the syntax on how to specify a device.
This section contains ifupdown-specific options and thus only has effect when using the ifupdown plugin.
The default value is false.
This section controls NetworkManager's logging. Any settings here are overridden by the --log-level and --log-domains command-line options.
In addition, these special domains can be used: NONE, ALL, DEFAULT, DHCP, IP.
You can specify per-domain log level overrides by adding a colon and a log level to any domain. E.g., "WIFI:DEBUG,WIFI_SCAN:OFF".
In general, the logfile should not contain passwords or private data. However, you are always advised to check the file before posting it online or attaching to a bug report. VPN_PLUGIN is special as it might reveal private information of the VPN plugins with verbose levels. Therefore this domain will be excluded when setting ALL or DEFAULT to more verbose levels then INFO.
Specify default values for connections.
Such default values are only consulted if the corresponding per-connection property explicitly allows for that. That means, all these properties correspond to a property of the connection profile (for example connection.mud-url). Only if the per-profile property is set to a special value that indicates to use the default, the default value from NetworkManager.conf is consulted. It depends on the property, which is the special value that indicates fallback to the default, but it usually is something like empty, unset values or special numeric values like 0 or -1. That means the effectively used value can first always be configured for each profile, and these default values only matter if the per-profile values explicitly indicates to use the default from NetworkManager.conf.
Not all properties can be overwritten, only the following properties are supported to have their default values configured (see nm-settings(5) for details).
You can configure multiple connection sections, by having different sections with a name that all start with "connection". Example:
[connection] ipv6.ip6-privacy=0 connection.autoconnect-slaves=1 vpn.timeout=120 [connection-wifi-wlan0] match-device=interface-name:wlan0 ipv4.route-metric=50 [connection-wifi-other] match-device=type:wifi ipv4.route-metric=55 ipv6.ip6-privacy=1
The sections within one file are considered in order of appearance, with the exception that the [connection] section is always considered last. In the example above, this order is [connection-wifi-wlan0], [connection-wlan-other], and [connection]. When checking for a default configuration value, the sections are searched until the requested value is found. In the example above, "ipv4.route-metric" for wlan0 interface is set to 50, and for all other Wi-Fi typed interfaces to 55. Also, Wi-Fi devices would have IPv6 private addresses enabled by default, but other devices would have it disabled. Note that also "wlan0" gets "ipv6.ip6-privacy=1", because although the section "[connection-wifi-wlan0]" matches the device, it does not contain that property and the search continues.
When having different sections in multiple files, sections from files that are read later have higher priority. So within one file the priority of the sections is top-to-bottom. Across multiple files later definitions take precedence.
The following properties further control how a connection section applies.
Contains per-device persistent configuration.
[device] match-device=interface-name:eth3 managed=1
The following properties can be configured per-device.
A device with carrier ignored will allow activating connections on that device even when it does not have carrier, provided that the connection uses only statically-configured IP addresses. Additionally, it will allow any active connection (whether static or dynamic) to remain active on the device when carrier is lost.
Note that the "carrier" property of NMDevices and device D-Bus interfaces will still reflect the actual device state; it's just that NetworkManager will not make use of that information.
Master types like bond, bridge and team ignore carrier by default, while other device types react on carrier changes by default.
This setting overwrites the deprecated main.ignore-carrier setting above.
The [device] section works the same as the [connection] section. That is, multiple sections that all start with the prefix "device" can be specified. The settings "match-device" and "stop-match" are available to match a device section on a device. The order of multiple sections is also top-down within the file and later files overwrite previous settings. See “Sections” under the section called “CONNECTION SECTION” for details.
This section controls NetworkManager's optional connectivity checking functionality. This allows NetworkManager to detect whether or not the system can actually access the internet or whether it is behind a captive portal.
Connectivity checking serves two purposes. For one, it exposes a connectivity state on D-Bus, which other applications may use. For example, Gnome's portal helper uses this as signal to show a captive portal login page. The other use is that default-route of devices without global connectivity get a penalty of +20000 to the route-metric. This has the purpose to give a better default-route to devices that have global connectivity. For example, when being connected to WWAN and to a Wi-Fi network which is behind a captive portal, WWAN still gets preferred until login.
Note that your distribution might set /proc/sys/net/ipv4/conf/*/rp_filter to strict filtering. That works badly with per-device connectivity checking, which uses SO_BINDDEVICE to send requests on all devices. A strict rp_filter setting will reject any response and the connectivity check on all but the best route will fail.
This section specifies global DNS settings that override connection-specific configuration.
Sections with a name starting with the "global-dns-domain-" prefix allow to define global DNS configuration for specific domains. The part of section name after "global-dns-domain-" specifies the domain name a section applies to. More specific domains have the precedence over less specific ones and the default domain is represented by the wildcard "*". A default domain section is mandatory.
This is a special section that contains options which apply to the configuration file that contains the option.
# always skip loading the config file [.config] enable=false
You can also match against the version of NetworkManager. For example the following are valid configurations:
# only load on version 1.0.6 [.config] enable=nm-version:1.0.6 # load on all versions 1.0.x, but not 1.2.x [.config] enable=nm-version:1.0 # only load on versions >= 1.1.6. This does not match # with version 1.2.0 or 1.4.4. Only the last digit is considered. [.config] enable=nm-version-min:1.1.6 # only load on versions >= 1.2. Contrary to the previous # example, this also matches with 1.2.0, 1.2.10, 1.4.4, etc. [.config] enable=nm-version-min:1.2 # Match against the maximum allowed version. The example matches # versions 1.2.0, 1.2.2, 1.2.4. Again, only the last version digit # is allowed to be smaller. So this would not match on 1.1.10. [.config] enable=nm-version-max:1.2.6
You can also match against the value of the environment variable NM_CONFIG_ENABLE_TAG, like:
# always skip loading the file when running NetworkManager with # environment variable "NM_CONFIG_ENABLE_TAG=TAG1" [.config] enable=env:TAG1
More then one match can be specified. The configuration will be enabled if one of the predicates matches ("or"). The special prefix "except:" can be used to negate the match. Note that if one except-predicate matches, the entire configuration will be disabled. In other words, a except predicate always wins over other predicates. If the setting only consists of "except:" matches and none of the negative conditions are satisfied, the configuration is still enabled.
# enable the configuration either when the environment variable # is present or the version is at least 1.2.0. [.config] enable=env:TAG2,nm-version-min:1.2 # enable the configuration for version >= 1.2.0, but disable # it when the environment variable is set to "TAG3" [.config] enable=except:env:TAG3,nm-version-min:1.2 # enable the configuration on >= 1.3, >= 1.2.6, and >= 1.0.16. # Useful if a certain feature is only present since those releases. [.config] enable=nm-version-min:1.3,nm-version-min:1.2.6,nm-version-min:1.0.16
Settings plugins for reading and writing connection profiles. The number of available plugins is distribution specific.
The stored connection file may contain passwords, secrets and private keys in plain text, so it will be made readable only to root, and the plugin will ignore files that are readable or writable by any user or group other than root. See "Secret flag types" in nm-settings(5) for how to avoid storing passwords in plain text.
This plugin is always active, and will automatically be used to store any connections that aren't supported by any other active plugin.
This plugin is read-only; any connections (of any type) added from within NetworkManager when you are using this plugin will be saved using the keyfile plugin instead.
Device List Format¶
The configuration options main.no-auto-default, main.ignore-carrier, keyfile.unmanaged-devices, connection*.match-device and device*.match-device select devices based on a list of matchings. Devices can be specified using the following format:
If there is a list consisting only of negative matches, the behavior is the same as if there is also match-all. That means, if none of all the negative matches is satisfied, the overall result is still a positive match. That means, "except:interface-name:eth0" is the same as "*,except:interface-name:eth0".
Backslash is supported to escape the separators ';' and ',', and to express special characters such as newline ('\n'), tabulator ('\t'), whitespace ('\s') and backslash ('\\'). The globbing of interface names cannot be escaped. Whitespace is not a separator but will be trimmed between two specs (unless escaped as '\s').
interface-name:em4 mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4;interface-name:eth2 interface-name:vboxnet*,except:interface-name:vboxnet2 *,except:mac:00:22:68:1c:59:b1