After an afternoon of trying to troubleshoot why one of my devices (a Beaglebone Black, distro is a Debian console) doesn't seem to resolve hostnames anymore, I realized I have absolutely no clue on how the networking works on linux. FWIW I am trying to do this on a system without windowmanager, through SSH (eth0) or USB (RNDIS).
Certainly, it can't be that difficult? I thought I knew how to set up everything:
- Configuration of the interfaces goes in /etc/network/interfaces
- You use ifup and ifdown to enable/disable the network interface
- Then there's the networking service that seems to disable/control all interfaces
Well, no. Despite having a fixed ip set in /etc/networking/interfaces, sometimes I would get a DHCP assigned address. Rather annoying. I found out that the system had connman installed. Removing connman resulted in no more dhcp assigned addresses, unless specifically configured in /etc/network/interfaces.
But now I found that hostnames are no longer resolved:
systemd-resolve status
status: resolve call failed: All attempts to contact name servers or networks failed
- Apart from the interfaces file, there's also /etc/systemd/network/eth0.network which seems to do the exact same thing
- There's a configuration file in /etc/systemd/resolved.conf
- Surfing to find answers to what could be wrong I seem to come up with a number of different methods for configuring and managing the network, multiple of them for systems that have a gui.
- I found mention of other managers with configuration in other files (but managed to loose my notes so can't remember what they were)
How does this all work together (or doesn't it). How do I specify which "network manager" I want to use. What is the simplest option (for a CLI system)? If multiple are installed, which one gets chose? It is somewhat annoying to find seemingly helpful answers on forums, then find out it's likely/possibly not applicable for your system, but not being sure.
There's just so much information out there, it's hard to distil a basic overview to start from. "Linux networking" as a search term returns lots of pages, but apparently a lot has changed the last few years, so I'm not certain which one to take as a reference. Any pointers on where to start?
systemctl list-units -t service
and disable everything that looks like a network manager. On Debian, I bet you either have NetworkManager and systemd-networkd. After that, you should be able to configure/etc/network/interfaces
as in the old times.