You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

NetworkManager默认配置文件选择机制及“Wired connection 1”配置文件定位问题

NetworkManager默认配置文件选择机制及“Wired connection 1”配置文件定位问题

Hey there, let's unpack this NetworkManager mystery you're dealing with. First, let's recap what you've observed:

You ran this command to check system logs:

rg "Wired connection 1" /var/log/messages

And got these logs showing NetworkManager creating and activating a connection named Wired connection 1:

1932:May 5 13:47:58 localhost NetworkManager[540]: [1714884478.7331] settings: (enp0s3): created default wired connection 'Wired connection 1'
1949:May 5 13:47:59 localhost NetworkManager[540]: [1714884479.0191] policy: auto-activating connection 'Wired connection 1' (2d5f9259-0521-3381-8da8-2ee6c0c27f47)
1951:May 5 13:47:59 localhost NetworkManager[540]: [1714884479.0248] device (enp0s3): Activation: starting connection 'Wired connection 1' (2d5f9259-0521-3381-8da8-2ee6c0c27f47)
1965:May 5 13:47:59 localhost NetworkManager[540]: [1714884479.7903] policy: set 'Wired connection 1' (enp0s3) as default for IPv4 routing and DNS

But when you tried to find the corresponding config file with:

find /etc/NetworkManager/ -name "*.nmconnection" -exec grep -l "Wired connection 1" {} \;

You got nothing—even searching the entire root filesystem didn't turn up anything. Here's why:

The Core Issue: Temporary vs. Persistent Connections

That Wired connection 1 is an auto-generated temporary connection created by NetworkManager. Here's how it works:

  • When NetworkManager detects a wired device (like enp0s3) that doesn't have a pre-existing persistent config file in /etc/NetworkManager/system-connections/, it automatically creates a temporary, runtime-only connection to get the device online (usually using DHCP by default).
  • This temporary connection lives only in NetworkManager's memory (via D-Bus) and isn't saved to disk unless explicitly told to do so. That's why your filesystem searches come up empty.

How to Locate and Persist This Connection

If you want to make this connection persistent (and thus see it as a .nmconnection file), or just inspect its details, try these steps:

  1. List all active connections (including temporary ones)
    Run this command to see all connections NetworkManager is managing, including the temporary Wired connection 1:

    nmcli con show
    

    You'll see the UUID from your logs (2d5f9259-0521-3381-8da8-2ee6c0c27f47) listed alongside the connection name.

  2. View the connection's full configuration
    Even without a disk file, you can see every setting for this connection with:

    nmcli con show "Wired connection 1"
    
  3. Save the connection to disk (make it persistent)
    To turn this temporary connection into a persistent one that will survive reboots, run:

    nmcli con save "Wired connection 1"
    

    After this, you'll find a new .nmconnection file in /etc/NetworkManager/system-connections/ that matches the connection name, and your original grep command will finally find it.

Quick Recap of NetworkManager's Default Behavior

NetworkManager prioritizes persistent config files first. If none exist for a detected device, it falls back to creating these temporary default connections to ensure basic connectivity. These temp connections are named in the format Wired connection N (where N increments for each new unconfigured device) and don't get written to disk unless you explicitly save them.

Hope this clears up why you couldn't find the file initially! Let me know if you need help tweaking the connection settings further.

备注:内容来源于stack exchange,提问作者Konstantin Glukhov

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.17 07:59:32