[pve-devel] [PATCH pve-network 1/3] vlanplugin: define vlan interface and fix vlan-protocol

Alexandre Derumier aderumier at odiso.com
Fri Mar 29 00:23:50 CET 2019


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

Signed-off-by: Alexandre Derumier <aderumier at 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




More information about the pve-devel mailing list