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?