Este conteúdo não está disponível no idioma selecionado.
Chapter 29. Introduction to NetworkManager Debugging
Increasing the log levels for all or certain domains helps to log more details of the operations that NetworkManager performs. You can use this information to troubleshoot problems.
NetworkManager provides different levels and domains to produce logging information. The /etc/NetworkManager/NetworkManager.conf
file is the main configuration file for NetworkManager. The logs are stored in the journal.
29.1. Introduction to NetworkManager reapply() method Copiar o linkLink copiado para a área de transferência!
NetworkManager uses profiles to manage device connection settings, which can be created, modified, or deleted through the D-Bus API. When a profile is changed, D-Bus clones the settings. To apply these changes, you must reactivate the connection’s settings or use the reapply()
method.
The reapply()
method has the following features:
- Updating modified connection settings without deactivation or restart of a network interface.
-
Removing pending changes from the modified connection settings. As
NetworkManager
does not revert the manual changes, you can reconfigure the device and revert external or manual parameters. - Creating different modified connection settings than that of the existing connection settings.
Also, reapply()
method supports the following attributes:
-
bridge.ageing-time
-
bridge.forward-delay
-
bridge.group-address
-
bridge.group-forward-mask
-
bridge.hello-time
-
bridge.max-age
-
bridge.multicast-hash-max
-
bridge.multicast-last-member-count
-
bridge.multicast-last-member-interval
-
bridge.multicast-membership-interval
-
bridge.multicast-querier
-
bridge.multicast-querier-interval
-
bridge.multicast-query-interval
-
bridge.multicast-query-response-interval
-
bridge.multicast-query-use-ifaddr
-
bridge.multicast-router
-
bridge.multicast-snooping
-
bridge.multicast-startup-query-count
-
bridge.multicast-startup-query-interval
-
bridge.priority
-
bridge.stp
-
bridge.VLAN-filtering
-
bridge.VLAN-protocol
-
bridge.VLANs
-
802-3-ethernet.accept-all-mac-addresses
-
802-3-ethernet.cloned-mac-address
-
IPv4.addresses
-
IPv4.dhcp-client-id
-
IPv4.dhcp-iaid
-
IPv4.dhcp-timeout
-
IPv4.DNS
-
IPv4.DNS-priority
-
IPv4.DNS-search
-
IPv4.gateway
-
IPv4.ignore-auto-DNS
-
IPv4.ignore-auto-routes
-
IPv4.may-fail
-
IPv4.method
-
IPv4.never-default
-
IPv4.route-table
-
IPv4.routes
-
IPv4.routing-rules
-
IPv6.addr-gen-mode
-
IPv6.addresses
-
IPv6.dhcp-duid
-
IPv6.dhcp-iaid
-
IPv6.dhcp-timeout
-
IPv6.DNS
-
IPv6.DNS-priority
-
IPv6.DNS-search
-
IPv6.gateway
-
IPv6.ignore-auto-DNS
-
IPv6.may-fail
-
IPv6.method
-
IPv6.never-default
-
IPv6.ra-timeout
-
IPv6.route-metric
-
IPv6.route-table
-
IPv6.routes
-
IPv6.routing-rules
29.2. Setting the NetworkManager log level Copiar o linkLink copiado para a área de transferência!
By default, all the log domains are set to record the INFO
log level. Disable rate-limiting before collecting debug logs. With rate-limiting, systemd-journald
drops messages if there are too many of them in a short time. This can occur when the log level is TRACE
.
This procedure disables rate-limiting and enables recording debug logs for the all (ALL) domains.
Procedure
To disable rate-limiting, edit the
/etc/systemd/journald.conf
file, uncomment theRateLimitBurst
parameter in the[Journal]
section, and set its value as0
:RateLimitBurst=0
RateLimitBurst=0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the
systemd-journald
service.systemctl restart systemd-journald
# systemctl restart systemd-journald
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
/etc/NetworkManager/conf.d/95-nm-debug.conf
file with the following content:[logging] domains=ALL:TRACE
[logging] domains=ALL:TRACE
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The
domains
parameter can contain multiple comma-separateddomain:level
pairs.Restart the NetworkManager service.
systemctl restart NetworkManager
# systemctl restart NetworkManager
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Query the
systemd
journal to display the journal entries of theNetworkManager
unit:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
29.3. Temporarily setting log levels at run time using nmcli Copiar o linkLink copiado para a área de transferência!
You can change the log level at run time using nmcli
.
Procedure
Optional: Display the current logging settings:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To modify the logging level and domains, use the following options:
To set the log level for all domains to the same
LEVEL
, enter:nmcli general logging level LEVEL domains ALL
# nmcli general logging level LEVEL domains ALL
Copy to Clipboard Copied! Toggle word wrap Toggle overflow To change the level for specific domains, enter:
nmcli general logging level LEVEL domains DOMAINS
# nmcli general logging level LEVEL domains DOMAINS
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note that updating the logging level using this command disables logging for all the other domains.
To change the level of specific domains and preserve the level of all other domains, enter:
nmcli general logging level KEEP domains DOMAIN:LEVEL,DOMAIN:LEVEL
# nmcli general logging level KEEP domains DOMAIN:LEVEL,DOMAIN:LEVEL
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
29.4. Viewing NetworkManager logs Copiar o linkLink copiado para a área de transferência!
You can view the NetworkManager logs for troubleshooting.
Procedure
To view the logs, enter:
journalctl -u NetworkManager -b
# journalctl -u NetworkManager -b
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
29.5. Debugging levels and domains Copiar o linkLink copiado para a área de transferência!
You can use the levels
and domains
parameters to manage the debugging for NetworkManager. The level defines the verbosity level, whereas the domains define the category of the messages to record the logs with given severity (level
).
Log levels | Description |
---|---|
| Does not log any messages about NetworkManager |
| Logs only critical errors |
| Logs warnings that can reflect the operation |
| Logs various informational messages that are useful for tracking state and operations |
| Enables verbose logging for debugging purposes |
|
Enables more verbose logging than the |
Note that subsequent levels log all messages from earlier levels. For example, setting the log level to INFO
also logs messages contained in the ERR
and WARN
log level.