982648
From ceeba568bf66491826fdd2c16002890375790a4f Mon Sep 17 00:00:00 2001
982648
Message-Id: <ceeba568bf66491826fdd2c16002890375790a4f@dist-git>
982648
From: Ales Musil <amusil@redhat.com>
982648
Date: Sun, 29 Jul 2018 16:56:18 +0200
982648
Subject: [PATCH] examples: Add clean-traffic-gateway into nwfilters
982648
MIME-Version: 1.0
982648
Content-Type: text/plain; charset=UTF-8
982648
Content-Transfer-Encoding: 8bit
982648
982648
The filter purpose is to simulate isolated private VLAN.
982648
982648
The behavior can be achieved by limiting network traffic
982648
to traffic between VM and gateway. Because there is no
982648
concept of the PVLAN in the linux bridge.
982648
982648
The filter also contains parts from clean-traffic
982648
to prevent VM from spoofing its IP and MAC address.
982648
982648
To use this filter the user just needs to set
982648
the GATEWAY_MAC variable to gateway MAC address.
982648
982648
Signed-off-by: Ales Musil <amusil@redhat.com>
982648
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
982648
(cherry picked from commit ac01fbc90b7eb4ccc7a6140d618d1a3859365155)
982648
982648
https://bugzilla.redhat.com/show_bug.cgi?id=1603115
982648
982648
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
982648
Reviewed-by: Ján Tomko <jtomko@redhat.com>
982648
---
982648
 .../xml/nwfilter/clean-traffic-gateway.xml    | 34 +++++++++++++++++++
982648
 1 file changed, 34 insertions(+)
982648
 create mode 100644 examples/xml/nwfilter/clean-traffic-gateway.xml
982648
982648
diff --git a/examples/xml/nwfilter/clean-traffic-gateway.xml b/examples/xml/nwfilter/clean-traffic-gateway.xml
982648
new file mode 100644
982648
index 0000000000..b8c204041a
982648
--- /dev/null
982648
+++ b/examples/xml/nwfilter/clean-traffic-gateway.xml
982648
@@ -0,0 +1,34 @@
982648
+<filter name='clean-traffic-gateway'>
982648
+    
982648
+            from a VM by
982648
+              - preventing MAC spoofing -->
982648
+    <filterref filter='no-mac-spoofing'/>
982648
+
982648
+    
982648
+    <filterref filter='no-ip-spoofing'/>
982648
+
982648
+    
982648
+    <filterref filter='no-arp-spoofing'/>
982648
+
982648
+    
982648
+    <rule action='accept' direction='inout' priority='-500'>
982648
+        <mac protocolid='arp'/>
982648
+    </rule>
982648
+
982648
+    
982648
+    <rule action='accept' direction='in'>
982648
+        <mac match='yes' srcmacaddr='$GATEWAY_MAC'/>
982648
+    </rule>
982648
+
982648
+    
982648
+    <rule action='accept' direction='out'>
982648
+        <mac match='yes' dstmacaddr='$GATEWAY_MAC'/>
982648
+    </rule>
982648
+
982648
+    
982648
+    and ARP -->
982648
+    <filterref filter='no-other-l2-traffic'/>
982648
+
982648
+    
982648
+    <filterref filter='qemu-announce-self'/>
982648
+</filter>
982648
-- 
982648
2.18.0
982648