[pve-devel] [PATCH pve-network 1/4] vxlan: use vxlan<id> interface name

Alexandre Derumier aderumier at odiso.com
Tue Jun 4 07:03:40 CEST 2019


we can't change online vxlan tag,
better to map interface name to vxlan tag.
(ifreload with delete old interface, and create a new with correct vxlan)

also vxlan-id are unique

Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/Network/VxlanMulticastPlugin.pm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/PVE/Network/Network/VxlanMulticastPlugin.pm b/PVE/Network/Network/VxlanMulticastPlugin.pm
index f71094a..16dc593 100644
--- a/PVE/Network/Network/VxlanMulticastPlugin.pm
+++ b/PVE/Network/Network/VxlanMulticastPlugin.pm
@@ -65,16 +65,16 @@ sub generate_network_config {
     }
 
     my $config = "\n";
-    $config .= "auto vxlan$vnetid\n";
-    $config .= "iface vxlan$vnetid inet manual\n";
-    $config .= "       vxlan-id $tag\n" if $tag;
+    $config .= "auto vxlan$tag\n";
+    $config .= "iface vxlan$tag inet manual\n";
+    $config .= "       vxlan-id $tag\n";
     $config .= "       vxlan-svcnodeip $multicastaddress\n" if $multicastaddress;
     $config .= "       vxlan-physdev $iface\n" if $iface;
     $config .= "       mtu $mtu\n" if $mtu;
     $config .= "\n";
     $config .= "auto $vnetid\n";
     $config .= "iface $vnetid inet manual\n";
-    $config .= "        bridge_ports vxlan$vnetid\n";
+    $config .= "        bridge_ports vxlan$tag\n";
     $config .= "        bridge_stp off\n";
     $config .= "        bridge_fd 0\n";
     $config .= "        mtu $mtu\n" if $mtu;
-- 
2.11.0




More information about the pve-devel mailing list