← 返回命令列表

Linux command

NetworkManager.conf 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Basic configuration

[main]\nplugins=ifupdown,keyfile

Set DNS mode

[main]\ndns=dnsmasq

Disable MAC randomization

[device]\nwifi.scan-rand-mac-address=no

Set hostname mode

[main]\nhostname-mode=dhcp

说明

NetworkManager.conf is the main configuration file for NetworkManager. It controls DNS handling, plugins, device management, and various global settings. The file uses an ini-style key file format with sections of key-value pairs. Additional configuration can be placed in /etc/NetworkManager/conf.d/ as drop-in files.

参数

main
Main configuration section.
plugins
System settings plugin names (keyfile is always appended).
dns
DNS processing mode (default, dnsmasq, systemd-resolved, none).
dhcp
DHCP client to use (internal, dhcpcd).
hostname-mode
How the transient hostname is managed (default, dhcp, none).
no-auto-default
Devices for which no automatic default connection is created.
keyfile
Keyfile plugin-specific settings.
ifupdown
Settings for the ifupdown plugin (Debian/Ubuntu).
managed
Whether devices listed in /etc/network/interfaces are managed by NetworkManager (true/false).
connection
Default values for connection properties.
device
Per-device persistent configuration.
logging
Controls logging output.
level
Log verbosity level (OFF, ERR, WARN, INFO, DEBUG, TRACE).
domains
Filter log messages by topic (PLATFORM, WIFI, DHCP4, DNS, VPN, etc.).
connectivity
Optional internet connectivity checking.
uri
URL to check for connectivity.
interval
Check frequency in seconds (default: 300).
global-dns
System-wide DNS configuration that overrides per-connection settings.

FAQ

What is the NetworkManager.conf command used for?

NetworkManager.conf is the main configuration file for NetworkManager. It controls DNS handling, plugins, device management, and various global settings. The file uses an ini-style key file format with sections of key-value pairs. Additional configuration can be placed in /etc/NetworkManager/conf.d/ as drop-in files.

How do I run a basic NetworkManager.conf example?

Run `[main]\nplugins=ifupdown,keyfile` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does main do in NetworkManager.conf?

Main configuration section.