From a609f5b17dcead4b7d0e108a00efcdd99a2be385 Mon Sep 17 00:00:00 2001 From: Tobias Jungel Date: Tue, 13 Sep 2016 09:14:20 +0200 Subject: [PATCH] add trustGuestRxFilters attribute to public interface set :trust_guest_rx_filters => true in the network definition to enable trustGuestRxFilters for the public interface. Details from http://www.libvirt.org/formatdomain.html#elementsNICSDirect: "If the model type is set to virtio and interface's trustGuestRxFilters attribute is set to yes, changes made to the interface mac address, unicast/multicast receive filters, and vlan settings in the guest will be monitored and propagated to the associated macvtap device on the host (Since 1.2.10). If trustGuestRxFilters is not set, or is not supported for the device model in use, an attempted change to the mac address originating from the guest side will result in a non-working network connection." closes #650 --- README.md | 3 +++ lib/vagrant-libvirt/action/create_network_interfaces.rb | 1 + lib/vagrant-libvirt/templates/public_interface.xml.erb | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6b12256..1d8e8e5 100644 --- a/README.md +++ b/README.md @@ -546,6 +546,9 @@ virtual network. * `:portgroup` - Name of libvirt portgroup to connect to. * `:ovs` - Support to connect to an Open vSwitch bridge device. Default is 'false'. +* `:trust_guest_rx_filters` - Support trustGuestRxFilters attribute. Details + are listed [here](http://www.libvirt.org/formatdomain.html#elementsNICSDirect). + Default is 'false'. ### Management Network diff --git a/lib/vagrant-libvirt/action/create_network_interfaces.rb b/lib/vagrant-libvirt/action/create_network_interfaces.rb index 9915db6..e5dc6dc 100644 --- a/lib/vagrant-libvirt/action/create_network_interfaces.rb +++ b/lib/vagrant-libvirt/action/create_network_interfaces.rb @@ -82,6 +82,7 @@ module VagrantPlugins template_name = 'public_interface' @logger.info("Setting up public interface using device #{@device} in mode #{@mode}") @ovs = iface_configuration.fetch(:ovs, false) + @trust_guest_rx_filters = iface_configuration.fetch(:trust_guest_rx_filters, false) # configuration for udp or tcp tunnel interfaces (p2p conn btwn guest OSes) elsif iface_configuration.fetch(:tunnel_type, nil) @type = iface_configuration.fetch(:tunnel_type) diff --git a/lib/vagrant-libvirt/templates/public_interface.xml.erb b/lib/vagrant-libvirt/templates/public_interface.xml.erb index 7f99e49..3f0d3e1 100644 --- a/lib/vagrant-libvirt/templates/public_interface.xml.erb +++ b/lib/vagrant-libvirt/templates/public_interface.xml.erb @@ -1,4 +1,4 @@ - + trustGuestRxFilters='yes'<% end %>> <% if @mac %> <% end %>