--- /usr/share/perl5/PVE/INotifyEtcnetOverride.pm.orig +++ /usr/share/perl5/PVE/INotifyEtcnetOverride.pm @@ -392,14 +392,13 @@ } elsif ($type eq 'vlan') { $options->{'TYPE'}='vlan'; - $options->{'HOST'}=$vlan_raw_device; + my $parent_iface; + if ($vlan_raw_device) { + $parent_iface = $vlan_raw_device; + } elsif ($iface =~ /^([^.]+)\./) { + $parent_iface = $1; + } + $options->{'HOST'}=$parent_iface if $parent_iface; if ($iface =~ /(\d+)(?::\d+)?$/) { # id.VID:ALIAS $options->{'VID'}=$1; - } - if ($vlan_raw_device =~ /^vmbr/) { - if ($iface =~ /^$vlan_raw_device\./) { - $options->{'TYPE'}='brivlanport'; - } else { - die "Oops! etcnet writer: vlan brivlanport $iface: name expected to start from $vlan_raw_device"; - } } --- /etc/net/scripts/create-bri.orig +++ /etc/net/scripts/create-bri @@ -18,6 +18,15 @@ is_yes "$VLAN_AWARE" && BRIDGE_OPTIONS="${BRIDGE_OPTIONS:+"$BRIDGE_OPTIONS" }vlan_filtering 1" $IP link set $NAME type bridge $BRIDGE_OPTIONS +# Add VLANs to bridge itself if VLAN-aware +is_yes "$VLAN_AWARE" && { + if [ -n "$VIDS" ]; then + for vid in $VIDS; do + $BRIDGE vlan add dev $NAME vid $vid self && print_progress + done + fi +} + for host in $HOST; do $IP link set $host master $NAME && print_progress is_yes "$VLAN_AWARE" && { --- /etc/net/scripts/create-vlan.orig +++ /etc/net/scripts/create-vlan @@ -3,6 +3,12 @@ pickup_defaults pickup_options +# If HOST is not set but NAME contains dot, try to extract parent interface +if [ -z "$HOST" ] && echo "$NAME" | grep -q '\.'; then + HOST=$(echo "$NAME" | cut -d. -f1) + print_progress +fi + : ${HOST:?HOST is missing for $NAME} : ${VID:?VID is missing for $NAME}