5

I use Ubuntu 12.04.1.

I understand networking, and the meaning of files in both folders, but the question is:

"How are they coexisting?"

For example, if I have this configuration of eth0 in /etc/network/interfaces:

auto eth0
iface eth0 inet static
address 192.168.0.2
gateway 192.168.0.1
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255

and this one in /etc/NetworkManager/system-connections:

[802-3-ethernet]
duplex=full
mac-address=00:1E:33:71:CD:A4

[connection]
id=eth0
uuid=4c12ff66-028a-4338-bad5-fa6e9c5e6939
type=802-3-ethernet

[ipv6]
method=auto

[ipv4]
method=manual
dns=192.168.0.1;
addresses1=192.168.0.1;24;192.168.0.1;

What will be the resulting address of the interface, 192.168.0.1 or 192.168.0.2, and why so ?

2
  • 2
    The /etc folder contains every configuration in your distro, the first file says how you'll use the interface, the second file says how the NetworkManager, which is the Visual Manager, should interpret the first file, is this what are you asking for?
    – poz2k4444
    Oct 1, 2012 at 22:51
  • NetworkManager is a daemon with an optional applet and commandline tools. The daemon also has a DBus API if you want to build your own tools.
    – Emyr
    Oct 9, 2013 at 8:38

1 Answer 1

5

/etc/network is what your Operating System uses to assign network addresses. NetworkManager is what Ubuntu (and other distros like RedHat) use to force /etc/network to do its bidding. It will automatically configure the network services. Many implementations now do not allow NetworkManager to override /etc/network settings. NetworkManager used to really bugger things up in a server environment.

So in short, /etc/network is for manual configuration of the network. /etc/NetworkManager is for automatic configuration of the network addresses. It's useful for laptops or other PCs that change networks a lot. Tends to be a headache in a server environment, so many disable NetworkManager and just run with /etc/network

2
  • Is this statement still correct in the era of DevOps where everything suppose to be done in automated way? Jun 27, 2022 at 18:11
  • I think so, but tbh I don't remember. Truth be told, don't be using Ubuntu images as a DevOps engineer. Use containers so you don't have to worry about garbage like NetworkManager. Aug 2, 2022 at 2:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .