Subject: [alpine-devel] snapshot for 120316

From: Natanael Copa <[email-masked]>
Date: Fri, 16 Mar 2012 18:22:56 +0100

Hi,

I have pushed a new alpine edge snapshot. It contains the support for
bridges, bonding and vlan (and vde2) configuring directly
in /etc/network/interfaces script.

I have also removed some really old way of configuring vlans and bridge
in init.d scripts. I think we only want support ifup/ifdown style for
those.

I have also added metric to default gateways from udhcpc. It should now
do approx the same as what dhcpcd does. For wifi it will sett metric to
300 + ifindex and for others 200 + ifindex. This will make it easier
when you have multiple gateways with dhcp, for example multi ISP.

I have not started with the setup scripts yet. this snapshot is
supposed to help me with that.

Please test.

Thanks!

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

---

From: Nathan Angelacos <[email-masked]>
Date: Wed, 21 Mar 2012 08:41:30 -0700

> in /etc/network/interfaces script.
<snip>
> Please test.

vlans and bridge tested - here's an example config:

...
auto vlan161
iface vlan161 inet static
         vlan-raw-device eth0
         address 192.168.1.10
         netmask 255.255.255.224

# Synthesized interfaces
auto br0
iface br0 inet dhcp
         pre-up ifup vlan65
         hostname wifi
         bridge-ports vlan65
         # vap0 is added by hostapd
         post-down ifdown vlan65
....

One small thing, in if-pre-up.d/vlan, line 19:

  *) [ -n "${IF_VLAN_ID}" -o -n "${IF_VLAN_RAW_DEVICE}" ]  || exit 0 ;;

That doesn't set NAME1 like the others.  Even if it did, (NAME1=VLAN), 
ip still has problems finding the interface.

I was trying somthing insane like

iface foo inet dhcp
    vlan-raw-device eth0
    vlan-id 161
    hostname foo

Not sure that should be allowed - if not, perhaps change line 19 to 
something like:

*) echo "Interface name is not valid for vlan" ; exit 1;;

---

---

From: Natanael Copa <[email-masked]>
Date: Wed, 21 Mar 2012 22:37:36 +0100

On Wed, 21 Mar 2012 08:41:30 -0700
Nathan Angelacos <[email-masked]> wrote:

> > I have pushed a new alpine edge snapshot. It contains the support
> > for bridges, bonding and vlan (and vde2) configuring directly
> That doesn't set NAME1 like the others.  Even if it did,
> (NAME1=VLAN), ip still has problems finding the interface.
> 

I don't think there are any vlan name type for creating a vlan
interfaces named 'foo'. (see vconfig man page. set_name_type
and  vlan_name_types in /usr/include/linux/if_vlan.h)
 
> *) echo "Interface name is not valid for vlan" ; exit 1;;

actually, it is probably allowed to create vlan interfaces with any
name using iproute2. I removed the code that does that uses it though
since the busybox iproute does not support it. We could probably make
it work by detecting if its bb iproute or not. (i wanted ship something
working rather than aim for perfect and not ship at all)

Care to file a bug so i don't forget it?

-nc

---

---

From: Nathan Angelacos <[email-masked]>
Date: Thu, 22 Mar 2012 22:34:23 -0700

> Care to file a bug so i don't forget it?

I think its good to only allow names like vlan[0-9]+

Alpine Linux is BusyBox based.   This script should be run when Alpine 
is first installed - iproute2 shouldn't be loaded.

If someone wants to load iproute2, they should be smart enough to 
configure the interfaces themselves.

---