Score:0

difference between nmcli connection reload and nmcli device reapply?

cw flag

I am currently using Ubuntu 20.04 machine and having Network Manager as the service for managing network configuration.

What is exactly the difference between the commands nmcli connection reload and nmcli device reapply, and do the commands make permanent changes to the network configuration or not?

user535733 avatar
cn flag
A change to "network configuration" might be a `device` change OR might be a `connection` change OR might be both. It's unclear if you are wondering the difference between "device" and "connection" (see the NetworkManager documentation), or if you have some kind of configuration question, or if you have a specific issue.
Score:1
vn flag

Disclaimer: I don't use Network Manager myself, so this is purely based on the reference manual and general knowledge.

Let's see what the reference manual says about these commands:

nmcli connection reload

Reload all connection files from disk. NetworkManager does not monitor changes to connection. So you need to use this command in order to tell NetworkManager to re-read the connection profiles from disk when a change was made to them.

nmcli device reapply {device}

Attempt to update device with changes to the currently active connection made since it was last applied.

From this, it seems the commands inherently do different things. The nmcli connection reload command reloads connection profiles from disk, while the nmcli device reapply {device} applies any new profile to the active connection.

It's not clear to me from the reference manual if nmcli connection reload actually applies any profile to devices, neither is it clear if nmcli device reapply {device} reloads changes to profiles on disk, but for both I would assume this is not the case (if anyone can prove me wrong, please do).

So the logical order for these commands would be first nmcli connection reload (which makes a permanent change to the loaded configuration) and then nmcli device reapply {device} (which makes a permanent change to the active connection).

It would be obvious to create an alias that does both in one command, like:

alias nm-reload='nmcli connection reload && nmcli device reapply {device}'

Again, I would also assume you can give more devices to the last command, so you can reload connections and apply them to all your devices with a single command.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.