vlan-protocol is on vlan interface, better to always define it

Signed-off-by: Alexandre Derumier <aderum...@odiso.com>
---
 PVE/Network/VlanPlugin.pm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/PVE/Network/VlanPlugin.pm b/PVE/Network/VlanPlugin.pm
index 0bd43fe..cbeecf6 100644
--- a/PVE/Network/VlanPlugin.pm
+++ b/PVE/Network/VlanPlugin.pm
@@ -77,13 +77,17 @@ sub generate_network_config {
     die "interface $iface already exist in main configuration" if 
($interfaces->{iface}->{$iface});
     
     my $config = "\n";
+    $config .= "auto $iface\n";
+    $config .= "iface $iface inet manual\n";
+    $config .= "        vlan-protocol $vlanprotocol\n" if $vlanprotocol;
+    $config .= "        mtu $mtu\n" if $mtu;
+    $config .= "\n";
     $config .= "auto $vnetid\n";
     $config .= "iface $vnetid inet manual\n";
     $config .= "        bridge_ports $iface\n";
     $config .= "        bridge_stp off\n";
     $config .= "        bridge_fd 0\n";
     $config .= "        vlan-aware 1 \n" if $vlanaware;
-    $config .= "        vlan-protocol $vlanprotocol \n" if $vlanprotocol;
     $config .= "        mtu $mtu\n" if $mtu;
 
     return $config;
-- 
2.11.0

_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to