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

Alexandre DERUMIER aderumier at odiso.com
Tue Jul 28 09:27:48 CEST 2015


>>Seems we have the same code in 
>>
>>/etc/network/if-pre-up.d/vlan
>>/etc/network/if-pre-up.d/vmbrvlan
>>
>>So what code gets executed? both?

yes, both, but vmbrvlan have only code for vmbr named interfaces and vlan only for eth|bond|wlan named interfaces

The best should be to merge all in the vlan file, but I don't known how to not conflict with debian vlan package.





----- Mail original -----
De: "dietmar" <dietmar at proxmox.com>
À: "aderumier" <aderumier at odiso.com>, "pve-devel" <pve-devel at pve.proxmox.com>
Envoyé: Mardi 28 Juillet 2015 09:18:05
Objet: Re: [pve-devel] [PATCH] add vlan aware bridge ifupdown script v2

Seems we have the same code in 

/etc/network/if-pre-up.d/vlan 
/etc/network/if-pre-up.d/vmbrvlan 

So what code gets executed? both? 

> diff --git a/vmbrvlan b/vmbrvlan 
> new file mode 100755 
> index 0000000..ee570f0 
> --- /dev/null 
> +++ b/vmbrvlan 
> @@ -0,0 +1,38 @@ 
> +#!/bin/sh 
> + 
> +# Most of this stuff is to enable vlans 
> + 
> +case "$IFACE" in 
> + # Ignore any alias (#272891) which uses <interface>:<alabel> 
> + *:*) 
> + exit 0 
> + ;; 
> + vmbr*.*) 
> + vconfig set_name_type DEV_PLUS_VID_NO_PAD 
> + VLANID=`echo $IFACE|sed "s/vmbr[0-9][0-9]*\.0*//g"` 
> + IF_VLAN_RAW_DEVICE=`echo $IFACE|sed "s/\(vmbr[0-9][0-9]*\)\..*/\1/"` 
> + bridge vlan add dev $IF_VLAN_RAW_DEVICE vid $VLANID self 
> + ;; 
> + *) 
> + exit 0 
> + ;; 
> +esac 
> + 
> +if [ -n "$IF_VLAN_RAW_DEVICE" ]; then 
> + if [ ! -x /sbin/vconfig ]; then 
> + exit 0 
> + fi 
> + if ! ip link show dev "$IF_VLAN_RAW_DEVICE" > /dev/null; then 
> + echo "$IF_VLAN_RAW_DEVICE does not exist, unable to create $IFACE" 
> + exit 1 
> + fi 
> + if [ ! -e "/sys/class/net/$IFACE" ]; then 
> + ip link set up dev $IF_VLAN_RAW_DEVICE 
> + vconfig add $IF_VLAN_RAW_DEVICE $VLANID 
> + fi 
> +fi 
> + 
> +# This is not vlan specific, and should actually go somewhere else. 
> +if [ -n "$IF_HW_MAC_ADDRESS" ]; then 
> + ip link set $IFACE address $IF_HW_MAC_ADDRESS 
> +fi 
> -- 
> 2.1.4 
> 
> _______________________________________________ 
> pve-devel mailing list 
> pve-devel at pve.proxmox.com 
> http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 
> 



More information about the pve-devel mailing list