Score:1

Bridge with netplan fails with a slow to come up interface

us flag

My home server connects to the internet with enp7s0, and shares internet through 3 devices, enp2s0 (ethernet to switch), enp3s0 (ethernet to router that provides guest network) and wlxe0e1a935d56d (fast usb wireless dongle for home network). I want the usb wireless and enp2s0 in the same bridge so that devices can see each other.

Here is my netplan yaml file:

network:
  ethernets:
    enp2s0:
      optional: true
    enp3s0:
      addresses: [192.168.1.1/24]
      optional: true
    enp7s0:
      dhcp4: true
    wlxe0e1a935d56d:
      dhcp4: no
  bridges:
    br0:
      interfaces:
        - enp2s0
        - wlxe0e1a935d56d
      addresses: [192.168.0.1/24]
  version: 2

The problem is that bootup hangs on "waiting for network to be configured" for two minutes, after which the machine boots up with only enp2s0 in br0. I can fix the network at that point by adding wlxe0... to the bridge with brctl addif. If I add the line optional: true to wlxe0... under ethernets, the boot hang goes away, but br0 still only gets enp2s0.

I think the problem might be that the usb stick takes quite some time to get ready, longer than the machine will wait. Is it possible to set up netplan so that it gets added to the bridge whenever it actually comes up?

I just realized that I have logs. (duh). In them, I found this illuminating line wlxe0e1a935d56d: Failed to set master interface: Device does not allow enslaving to a bridge. Operation not supported which explains why the interface is not joining the bridge during boot, but how come it can be added to bridge manually after boot?

zwets avatar
us flag
Maybe the error is logged while it isn't yet fully initialised?
Score:0
us flag

I'm not sure, but I think the issue is that hostapd does some magic to the interface which allows it to join bridges. I cannot move hostapd before networking, so I just added an one-shot systemd unit which adds the interface to the bridge, that's defined to be run after hostapd.

I am not really happy about this solution, but it works for now.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.