[pve-devel] [PATCH] add vlan aware bridge ifupdown script v2

Alexandre DERUMIER aderumier at odiso.com
Tue Jul 28 18:43:52 CEST 2015


> here a bug report from michael :
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742547

>>So we are totally incompatible with old wheezy?! Cant we make it compatible?

Current debian vlan, break config like

auto vmbr0
   bridge_ports eth0.X


I have fixed it in my version.


>>Somehow that code is really hard to understand - where is that double ifup 
>>exactly? 

Well, now, if you don't have the vlan package (with the vlan script).

you can define

auto eth0.X
iface inet eth0.X 
...

and ifup will manage it correctly (in C source) (without vconfig, without vlan bash script).

That also  mean that, both native ifup and vlan script, will try to create the interface vlan.


That's why debian have added (so vlan script don't do nothing for eth*.*,bond*.*, as it's already managed by ifup)

 eth*.*|bond*.*|wlan*.*)
    # Silently ignore interfaces which ifupdown handles on its own
    # If IF_BRIDGE_PORTS is set, probably we're called by bridge-utils
    [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0
    .....
  ;;



But this ( [ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ]),
is now breaking
 auto vmbr0
   bridge_ports eth0.X

(This is the bug reported by michael)


So, in my version, I remove
[ -z "$IF_VLAN_RAW_DEVICE" -a -z "$IF_BRIDGE_PORTS" ] && exit 0


as anyway at the end of the script, the vlan interface is created with

    if [ ! -e "/sys/class/net/$IFACE" ]; then
        ip link set up dev $IF_VLAN_RAW_DEVICE
        vconfig add $IF_VLAN_RAW_DEVICE $VLANID
    fi


so, if native ifup has already created the vlan interface, we don't create it.






(My opinion is that ifupdown is totally a mess, because it's splitted with differents packages/scripts,
 and with different maintainers and they don't seem to talk together.
 Looking at debian bugs, I'm seeing pending bugs since years still not fixed)







----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "aderumier" <aderumier at odiso.com>
Cc: "Wolfgang Bumiller" <w.bumiller at proxmox.com>, "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mardi 28 Juillet 2015 17:51:54
Objet: Re: [pve-devel] [PATCH] add vlan aware bridge ifupdown script v2

> But the problem, is that it's not working for vlan interface in bridge_ports 
> and other random named interfaces. 
> 
> here a bug report from michael : 
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=742547 

So we are totally incompatible with old wheezy?! Cant we make it compatible? 

> Anyway, to avoid double ifup (1 by ifdown and 1 by vlan script), the vlan 
> script test if the device already exist. 

Somehow that code is really hard to understand - where is that double ifup 
exactly? 



More information about the pve-devel mailing list