Score:0

Overview of Ubuntu Networking

br flag

I use Ubuntu to run quite a few NX Witness Video Surveilance systems in varuious networking setups. Usually just a flat network with a single NIC server. But sometimes we run dual NIC's. I can get these working OK. I'm curently working on a dual NIC system that we also require 2 network addresses on one of the NIC's for. I have a good understanding of IPv4 networking and routing.

In the past my colleague and I have struggled with a good understanding of Ubuntu networking. I know we can set addresses via the GUI (which I try and stay away from as much as possible). I have read about Netplan and had very mixed results trying to get that working reliably in all cases. This week I have been reading about nmcli but have not used it yet. I have also read about using ifconfig to set paramamaters. At the moment I am adding my secondary IPv4 address to my NIC with '''ip addr add....''' which is working temporarily.

I don't really understand the priority of the different network tools. e.g. If I set something in the GUI and then set something different in Netplan which one wins.

Can anyone point me at a good article explaining how all the bits fit together? I don't mind if I have to spend a few hours wrapping my head round it.

Hugh

user535733 avatar
cn flag
If you "*set something in the GUI*" or using `nmcli` then you are using NetworkManager.
user535733 avatar
cn flag
"which one wins" (NetworkManager vs networkd) is defined in your Netplan YAML. Netplan is not networking stack -- Netplan is merely a place for your network settings that is compatible with both NetworkManager and networkd.
muru avatar
us flag
See https://ubuntu.com/blog/a-declarative-approach-to-linux-networking-with-netplan
Score:0
br flag

From my knowledge there are three different network configuration manager available in Ubuntu: ifupdown, networkd and NetworkManager.

  • ifupdown is not really used anymore, maybe on Ubuntu-Server or in cloud environments.
    • Config space: /etc/network
  • networkd is part of systemd and configured under "/etc/systemd/networkd.conf" (see man networkd.conf). This is usually not used on Ubuntu desktop, because there is no GUI (correct me if I am wrong) available.
    • Config Space: /etc/systemd/networkd.conf
    • Commandline Tool: networkctl
  • NetworkManager is usually the standard on Ubuntu-Desktop and configured via the settings-Gui.
    • Config space: /etc/NetworkManager
    • Commandline Tool: nmcli

These are the three. Now, you will ask about "netplan" ...
Depending if Desktop or Server, you have two different tools responsible for network, but you want to configure a "default" independent of these. Or second use-case would be to switch between them.

This part is done by "netpan". It configures some kind of "suggestion" or "second config" for the two. netplan does this by creating config files in "/run".

  • NetworkManager uses first "/etc/NetworkManager" and if nothing found there it uses the config in "/run/NetworkManager" which is written by netplan (see man NetworkManager.conf for details)
  • networkd does the same with "/etc/system/network.conf" and "/run/systemd/network".

Summary: If networkd or NetworkManager are not configured then netplan provides a configuration.
BUT as I said, the config in "/etc" of networkd or NetworkManager has higher priority as the one written by netplan to "/run".

The network tool ip from package "iproute2" is used for manually temporary network config changes. All changes made by ip commands are immediately active, but are not written to a configuration file. Latest on next reboot all changes are gone.

That's a rough overview.
I am sure you find detailed description about each of the network tools for detailed configuration.

Hugh Smith avatar
br flag
Thanks for the very useful answer @Marco. That helps a lot. I just want to confirm I have understood you correctly. '''IP...''' is just used for temporary stuff. e.g. temporarily adding a network address to a nic so I can web browse to a particular switch that has a managemnt address on that subnet. If I use nmcli or set stuff in the gui network setting that makes a permanent change, and these changes will have priority over anything I may have specified in a Netplan config file. Have I got that right?
Marco avatar
br flag
@HughSmith: updated with some more details.
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.