/srv/irclogs.ubuntu.com/2022/03/18/#netplan.txt

ackhi, I have a strange issue with network configuration on ubuntu core20 (on a raspberrypi). not sure if something is wrong with my conf or it could be a netplan issue. With wifi configured and eth0 through a bridge, if I disconnect the ethernet, the wifi also stops working10:25
ackwhen I reconnect the cable, both start working again10:25
ackthis is my config: https://paste.ubuntu.com/p/2MJ3DSYyKr/10:27
slyonack, hi! That should not be happening. Your config looks OK so far. Do you have any more logging output, e.g. from networkd (journalctl -u systemd-networkd)?10:31
ackslyon, I don't see anything strange in there, if I disconnect the cable and then reconnect it I only see the messages about link and dhcp, no error10:37
ackslyon, fwiw if I don't create the bridge, everything works fine10:37
ackslyon, the only thing I can think of that might be relevant is that since the interfaces are on different vlans, they both end up adding a default gateway10:37
ack$ ip r10:38
ackdefault via 10.10.10.1 dev br0 proto dhcp src 10.10.10.10 metric 100 10:38
ackdefault via 10.10.20.1 dev wlan0 proto dhcp src 10.10.20.30 metric 600 10:38
ack 10:38
ackdoesn't seem that should be a problem, though?10:38
slyonI wonder if the br0 route goes away once you disconnect the eth0 link? If not, this could be a problem indeed.10:39
slyonso your wifi actually stays associated with the AP, but routing doesn't work anymore after you disconnected the link?10:40
ackslyon, https://paste.ubuntu.com/p/KcVFcw48Ky/10:40
ackslyon, that's a good point10:40
ackslyon, oh it seems the br0 doesn't even go away10:43
ackslyon, I wonder if the down is not detected because it happens on eth0 and br0 is not affected?10:43
ackalthough "Mar 18 10:10:09 ubuntu systemd-networkd[1025]: br0: Lost carrier" shows it does lose  it10:44
ackbut yeah, it seems br0 is not brought down when the link on eth0 goes away, so the route stays too10:45
ackI wonder if it's raspberrypi-specific10:46
slyonUsually systemd-networkd clears the routes on carrier loss...10:46
slyonI don't think this is rpi specific10:46
slyonyou could specify your routes manually for the different subnets/vlans, that should work10:47
ackslyon, so you think it's not netplan, it's systemd-networkd?10:50
ackthe weird thing is that it does work if I don't use a bridge10:51
slyonsd-networkd usually clears the routes if the link goes down/carrier is lost10:51
slyoni wonder why it doesn't do that for your br0?10:51
ackslyon, right, so if I just use eth0 + wlan0, the route and IP on the interface do get cleared on link down10:53
slyonack: does it work if you put the bridge down manually (while cable is still connected)? i.e. "ip link set dev br0 down"?11:02
slyonwill it clear the routes for br0 after that command and route via wifi?11:03
slyonI think the problem is: disconnecting the link on eth0 does not automatically bring down br0. And I'm not sure if this is a bug or a feature...11:05
slyonack: I guess you could place some routable.d and off.d hooks to bring br0 down/up automatically, via https://netplan.io/faq/#use-pre-up%2C-post-up%2C-etc.-hook-scripts (that is, if the previous test works)11:06
ackslyon, yes, if I manually set the link down/up the route goes away11:12
ackthe IP is still there for br0 but the route is removed11:13
ack(so things keep working)11:13
ackslyon, so maybe the bug is that it should set br0 down if the last interface in it is disconnected11:14
slyonyou could use the "networkctl down br0" command, that should clear the IP as well I guess (instead of "ip link ...")11:15
slyonack: yes. But as I said above, I'm not sure if this is a networkd bug or feature... (There might be cases where it is important that the bridge stays up), as a workaround you could place some "networkctl up|down br0" hooks11:16
ackslyon, thanks11:19
kronoHi all, what is the canonical way to configure an Infiniband IPoIB interface via netplan?14:05
slyonhi krono! netplan does not currently support IPoIB: https://bugs.launchpad.net/netplan/+bug/184847114:08
slyonI guess your best bet would be using systemd-networkd directly: https://systemd.network/systemd.network.html#%5BIPoIB%5D%20Section%20Options14:08
kronoHi slyon. that's interesting…14:08
kronoThanks for letting me know…14:09
kronoI have around 50 machines w/ IB that now need an IP… -.-14:09
kronoslyon: what would happen if I just put the ib's dev name into the ethernets: section in a config, will it just be ignored?14:10
krono(I can't test on production machines :( )14:10
krono(as per https://code.launchpad.net/~darren-birkett/cloud-init/+git/cloud-init/+merge/373759/comments/978965 it should somehow work…)14:11
slyonhmm yeah, I think the main problem is netplan being unable to match the long IB mac addresses. So if you match on other properties (like interface-name) netplan will happily generate sd-networkd configuration files and networkd will try to apply those.14:13
slyonBut I cannot give any guarantees about that, as that's basically an untested/unsupported feature in netplan14:14
slyonyou can write your YAML somewhere (say /tmp/my_netplan_config/etc/netplan/test.yaml) and use `netplan generate --root-dir /tmp/my_netplan_config` and check the outputs at /tmp/my_netplan_config/run/systemd/network14:17
slyonthis will not change the system config, but allows you to inspect what it WOULD do14:17
kronoslyon: Thanks, that is valuable info!14:17
slyonthen you can cross-compare those outputs to the sd-networkd documentation at https://systemd.netwok14:19
kronoslyon: Things worked for me sufficiently, thanks!14:52
slyonkrono: cool, I'm glad it worked out! :)14:52
krono:)14:52
kronobye then, everybody14:52
slyono/14:52

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