NetworkManager Created Default Wired Connection: Wired-1
NetworkManager is a popular network management daemon used in many Linux distributions. It provides a consistent interface for network connectivity and device configuration. One of its features is the ability to create default wired connections for Ethernet devices.
Default Wired Connections
When NetworkManager detects a new Ethernet device, it can automatically create a default wired connection for it. This connection is named "Wired-<n>", where "<n>" is an integer that starts at 1 and increments for each new Ethernet device. The default wired connection is configured with DHCP by default, allowing the device to obtain an IP address and other network configuration information automatically.
Creating Default Wired Connections
NetworkManager creates default wired connections using the nm-settings library. The nm-settings library provides a way to create and modify network connections programmatically. When NetworkManager detects a new Ethernet device, it creates a new default wired connection using the following command:
nm-settings -c /etc/NetworkManager/conf.d/default-wired-settings.conf add ifname enp0s3 type ethernet autoconnect yes
In this command, enp0s3 is the name of the new Ethernet device. The add command tells nm-settings to create a new network connection. The ifname option specifies the name of the new network connection, and the type option specifies that it is an Ethernet connection. The autoconnect option is set to yes, which means that the connection will be activated automatically when the Ethernet device is detected.
Configuring Default Wired Connections
The configuration of default wired connections can be customized using the default-wired-settings.conf file. This file is located in the /etc/NetworkManager/conf.d/ directory. Here is an example of a default wired settings configuration file:
[ethernet]
mac-address-blacklist=*
In this example, the mac-address-blacklist option is used to blacklist all MAC addresses, preventing NetworkManager from creating default wired connections for any Ethernet devices. Other options that can be configured in this file include dhcp-client-id, dhcp-timeout, and dhcp-send-hostname.
Debugging Default Wired Connections
When debugging default wired connections, it can be useful to enable debug logging for NetworkManager. This can be done by adding the following line to the /etc/NetworkManager/NetworkManager.conf file:
[main]
log-level=DEBUG
With debug logging enabled, NetworkManager will log detailed information about its activities to the system log. This can be viewed using the journalctl command:
journalctl -f -u NetworkManager
NetworkManager provides a convenient way to manage network connectivity in Linux. Its ability to create default wired connections for Ethernet devices is a useful feature that can save time and effort when configuring network settings. By customizing the default wired settings configuration file and enabling debug logging, it is possible to fine-tune NetworkManager's behavior and troubleshoot any issues that may arise.
- NetworkManager can create default wired connections for Ethernet devices
- Default wired connections are named "Wired-<n>" and are configured with DHCP by default
- Default wired connections are created using the
nm-settingslibrary - The configuration of default wired connections can be customized using the
default-wired-settings.conffile - Debug logging can be enabled for NetworkManager to troubleshoot issues with default wired connections