Bug 1691358
| Summary: | Network filters are not honouring explicitly listed parameters for MAC | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Daniel Berrangé <berrange> |
| Component: | libvirt | Assignee: | Daniel Berrangé <berrange> |
| Status: | CLOSED ERRATA | QA Contact: | yalzhang <yalzhang> |
| Severity: | unspecified | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.6 | CC: | jdenemar, jomurphy, jsuchane, libvirt-maint, phrdina, virt-bugs, yalzhang |
| Target Milestone: | rc | Keywords: | Regression |
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-4.5.0-16.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | 1691352 | Environment: | |
| Last Closed: | 2019-08-06 13:14:44 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | 1691352 | ||
| Bug Blocks: | 1691356 | ||
|
Description
Daniel Berrangé
2019-03-21 13:24:52 UTC
Upstream fix
commit 01e11ebcb6e8f24662b7c67b70134c192785691c
Author: Nikolay Shirokovskiy <nshirokovskiy>
Date: Wed Mar 20 16:05:59 2019 +0300
nwfilter: fix adding std MAC and IP values to filter binding
reproduce it on libvirt-4.5.0-10.el7_6.7.x86_64
1. Start a guest with interface as below:
# virsh dumpxml rhel7 | grep /interface -B13
<interface type='network'>
<mac address='52:54:00:6d:08:be'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<filterref filter='clean-traffic'>
<parameter name='IP' value='1.2.3.4'/>
<parameter name='IP' value='1.2.3.5'/>
<parameter name='MAC' value='52:54:00:7b:35:93'/>
<parameter name='MAC' value='52:54:00:7b:35:94'/>
</filterref>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
</interface>
2. Check the binding
# virsh nwfilter-binding-dumpxml vnet0
<filterbinding>
<owner>
<name>rhel7</name>
<uuid>af6edb97-34e8-4f66-a3c6-5ffdfb1922d0</uuid>
</owner>
<portdev name='vnet0'/>
<mac address='52:54:00:6d:08:be'/>
<filterref filter='clean-traffic'>
<parameter name='IP' value='1.2.3.4'/>
<parameter name='IP' value='1.2.3.5'/>
** <parameter name='MAC' value='52:54:00:6d:08:be'/> ** ===> the mac is updated to the interface's mac
</filterref>
</filterbinding>
3. Test on libvirt-4.5.0-16.el7.x86_64, the result is as expected, the binding keeps no changes.
# virsh dumpxml rhel | grep /interface -B13
<interface type='network'>
<mac address='52:54:00:7b:35:93'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<filterref filter='clean-traffic'>
<parameter name='IP' value='104.207.129.11'/>
<parameter name='IP' value='104.207.129.12'/>
<parameter name='MAC' value='52:54:00:7b:35:93'/>
<parameter name='MAC' value='52:54:00:7b:35:94'/>
</filterref>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
# virsh nwfilter-binding-dumpxml vnet0
<filterbinding>
<owner>
<name>rhel</name>
<uuid>2313f643-6c51-4706-8780-b1322acbd803</uuid>
</owner>
<portdev name='vnet0'/>
<mac address='52:54:00:7b:35:93'/>
<filterref filter='clean-traffic'>
<parameter name='IP' value='104.207.129.11'/>
<parameter name='IP' value='104.207.129.12'/>
<parameter name='MAC' value='52:54:00:7b:35:93'/>
<parameter name='MAC' value='52:54:00:7b:35:94'/>
</filterref>
</filterbinding>
check the ebtables rules, the ip and mac both are correct as what we set:
# ebtables -t nat -L
Bridge table: nat
Bridge chain: PREROUTING, entries: 1, policy: ACCEPT
-i vnet0 -j libvirt-I-vnet0
Bridge chain: OUTPUT, entries: 0, policy: ACCEPT
Bridge chain: POSTROUTING, entries: 1, policy: ACCEPT
-o vnet0 -j libvirt-O-vnet0
Bridge chain: libvirt-I-vnet0, entries: 9, policy: ACCEPT
-j I-vnet0-mac
-p IPv4 -j I-vnet0-ipv4-ip
-p IPv4 -j ACCEPT
-p ARP -j I-vnet0-arp-mac
-p ARP -j I-vnet0-arp-ip
-p ARP -j ACCEPT
-p 0x8035 -j I-vnet0-rarp
-p 0x835 -j ACCEPT
-j DROP
Bridge chain: libvirt-O-vnet0, entries: 4, policy: ACCEPT
-p IPv4 -j O-vnet0-ipv4
-p ARP -j ACCEPT
-p 0x8035 -j O-vnet0-rarp
-j DROP
Bridge chain: I-vnet0-mac, entries: 3, policy: ACCEPT
-s 52:54:0:7b:35:93 -j RETURN
-s 52:54:0:7b:35:94 -j RETURN
-j DROP
Bridge chain: I-vnet0-ipv4-ip, entries: 4, policy: ACCEPT
-p IPv4 --ip-src 0.0.0.0 --ip-proto udp -j RETURN
-p IPv4 --ip-src 104.207.129.11 -j RETURN
-p IPv4 --ip-src 104.207.129.12 -j RETURN
-j DROP
Bridge chain: O-vnet0-ipv4, entries: 1, policy: ACCEPT
-j ACCEPT
Bridge chain: I-vnet0-arp-mac, entries: 3, policy: ACCEPT
-p ARP --arp-mac-src 52:54:0:7b:35:93 -j RETURN
-p ARP --arp-mac-src 52:54:0:7b:35:94 -j RETURN
-j DROP
Bridge chain: I-vnet0-arp-ip, entries: 3, policy: ACCEPT
-p ARP --arp-ip-src 104.207.129.11 -j RETURN
-p ARP --arp-ip-src 104.207.129.12 -j RETURN
-j DROP
Bridge chain: I-vnet0-rarp, entries: 3, policy: ACCEPT
-p 0x8035 -s 52:54:0:7b:35:93 -d Broadcast --arp-op Request_Reverse --arp-ip-src 0.0.0.0 --arp-ip-dst 0.0.0.0 --arp-mac-src 52:54:0:7b:35:93 --arp-mac-dst 52:54:0:7b:35:93 -j ACCEPT
-p 0x8035 -s 52:54:0:7b:35:94 -d Broadcast --arp-op Request_Reverse --arp-ip-src 0.0.0.0 --arp-ip-dst 0.0.0.0 --arp-mac-src 52:54:0:7b:35:94 --arp-mac-dst 52:54:0:7b:35:94 -j ACCEPT
-j DROP
Bridge chain: O-vnet0-rarp, entries: 3, policy: ACCEPT
-p 0x8035 -d Broadcast --arp-op Request_Reverse --arp-ip-src 0.0.0.0 --arp-ip-dst 0.0.0.0 --arp-mac-src 52:54:0:7b:35:93 --arp-mac-dst 52:54:0:7b:35:93 -j ACCEPT
-p 0x8035 -d Broadcast --arp-op Request_Reverse --arp-ip-src 0.0.0.0 --arp-ip-dst 0.0.0.0 --arp-mac-src 52:54:0:7b:35:94 --arp-mac-dst 52:54:0:7b:35:94 -j ACCEPT
-j DROP
3. if no mac is set, the mac parameter in the nwfilter-binding xml will be the mac of the interface, which is expected.
# virsh dumpxml rhel | grep /interface -B8
<interface type='network'>
<mac address='52:54:00:7b:35:93'/>
<source network='default' bridge='virbr0'/>
<target dev='vnet0'/>
<model type='rtl8139'/>
<filterref filter='clean-traffic'/>
<alias name='net0'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
# virsh nwfilter-binding-dumpxml vnet0
<filterbinding>
<owner>
<name>rhel</name>
<uuid>2313f643-6c51-4706-8780-b1322acbd803</uuid>
</owner>
<portdev name='vnet0'/>
<mac address='52:54:00:7b:35:93'/>
<filterref filter='clean-traffic'>
<parameter name='MAC' value='52:54:00:7b:35:93'/>
</filterref>
</filterbinding>
4. check the ebtables rule, the mac is correct and ip address is learned.
# virsh domifaddr rhel
Name MAC address Protocol Address
-------------------------------------------------------------------------------
vnet0 52:54:00:7b:35:93 ipv4 192.168.122.170/24
# ebtables -t nat -L
Bridge table: nat
Bridge chain: PREROUTING, entries: 1, policy: ACCEPT
-i vnet0 -j libvirt-I-vnet0
Bridge chain: OUTPUT, entries: 0, policy: ACCEPT
Bridge chain: POSTROUTING, entries: 1, policy: ACCEPT
-o vnet0 -j libvirt-O-vnet0
Bridge chain: libvirt-I-vnet0, entries: 9, policy: ACCEPT
-j I-vnet0-mac
-p IPv4 -j I-vnet0-ipv4-ip
-p IPv4 -j ACCEPT
-p ARP -j I-vnet0-arp-mac
-p ARP -j I-vnet0-arp-ip
-p ARP -j ACCEPT
-p 0x8035 -j I-vnet0-rarp
-p 0x835 -j ACCEPT
-j DROP
Bridge chain: libvirt-O-vnet0, entries: 4, policy: ACCEPT
-p IPv4 -j O-vnet0-ipv4
-p ARP -j ACCEPT
-p 0x8035 -j O-vnet0-rarp
-j DROP
Bridge chain: I-vnet0-mac, entries: 2, policy: ACCEPT
-s 52:54:0:7b:35:93 -j RETURN
-j DROP
Bridge chain: I-vnet0-ipv4-ip, entries: 3, policy: ACCEPT
-p IPv4 --ip-src 0.0.0.0 --ip-proto udp -j RETURN
-p IPv4 --ip-src 192.168.122.170 -j RETURN
-j DROP
Bridge chain: O-vnet0-ipv4, entries: 1, policy: ACCEPT
-j ACCEPT
Bridge chain: I-vnet0-arp-mac, entries: 2, policy: ACCEPT
-p ARP --arp-mac-src 52:54:0:7b:35:93 -j RETURN
-j DROP
Bridge chain: I-vnet0-arp-ip, entries: 2, policy: ACCEPT
-p ARP --arp-ip-src 192.168.122.170 -j RETURN
-j DROP
Bridge chain: I-vnet0-rarp, entries: 2, policy: ACCEPT
-p 0x8035 -s 52:54:0:7b:35:93 -d Broadcast --arp-op Request_Reverse --arp-ip-src 0.0.0.0 --arp-ip-dst 0.0.0.0 --arp-mac-src 52:54:0:7b:35:93 --arp-mac-dst 52:54:0:7b:35:93 -j ACCEPT
-j DROP
Bridge chain: O-vnet0-rarp, entries: 2, policy: ACCEPT
-p 0x8035 -d Broadcast --arp-op Request_Reverse --arp-ip-src 0.0.0.0 --arp-ip-dst 0.0.0.0 --arp-mac-src 52:54:0:7b:35:93 --arp-mac-dst 52:54:0:7b:35:93 -j ACCEPT
-j DROP
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2019:2294 |