Re: hotpluggable member of a bridge
Hi.
On Wed, 04 Jan 2017 22:34:16 -0500
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> I have a bridge interface `br0` which usually contains jut `eth0` but
> occasionally also needs to contain `usb0`, which is an ethernet-dongle
> kind of thing.
>
> How do I setup /etc/network/interfaces for that?
>
> Currently, I just setup everything "manually": `br0` is setup `static`,
> and `usb0` is setup as `manual` with post-up scripts that add it to
> the bridge.
>
> Is there something better? Like a predefined way to just say that when
> `usb0` appears, it should be added to `br0` (and ideally, this would
> also `ifup` the `br0` interface if it's not up yet).
Conventional Linux bridge cannot do that. All those interfaces(5)
stanzas are merely a wrapper to 'brctl addbr' and 'brctl addif', which
are invoked by ifupdown.
But, it all changes if you replace conventional bridge with
openvswitch, which *can* add new interfaces (ports as they call it) to
its own bridges dynamically *and* it can be configured via interfaces(5).
A sample configuration would be:
allow-ovs br0
iface br0 inet4 static
address …
netmask …
ovs_type OVSBridge
allow-br0 eth0
iface eth0 inet6 auto
ovs_type OVSPort
ovs_bridge br0
allow-hotplug usb0
iface usb0 inet6 auto
ovs_type OVSPort
ovs_bridge br0
Reco
Reply to: