Hacker News new | ask | show | jobs
by WesolyKubeczek 925 days ago
systemd-networkd and NetworkManager have something to that effect.

There’s however a big difference between an interface coming online, an interface getting its addresses, a particular address being resolvable and reachable, and the particular address being routed to the place you actually want to reach. In an ideal world, you want all four; NM kinda sorta has it. There are d-bus APIs, just maybe not easy to use in shell scripts CLI tools.

2 comments

The routing table won't get flushed in between the slumber of the WiFi or 5G modem. You do not have to care about IPs or interfaces being up - we just need to synchronize network work so that most comms can be done in short bursts and then everything can go back to sleep. iOS does this, has done this for years.
Can't you hook into NM and provide the missing bits with scripts? Or do you need also to listen to "something else" to get the events like "the modem just went to sleep" which is not quite the same as deconfiguring it?

(I think no wonder those pieces are missing, it usually isn't happening on computer-shaped things, more on embedded- and phone-shaped things.)

This irked me recently. I think it’s very reasonable for networkd to delegate everything after the interface meets an “online criteria” to later services. However I was disappointed that you couldn’t then tell networkd an interface was “active” (vs. online) later down the line.

Would be interested to hear how you & others approach this. Perhaps I’m not thinking systemd-y enough hah.

Can you describe your use case in a bit more detail? (Also to make sure it’s not really a XY problem)

systemd-networkd sure keeps some state tracking. There are systems where it’s the only thing managing the network, so it doesn’t have anything to delegate to. You can see it by running networkctl before and after yanking the Ethernet cable.