Hacker News new | ask | show | jobs
by arcfour 18 days ago
Why do you even need networkd for a router? Setting one up on Alpine (so not all this cruft) is easy as pie and the whole thing can cold boot in under 10 seconds... Would make the whole setup much more understandable + smaller attack surface...

> I usually prefer using systemd utilities wherever possible.

Ah. There's your problem. When something promises it can do anything and everything, rarely can it do much of it well, I find...

The type of issue you encountered is a pervasive failure mode you will encounter the more and more systemd utilities you rely on. For something like a router, systemd is wholly unnecessary. Try it! You'll agree.

4 comments

Networking is the biggest cause of issues I've had with systemd, mostly because of the systemd maintainer's insistence on strict adherence to modern RFC's to the detriment of legacy support. This has resulted in my having to deal with gross workarounds for various issues, including this 032 issue with multiple domains: https://docs.aws.amazon.com/linux/al2023/ug/deprecated-al2.h...
> maintainer's insistence on strict adherence to modern RFC

…except when they don't and then issues like this are the result. I guess they don't consider themselves viable for a CPE device and don't "feel" like following CPE requirements.

(In itself, good to know that systemd does consider some things out of scope, maybe?)

That multiple domain issue doesn't seem to stem from "modern RFCs", just a decision to not be bug compatible with the previous implementation.

> Windows and other Linux operating systems treat the value as a single domain, which results in unexpected behavior.

The parent poster's suggestion to use Alpine is amusing in the context of your problem because musl libc is notorious for sticking to the spec when compared to glibc.

Yeah this is why I have that Arch Linux uses systemd* by default. Will try Artix Linux[1]. "Artix Linux is a rolling-release distribution, based on Arch Linux. It uses real init systems, because PID1 must be simple, secure and stable."

[1] https://artixlinux.org/ [*] https://systemd-free.artixlinux.org/

networkd doesn't run as PID1?
> smaller attack surface

I literally run alpine in prod and home but I think the recent exploits in musl should give us pause if this is a fact or if it's a heuristic.

The number of packages and amount of code in an Alpine distribution is quantitatively a smaller attack surface; that doesn't mean there are never going to be any vulnerabilities. Also - it's not like they're coming out with new ones every day - what was it, 1 or 2?
Is systemd required? No. But it certainly makes sane system configuration easier and more reliable. Try it!
Yup. This is so impossibly complicated and insane:

    auto lo
    iface lo inet loopback
    
    # WAN - Cable
    auto eth0
    iface eth0
        pre-up ethtool --set-eee $IFACE eee off || true
        pre-up ethtool -A $IFACE rx off tx off || true
        # Apply CAKE traffic shaping
        post-up /usr/local/sbin/wan-cake start
        pre-down /usr/local/sbin/wan-cake stop
    
    # LAN Physical Ports enslaved to br0
    auto eth1
    iface eth1
        pre-up ethtool --set-eee $IFACE eee off || true
        pre-up ethtool -A $IFACE rx off tx off || true
    
    auto eth2
    iface eth2
        pre-up ethtool --set-eee $IFACE eee off || true
        pre-up ethtool -A $IFACE rx off tx off || true
    
    auto eth3
    iface eth3
        pre-up ethtool --set-eee $IFACE eee off || true
        pre-up ethtool -A $IFACE rx off tx off || true
    
    auto br0
    iface br0 inet static
        address 10.0.0.1/24
        bridge-ports eth1 eth2 eth3
        bridge-stp off
        bridge-fd 0
Holy moly. ONE SINGLE FILE called /etc/network/interfaces (+ a setup script for CAKE, to keep separation of concerns clean and modular) - not 30 disparate configs in whatever the networkd du jour is??!?

Well surely DHCP configuration must be a nightmare:

    duid
    persistent
    option rapid_commit
    option classless_static_routes
    option interface_mtu
    require dhcp_server_identifier
    slaac private
    noipv6rs
    noipv4ll
    
    # Do not block OpenRC boot waiting for the cable modem to lock
    background
    
    # Keep ISP DHCP and RA DNS out of the system resolver configuration.
    nohook resolv.conf
    
    # Only touch eth0 and br0 (for IPv6 PD assignment)
    allowinterfaces eth0 br0
    
    interface br0
        noipv4
        noipv6rs
    
    interface eth0
        ipv6rs
        ia_na 1
        ia_pd 2/::/56 br0/0/64
Nobody could EVER understand that.