Bug 2055706 - firewalld backend: routed networks don't allow incoming (to libvirt) traffic
Summary: firewalld backend: routed networks don't allow incoming (to libvirt) traffic
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 35
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-17 14:54 UTC by Eric Garver
Modified: 2022-11-29 18:09 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-29 18:09:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Eric Garver 2022-02-17 14:54:00 UTC
Firewalld v1.0.0 included breaking changes [1] that affect the libvirt
firewalld backend when using a routed network.

Routed networks worked pre v1.0.0 because of firewalld issue 177 [2].
This was fixed in v1.0.0. Now packets world -> libvirt are blocked.

Assuming we want to address the situation, I think libvirt should use a
firewalld policy to expose the routed VM network.

  # firewall-cmd --permanent --new-policy libvirt-fwd-in
  # firewall-cmd --permanent --policy libvirt-fwd-in --add-ingress-zone ANY
  # firewall-cmd --permanent --policy libvirt-fwd-in --add-egress-zone libvirt
  # firewall-cmd --permanent --policy libvirt-fwd-in --set-target ACCEPT

This policy could be shipped similar to the libvirt zone.

Of course, you don't want this policy to go active when using a NAT'd
configuration. To control that the shipped policy could omit the
egress-zone (making it inactive) and libvirt only adds it at runtime for
routed networks.

[1]: https://firewalld.org/2021/06/the-upcoming-1-0-0 "Default target is now similar to reject"
[2]: https://github.com/firewalld/firewalld/issues/177

Comment 1 Benjamin Blasco 2022-05-14 12:11:16 UTC
Found as a consequence of the discussion here:

https://github.com/firewalld/firewalld.github.io/pull/14

Comment 2 Laine Stump 2022-05-14 15:04:05 UTC
Eric has sent patches for new zone/policy files to be shipped with libvirt to fix this issue, and it's being discussed on the upstream mailing list:

https://listman.redhat.com/archives/libvir-list/2022-May/231200.html

Comment 3 yalzhang@redhat.com 2022-06-07 06:02:00 UTC
I can reproduce this bug with firewalld-1.0.0-4.el9.noarch

1. Start the firewalld on 2 hosts;
2. On host 1, start a route network:
<network connections='2'>
  <name>br1</name>
  <uuid>8a2e947d-c1d5-4695-2881-5f877ced63e0</uuid>
  <forward mode='route'/>
  <bridge name='br1' stp='on' delay='0'/>
  <mac address='52:54:00:07:f7:41'/>
  <ip address='10.0.0.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='10.0.0.2' end='10.0.0.254'/>
    </dhcp>
  </ip>
</network>
 
3. On host 1, start 2 VMs connected to this network;

4. Test the 2 VMs can ping each other, and the guest can ping host;

5. The VM can not ping host 2;

6. On host 2, which are in the same subnet of the host 1, add a static route:
# ip route add 10.0.0.0/24 via 10.73.xx.xx dev eno1
(10.73.xx.xx is the ip of host 1)

7. VM ping host2, succeed

8. Host2 ping vm, failed:
# ping 10.0.0.115
PING 10.0.0.115 (10.0.0.115) 56(84) bytes of data.
From 10.73.xx.xx icmp_seq=1 Packet filtered
From 10.73.xx.xx icmp_seq=2 Packet filtered
……
 
With old firewalld firewalld-0.9.3-2.el9.noarch:
Step 8 will succeed
# ping 10.0.0.145
PING 10.0.0.145 (10.0.0.145) 56(84) bytes of data.
64 bytes from 10.0.0.145: icmp_seq=1 ttl=63 time=0.569 ms
64 bytes from 10.0.0.145: icmp_seq=2 ttl=63 time=0.484 ms
……

Comment 4 Ben Cotton 2022-11-29 17:55:06 UTC
This message is a reminder that Fedora Linux 35 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 35 on 2022-12-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '35'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 35 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 5 Laine Stump 2022-11-29 18:09:11 UTC
This was resolved upstream with Commit 7f7a09a2d2, which is in libvirt-8.10.0.


Note You need to log in before you can comment on or make changes to this bug.