nmcli connection edit -- how do you know what commands to use?
-
Hi, all,
I'm trying to figure out if I want to use nmcli or nmtui (which seems a lot easier to me) for configurating network interfaces.
Was watching CompTIA Linux+ (XK0-004) - Configure Networking episode, at around 25:28 minutes in, and Don was explaining the usage of "nmcli connection edit" and how it drops you into a prompt. Don issues a command like "nmcli set connection.autoconnect yes". My question is, how does he know to use "connection.autoconnect" as an argument for "set"? I don't see it referenced in the help while inside of nmcli prompt.
Does one just have to know what properties to use while inside of nmcli prompt or is there a way to find out?
Also, a separate question, what is the difference between a network device and network connection as far as nmcli/NetworkManager is concerned?
Thanks!
-
In real-life land
nmcli
andnmtui
change the exact same settings so you can use either one to achieve the same results. For me, I usenmtui
when I am making a one-time change, and I usenmcli
when I am scripting a change. As for the command line options, sadly I do have many of them memorized. They key ones are well documented, though. You can find full documentation on the Gnome Developer site and practical examples on the Red Hat Customer Portal.As for devices and connections, a device represents a hardware network adapter (although sometimes it can be virtual like a loopback or null). This is generally tied to layers 1 and 2 of the OSI model. A connection represents the software configuration applied to a device. This is generally tied to layers 2 and 3 in the OSI model. For most end users devices and connections are one and the same. The differentiation really only matters on systems where there are multiple adapters. For example, I might have a server with two 10Gbit ethernet adapters that I want bonded together. In that scenario I would have two devices attached to one connection. Another scenario would be if I had a laptop and moved between multiple docking stations. I might define one connection that was tied to the physical device for each of the docking station adapters. That way I could maintain the same IP address on each dock.
-
Great explanation. Thank you, Don!