~alpine/devel

11 7

[alpine-devel] Configuring bridges

Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20120309225041.43308a57@alpinelinux.org>
Sender timestamp
1331329841
DKIM signature
missing
Download raw message
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:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Details
Message ID
<CAFivhPkRWYHnMDwVV=YZVtQgrat2g-KO4u1P-u8rp81ramiOHQ@mail.gmail.com>
In-Reply-To
<20120309225041.43308a57@alpinelinux.org> (view parent)
Sender timestamp
1331376239
DKIM signature
missing
Download raw message
Hi,

2012/3/9 Natanael Copa <ncopa@alpinelinux.org>:
> 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.

nice :)

> 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!

-- 
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.


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Timo Teras <timo.teras@iki.fi>
Details
Message ID
<20120310153704.64e978d1@vostro>
In-Reply-To
<CAFivhPkRWYHnMDwVV=YZVtQgrat2g-KO4u1P-u8rp81ramiOHQ@mail.gmail.com> (view parent)
Sender timestamp
1331386624
DKIM signature
missing
Download raw message
On Sat, 10 Mar 2012 11:43:59 +0100 Florian Heigl
<florian.heigl@gmail.com> wrote:

> Hi,
> 
> 2012/3/9 Natanael Copa <ncopa@alpinelinux.org>:
> > 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.
> 
> nice :)
> 
> > 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


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Details
Message ID
<CAFivhPnb-1WGPjHVu_N1Q0tUbUPrPq1iMPZwy6YDeUV2QdPt2Q@mail.gmail.com>
In-Reply-To
<20120310153704.64e978d1@vostro> (view parent)
Sender timestamp
1331407285
DKIM signature
missing
Download raw message
2012/3/10 Timo Teras <timo.teras@iki.fi>:
> 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.

Wow, that's incredibly great news!

Thank you for correcting me :)


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Nathan Angelacos <nangel@alpinelinux.org>
Details
Message ID
<4F5D5A17.2010505@alpinelinux.org>
In-Reply-To
<20120309225041.43308a57@alpinelinux.org> (view parent)
Sender timestamp
1331517975
DKIM signature
missing
Download raw message
> 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.
>

<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>


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Nathan Angelacos <nangel@nothome.org>
Details
Message ID
<4F5E1211.7020609@nothome.org>
In-Reply-To
<CAPLaKK76m56_7ZhDtmBS5gr290Nmb3Uzpb4FXdPZ0Ayn69NWDQ@mail.gmail.com> (view parent)
Sender timestamp
1331565073
DKIM signature
missing
Download raw message
>
> I also use bridge[0-9]+ to create bridges, could you add that as a
> 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.


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20120312082919.094415d6@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<4F5D5A17.2010505@alpinelinux.org> (view parent)
Sender timestamp
1331537359
DKIM signature
missing
Download raw message
On Sun, 11 Mar 2012 19:06:15 -0700
Nathan Angelacos <nangel@alpinelinux.org> 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.
> >
> 
> <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?

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


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Roger Pau Monné <roger.pau@entel.upc.edu>
Details
Message ID
<CAPLaKK76m56_7ZhDtmBS5gr290Nmb3Uzpb4FXdPZ0Ayn69NWDQ@mail.gmail.com>
In-Reply-To
<20120312082919.094415d6@ncopa-desktop.nor.wtbts.net> (view parent)
Sender timestamp
1331547281
DKIM signature
missing
Download raw message
2012/3/12 Natanael Copa <ncopa@alpinelinux.org>:
> On Sun, 11 Mar 2012 19:06:15 -0700
> Nathan Angelacos <nangel@alpinelinux.org> 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.
>> >
>>
>> <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?
>
> 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.

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

> 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)

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.

>
>
>
> -nc
>
>
> ---
> Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
> Help:         alpine-devel+help@lists.alpinelinux.org
> ---
>


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20120312170958.0d679eaf@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<4F5E1211.7020609@nothome.org> (view parent)
Sender timestamp
1331568598
DKIM signature
missing
Download raw message
On Mon, 12 Mar 2012 08:11:13 -0700
Nathan Angelacos <nangel@nothome.org> wrote:

> >
> > I also use bridge[0-9]+ to create bridges, could you add that as a
> > 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.

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

iface vlan65 inet dhcp
	vlan-raw-device eth0



-nc


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Timo Teras <timo.teras@iki.fi>
Details
Message ID
<20120312201155.7021882e@vostro>
In-Reply-To
<20120312170958.0d679eaf@ncopa-desktop.nor.wtbts.net> (view parent)
Sender timestamp
1331575915
DKIM signature
missing
Download raw message
On Mon, 12 Mar 2012 17:09:58 +0100 Natanael Copa
<ncopa@alpinelinux.org> wrote:

> On Mon, 12 Mar 2012 08:11:13 -0700
> Nathan Angelacos <nangel@nothome.org> wrote:
> 
> > >
> > > I also use bridge[0-9]+ to create bridges, could you add that as a
> > > 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.
> 
> This is supported with testing/vlan in /etc/network/interfaces:
> 
> iface vlan65 inet dhcp
> 	vlan-raw-device eth0

Sweet! This is something I was needing too.

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

- Timo


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Harry Lachanas <grharry@freemail.gr>
Details
Message ID
<4F6B1415.6020809@freemail.gr>
In-Reply-To
<20120309225041.43308a57@alpinelinux.org> (view parent)
Sender timestamp
1332417557
DKIM signature
missing
Download raw message
On 03/09/2012 11:50 PM, Natanael Copa wrote:
> 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 might be interesting 2.

http://openvswitch.org

In my tests it compiles right out of the box.
Natanael Copa <ncopa@alpinelinux.org>
Details
Message ID
<20120322165221.15e91ca2@ncopa-desktop.nor.wtbts.net>
In-Reply-To
<4F6B1415.6020809@freemail.gr> (view parent)
Sender timestamp
1332431541
DKIM signature
missing
Download raw message
On Thu, 22 Mar 2012 13:59:17 +0200
Harry Lachanas <grharry@freemail.gr> wrote:

> On 03/09/2012 11:50 PM, Natanael Copa wrote:
> > 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 might be interesting 2.
> 
> http://openvswitch.org
> 
> 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


---
Unsubscribe:  alpine-devel+unsubscribe@lists.alpinelinux.org
Help:         alpine-devel+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)