Subject: [alpine-devel] Configuring bridges

From: Natanael Copa <[email-masked]>
Date: Fri, 9 Mar 2012 22:50:41 +0100

Hi,

I created a package called "bridge" which has the if-pre-up.d script
for creating bridges. I rewrote it from scratch because the debian
version was a bit ugly.

This version should support most of the options in debian. Some might
require that you install brctl from bridge-utils.

Example bridge config in /etc/network/interfaces:

iface br0 inet static
	address 192.168.0.1
	netmask 255.255.255.0
	bridge-ports eth0 tap0
	bridge-stp off

The package is in edge/testing.

I was thinking shipping this script and vlan and bonding scripts with
alpine-baselayout. However, those will consume a few kb and generate a
few extra forks every boot up - even if they are unused - so I think it
might make sense to ship them separately.

-nc

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Florian Heigl <[email-masked]>
Date: Sat, 10 Mar 2012 11:43:59 +0100

Hi,

> for creating bridges. I rewrote it from scratch because the debian

nice :)

> might make sense to ship them separately.

Just a warning with bonding, there is a few dragons hiding with bonding.
When one uses LACP on one bond and active/passive failover on another
then there have to be special methods for loading the bonding module.
I don't remember how Debian handles it, just remember each Linux flavor
has it's own way for this. And there will be a few hooks for it somewhere.

Mind the gap!

-- 
the purpose of libvirt is to provide an abstraction layer hiding all
xen features added since 2006 until they were finally understood and
copied by the kvm devs.

---

---

From: Timo Teras <[email-masked]>
Date: Sat, 10 Mar 2012 15:37:04 +0200

On Sat, 10 Mar 2012 11:43:59 +0100 Florian Heigl
<[email-masked]> wrote:

> > I was thinking shipping this script and vlan and bonding scripts
> > with alpine-baselayout. However, those will consume a few kb and
> > generate a few extra forks every boot up - even if they are unused
> > - so I think it might make sense to ship them separately.
> 
> Just a warning with bonding, there is a few dragons hiding with
> bonding. When one uses LACP on one bond and active/passive failover
> on another then there have to be special methods for loading the
> bonding module. I don't remember how Debian handles it, just remember
> each Linux flavor has it's own way for this. And there will be a few
> hooks for it somewhere.
> 
> Mind the gap!

It's limitation of the old kernel intrerface for configuring the bonds.
Basically ifenslave is not really needed, and the bonds can be fully
configured via the /sys/ interface. If using that, the bonds types can
be configured individally without the module loading tweaks.

- Timo

---

---

From: Florian Heigl <[email-masked]>
Date: Sat, 10 Mar 2012 20:21:25 +0100

> be configured individally without the module loading tweaks.

Wow, that's incredibly great news!

Thank you for correcting me :)

---

---

From: Nathan Angelacos <[email-masked]>
Date: Sun, 11 Mar 2012 19:06:15 -0700

> might make sense to ship them separately.

<phb>

I'm in favor of a separate package; Alpine's great because it its 
opt-in, vs opt-out.  When I need bonding and vlans and bridges I need 
them.  But the other 90% of the time its nice to have a lean fast system.

Oh the other hand, what do you name the package so that someone like me 
remembers to load it when needed?

</phb>

---

---

From: Natanael Copa <[email-masked]>
Date: Mon, 12 Mar 2012 08:29:19 +0100

On Sun, 11 Mar 2012 19:06:15 -0700
Nathan Angelacos <[email-masked]> wrote:

> Oh the other hand, what do you name the package so that someone like
> me remembers to load it when needed?

for bonding: apk add bonding
for bridge interfaces: apk add bridge
for vlans: apk add vlan

If you forget: apk search bridge bond vlan

Btw, I intend to add support for those in setup-interfaces.

Something like:

Available interfaces are: eth0 eth1.
Which one do you want to initialize? (or 'done') [eth0] bond0
Available slaves are: eth0 eth1.
Which slave(s) do you want to add to bond0? (or 'all') [all] all
Ip address for bond0? (or 'dhcp') [dhcp] none
Available interfaces are: bond0.
Which one do you want to initialize? (or 'done') [bond0] bond0.64
Ip adress for bond0.64 (or 'dhcp') [dhcp] 192.168.0.2/24
...

Or for bridges:
Available interfaces are: eth0 eth1.
Which one do you want to initialize? (or 'done') [eth0] br0
Available bridge ports are: eth0 eth1.
Which port(s) do you want to add to br0? (or 'all') [all] eth0 eth1
...

The idea is that if you enter bond[0-9]+ or br[0-9]+ or $IFACE.[0-9]+
it will create a bond, bridge or vlan interface.

The question:
Available interfaces are: eth0 eth1.
Which one do you want to initialize? (or 'done') [eth0]

Should probably give some hint about it. Ideas how?

I am thinking maybe:
Which one do you want to initialize? (or '?' for help) 

-nc

---

---

From: Roger Pau Monné <[email-masked]>
Date: Mon, 12 Mar 2012 11:14:41 +0100

> it will create a bond, bridge or vlan interface.

I also use bridge[0-9]+ to create bridges, could you add that as a
recognized bridge interface also?

> Which one do you want to initialize? (or '?' for help)

And if you input "?", something like:

Use the following names to create and configure different types of interfaces:

- bond[0-9]: create and configure a bond interface.
- br[0-9] or bridge[0-9]: create and configure a bridge interface.
- $IFACE.[0-9]: create and configure a vlan interface.
- $IFACE: configure a network interface.

Regards, Roger.

---

---

From: Nathan Angelacos <[email-masked]>
Date: Mon, 12 Mar 2012 08:11:13 -0700

> recognized bridge interface also?

That's funny.  I've done the same for vlans:

vlan65@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue

ifup vlan65
ifdown vlan65

I'm not asking alpine support it - just commenting that there are many 
ways to name things.

---

---

From: Natanael Copa <[email-masked]>
Date: Mon, 12 Mar 2012 17:09:58 +0100

On Mon, 12 Mar 2012 08:11:13 -0700
Nathan Angelacos <[email-masked]> wrote:

> I'm not asking alpine support it - just commenting that there are
> many ways to name things.

This is supported with testing/vlan in /etc/network/interfaces:

iface vlan65 inet dhcp
	vlan-raw-device eth0

-nc

---

---

From: Timo Teras <[email-masked]>
Date: Mon, 12 Mar 2012 20:11:55 +0200

> This is supported with testing/vlan in /etc/network/interfaces:

Sweet! This is something I was needing too.

Now to just have acf-networking support this (and resolv.conf editing).

- Timo

---

---

From: Harry Lachanas <[email-masked]>
Date: Thu, 22 Mar 2012 13:59:17 +0200

> for creating bridges. I rewrote it from scratch because the debian
This might be interesting 2.

http://openvswitch.org

In my tests it compiles right out of the box.

---

From: Natanael Copa <[email-masked]>
Date: Thu, 22 Mar 2012 16:52:21 +0100

On Thu, 22 Mar 2012 13:59:17 +0200

> In my tests it compiles right out of the box.

I saw linux-3.3 has support for it. interesting indeed. I doubt i will
be able to include it for alpine v2.4

-nc

---