From ee06cd0a228c823cd820450823adbe05bd539d43 Mon Sep 17 00:00:00 2001
From: Yevgeniy Kuksenko <2882631+ykuksenko@users.noreply.github.com>
Date: Fri, 23 Dec 2022 05:10:33 -0600
Subject: [PATCH] Support setting mtu on public interfaces (#1700)
Setting mtu on management and private interfaces is supported. It should
also be supported on public interfaces.
---
docs/configuration.markdown | 3 +++
lib/vagrant-libvirt/templates/public_interface.xml.erb | 3 +++
2 files changed, 6 insertions(+)
diff --git a/docs/configuration.markdown b/docs/configuration.markdown
index 9b9f8af..9691b71 100644
--- a/docs/configuration.markdown
+++ b/docs/configuration.markdown
@@ -549,6 +549,9 @@ virtual network.
help attach VLAN tags to specific VMs by adjusting the pattern to match. Note
that you cannot use names reserved for libvirt's usage based on [documentation](
https://libvirt.org/formatdomain.html#overriding-the-target-element).
+* `:libvirt__mtu` - MTU size for the Libvirt interface, if not defined, the
+ created network will use the Libvirt default (1500). VMs still need to configure
+ their internal interface MTUs.
Additionally for public networks, to facilitate validating if the device provided
can be used, vagrant-libvirt will check both the host interfaces visible to libvirt
diff --git a/lib/vagrant-libvirt/templates/public_interface.xml.erb b/lib/vagrant-libvirt/templates/public_interface.xml.erb
index f426645..d1c28ea 100644
--- a/lib/vagrant-libvirt/templates/public_interface.xml.erb
+++ b/lib/vagrant-libvirt/templates/public_interface.xml.erb
@@ -23,6 +23,9 @@
<%- elsif @driver_iommu %>
<%- end %>
+ <% if @mtu %>
+
+ <% end %>
<%- if @ovs %>
<%- if @ovs_interfaceid %>