/srv/irclogs.ubuntu.com/2021/03/23/#netplan.txt

Jaredhas anyone successfully configured a static ip on a raspberry pi running ubuntu 20.01 using the netplan "network-config" file? I can't get it working00:29
jallen2281has anyone successfully configured a static ip on a raspberry pi running ubuntu 20.01 using the netplan "network-config" file? I can't get it working00:35
jallen2281Even when there aren't any errors, the ip doesn't apply00:35
slyonkjetilho: Yes. It mostly uses .network/.netdev/.link units, though. I'm not sure if those are visible in systemctl, as those are not system services. "systemctl list-units | grep netplan" should show any WPA/OVS netplan service units. Information about the other services should be visible in "networkctl".08:04
slyonAlso, the names should be pretty predictable: "run/systemd/network/10-netplan-<NETDEF_ID>.{network,netdev,link}" (where NETDEF_ID is the ID from the YAML file, most commonly an interface name like "ens3")08:06
kjetilhoslyon: that's the thing - that grep returns zero lines. (don't know what WPA/OVS is, though)11:11
slyonkjetilho: yeah. It would only return some lines if you use wifi/wpa_supplicant (WPA) or OpenVSwitch (OVS) in netplan. The "normal" networking stuff does not use system services, but network services (run/systemd/system/ vs run/systemd/network/)11:13
slyonI'm not an systemd expert, so I'm not sure how you could depend on a 10-netplan-ens3.network service for example11:13
kjetilhoso - is this a netplan or networkd deficiency?11:13
slyonIMO it's neither's deficiency. We just don't know how to make systemd wait for a device to appear... But this looks promising: https://unix.stackexchange.com/questions/257888/systemd-wait-for-network-interface-to-be-up-before-running-service (e.g. wait for "sys-devices-virtual-net-bond0.device")11:17
slyondid you try something like this already?11:17
kjetilhointerface being up doesn't mean it is configured11:32
kjetilhoalthough it should be OK usually when configured statically - there will be a race condition11:33
kjetilhonetlink reports when IP addresses are loaded in the kernel, so if the .network unit was available, it should be usable.11:35
kjetilhoI think I need to read up on systemd-networkd to know what needs fixing11:39
ddstreetif you want to make a service After= networking up generally at boot, use After=network-online.target and Wants=network-online.target11:40
ddstreetthere is no way to depend per-interface on an interface being configured, and network-online.target only works at boot, it doesn't stop/restart services if an interface goes down later11:41
ddstreetgenerally you shouldn't stop/start services when individual interface(s) lose/gain carrier/configuration11:41
ddstreetyou can use netlink if you really need to from inside your application to listen for specific interface changes11:42
kjetilhothat's just an opinion - systemd supports lots of stuff which the application could just as easily do itself.  e.g, switch user, set rlimits, etc. etc.11:46
ddstreeti'm telling you how it currently works, feel free to implement per-interface-state unit files with upstream systemd ;-)11:47
kjetilhogreat :)11:47
=== Hybrid51275 is now known as Hybrid512

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!