Monday, September 16, 2019

Linux Networking ELI25?

Is there anyone here willing to give me a high level explanation of the roles and interactions of the different pieces of Linux networking (bonus if you can compare and contrast with BSDs too, like OpenBSD)? I think I'm getting closer, but it's really really confusing. Here's where I'm at currently:

  • ifupdown, ifplugd, iw, wpa_suplicant, netplan, systemd, NetworkManager, netctl: what do they do and what's their relationship to each other? I gather that netplan replaces ifupdown in recent Ubuntu releases, and that their jobs are to bring interfaces up and down, and assign IPs or run DHCP as needed? iw controls wireless connections, and wpa_suplicant authenticates to enterprise mode networks (wired dot1x or wireless). I think systemd and NetworkManager are higher level controls that interact with and configure ifupdown, netplan, wpa_suplicant, etc.?
  • ifconfig (old) and iproute2 (new) basically are cli tools that can view status or make manual changes (bypassing above services) to the network (but their changes aren't persistent, reboot or reload ifupdown would clear these changes)?
  • The system reads /etc/nsswitch.conf to determine which sources and in which order to resolve names. files (/etc/hosts) and DNS are the normal ones; mDNS, LLMNR, and NetBIOS could be listed here too? The DNS config is read from /etc/resolv.conf. /etc/resolv.conf in turn sometimes points right back to localhost, where a caching resolver like systemd-resolved, dnsmasq, or stubby is running? That resolver, in adition to regular DNS, could also do mDNS, LLMNR, NetBIOS, or DoH? One thing that's puzzling to me, how do DNS settings get from DHCP to this resolver?
  • iptables is the traditional Linux firewall, but seems to be being replaced by nftables? In recent Debian releases the iptables command actually configures nftables under the hood? UFW is just a higher level simpler interface that can be used to configure iptables/nftables.
  • VRFs are called network namespaces, and ip netns can be used to configure them. You could run a command in a namespace with ip netns exec <namespace>. What if you want all system network traffic to use a particular namespace like 'management' by default? Say including things like DNS resolution and apt-get? What if you want a service to run in a particular namespace, or all namespaces? (How do services get assigned to namespaces?)

If anyone knows of a clear and concise summary of Linux networking geared for network admins (blog, book, whatever), I'd love to hear about it.



No comments:

Post a Comment