In my Ansible network role, for Linux hosts, I am going through and checking for netplan, network manager, ifplugd and networkd (in that order) and configure based on first match. Only reason I like netplan more now is because dumping config to yaml in Ansible is very easy. If it was available on RHEL distros, I’d probably just install it as a package dependency for the role, but since I’m already accommodating multiple things, I figure I’d hit them all.
Luckily, Ansible does all the work of getting IP addresses and whatnot, so I only have to deal with this on configuration… Sucks there’s no cross-platform network module that can configure interfaces, but given the complexity, I understand why no one wants to touch it.
TBH, under CentOS, Fedora and to some extend Ubuntu, NetworkManager wasn’t that bad. It did its job pretty well. I had all kinds of settings, static, dhcp, just manual dns, it just worked for me. But I don’t remember on what I tried it that made me bang my head against the wall, I think it was on Debian. But on the other hand, Debian’s network interfaces conf file works wonderful, that is, if the interface names don’t change randomly after every dang reboot (I only had this issue on a single server, but it was really persistent, getting int names like “named6” and “named7” IIRC, alongside the classical enp* or similar, I had 6 interfaces).
Netplan, besides me not being used to its config parameters and always forgetting that tab doesn’t equal 4 spaces (I since started only using spaces and removing tabs from any document I create, unless vim or nvim does s**t to change spaces into tabs), has also been pretty well behaved.
To me, the worst network configuration and management tool is by far Wicked. Not sure what I have done and keep doing wrong, but it never seems to work, even when trying to use DHCP, for god’s sake!
I’m kind of embarrassed, I’ve opened 2 long, detailed tickets with Ansible core recently just to close them within an hour after I realized my mistake… I hope they were brief enough I didn’t waste anyone’s time.
So I am trimming network support in my Ansible collection down to just Network Manager and networkd. I found that netplan produces 10- networkd files, so you can supersede them with 00–09 prefixed config in Ubuntu. Additionally, Debian ships with networkd because what doesn’t?
I will still use Network Manager in RHEL or anything else where it’s present because I expect that a lot of RHEL things expect it to be there (FreeIPA, OpenShift, etc), but otherwise, I’m going to fall back to networkd.
Also, working through the networkd config, you really see why people complain about systemd. You can configure routes, firewall, dns, dhcp server and all sorts of other things in the interface config. No wonder it’s such a tangled mess.
Void doesn’t
Wait, I thought Debian still uses /etc/network/interfaces as of Debain 11 by default. Alpine also uses /etc/network/interfaces. It’s just Void that uses dhcpd / dhclient or for static, ip commands under /etc/rc.local file. It always gets me.
To be honest, I’m used to both network/interfaces and in RHEL family, /etc/sysconfig/network-scripts/ifcfg-e*, I find that easier than nmcli. I did use nmcli on Fedora on my work laptop, but when I was configuring static IPs on CentOS, I just did the network-scripts conf file. And you can either allow it to be controlled by NetworkManager or not under that conf. I may be wrong, but I think you have the option / parameter “save config” for network-scripts, which I never actually understood how it works, but makes the config actually work upon reboot.
It does, but afaik, networkd is available in vanilla installs of all systemd distros, so you can disable ifupdown and/or Network Manager and use it instead.
This is actually a RHEL plugin for Network Manager. The native Network Manager config is /etc/NetworkManager/system-connections/. I did have trouble using that on Fedora though. It seemed to insist I use network-scripts which would have made my Ansible role less portable, so I used nmcli instead which will utilize whichever backend plugin is available.
Yes but afaik, disabling the NetworkManager control in the network-scripts conf file disables that conf entirely.
I’m not sure, but you may be thinking of the interactive nmcli edit mode in which you configure and then save similar to how you would configure a router.
I’m not sure how it works in newer RHEL releases, but in CentOS 7 and I think 8 too (at least the initial 8.0), I recall disabling networkmanager control did nothing to impact the config running (because we’ve ran with it disabled for a long time, until I started allowing networkmanager control over the file, I think the parameter I’m talking about was nmcontrolled or something), as long as you had that save config option enabled.