0

I have my Pi Zero W set up as a wireless bridge, bridging from wired eth0 to wireless wlan0; of course, wlan0 operates in AP mode. So far so good. Now I'm noticing that when I forgot to plug in the USB Ethernet adapter for eth0 into my Pi Zero W before boot, it won't be added as a bridge port to my bridge br0 automatically. How can I ensure that eth0 always gets added to the bridge, even if I plug eth0 into the Pi only later?

My /etc/network/interfaces has to say this:

auto eth0
allow-hotplug eth0
...

auto br0
bridge_ports eth0 wlan0
...

When I hot-plug eth0 then brctl show only shows wlan0 for br0, but not eth0.

TheDiveO
  • 1,591
  • 1
  • 11
  • 16

1 Answers1

3

So it occured to me that telling /etc/network/interfaces to "manually" add the network interface eth0 to my br0 bridge may answer my question: yes, indeed, this works. So my /etc/network/interfaces contains this:

auto eth0
allow-hotplug eth0
...
up brctl addif br0 eth0

After quite some testing by pulling eth0 and later hot-plugging it back again I could successfully verify that this works in fact reliably.

TheDiveO
  • 1,591
  • 1
  • 11
  • 16