From nobody Fri Apr 26 15:25:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1652285436749754.5931031509742; Wed, 11 May 2022 09:10:36 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-451-KvkwyljIPAyv-uEEGKzLdg-1; Wed, 11 May 2022 12:10:33 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D476E3C62B6C; Wed, 11 May 2022 16:10:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7443C4C47BF; Wed, 11 May 2022 16:10:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 41CC41937755; Wed, 11 May 2022 16:10:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5A7F4194975B for ; Wed, 11 May 2022 15:41:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3C6DA400E118; Wed, 11 May 2022 15:41:59 +0000 (UTC) Received: from egarver.remote.csb (unknown [10.22.10.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1451840C1421; Wed, 11 May 2022 15:41:58 +0000 (UTC) X-MC-Unique: KvkwyljIPAyv-uEEGKzLdg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Eric Garver To: libvir-list@redhat.com Subject: [PATCH 1/4] network: firewalld: convert to policies Date: Wed, 11 May 2022 11:41:52 -0400 Message-Id: <20220511154156.4036678-2-eric@garver.life> In-Reply-To: <20220511154156.4036678-1-eric@garver.life> References: <20220511154156.4036678-1-eric@garver.life> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mailman-Approved-At: Wed, 11 May 2022 16:10:28 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laine@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1652285438764100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Convert the existing behavior into policies. This commit has no functional changes. Signed-off-by: Eric Garver --- src/network/libvirt-nat-out.policy | 12 ++++++++++++ src/network/libvirt-to-host.policy | 20 ++++++++++++++++++++ src/network/libvirt.zone | 23 +++++------------------ src/network/meson.build | 10 ++++++++++ 4 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 src/network/libvirt-nat-out.policy create mode 100644 src/network/libvirt-to-host.policy diff --git a/src/network/libvirt-nat-out.policy b/src/network/libvirt-nat-o= ut.policy new file mode 100644 index 000000000000..7d1cf6dfb4c4 --- /dev/null +++ b/src/network/libvirt-nat-out.policy @@ -0,0 +1,12 @@ + + + libvirt-nat-out + + + This policy is used to allow NAT virtual machine traffic to the + rest of the network. + + + + + diff --git a/src/network/libvirt-to-host.policy b/src/network/libvirt-to-ho= st.policy new file mode 100644 index 000000000000..045b35d58d0d --- /dev/null +++ b/src/network/libvirt-to-host.policy @@ -0,0 +1,20 @@ + + + libvirt-to-host + + + This policy is used to filter traffic from virtual machines to the + host. + + + + + + + + + + + + + diff --git a/src/network/libvirt.zone b/src/network/libvirt.zone index b1e84b52ecc9..4c5639d8a84f 100644 --- a/src/network/libvirt.zone +++ b/src/network/libvirt.zone @@ -1,25 +1,12 @@ - + libvirt =20 - The default policy of "ACCEPT" allows all packets to/from - interfaces in the zone to be forwarded, while the (*low priority*) - reject rule blocks any traffic destined for the host, except those - services explicitly listed (that list can be modified as required - by the local admin). This zone is intended to be used only by - libvirt virtual networks - libvirt will add the bridge devices for - all new virtual networks to this zone by default. + This zone is intended to be used only by libvirt virtual networks - + libvirt will add the bridge devices for all new virtual networks to + this zone by default. =20 - - - - - - - - - - + diff --git a/src/network/meson.build b/src/network/meson.build index b5eff0c3ab6b..3dd342639a46 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -100,5 +100,15 @@ if conf.has('WITH_NETWORK') install_dir: prefix / 'lib' / 'firewalld' / 'zones', rename: [ 'libvirt.xml' ], ) + install_data( + 'libvirt-to-host.policy', + install_dir: prefix / 'lib' / 'firewalld' / 'policies', + rename: [ 'libvirt-to-host.xml' ], + ) + install_data( + 'libvirt-nat-out.policy', + install_dir: prefix / 'lib' / 'firewalld' / 'policies', + rename: [ 'libvirt-nat-out.xml' ], + ) endif endif --=20 2.33.0 From nobody Fri Apr 26 15:25:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1652285441223386.9119238388116; Wed, 11 May 2022 09:10:41 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-634-UU9XIZLXPJaHjP1_2QPo7Q-1; Wed, 11 May 2022 12:10:36 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D3A331E7DCC8; Wed, 11 May 2022 16:10:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF12154AC93; Wed, 11 May 2022 16:10:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 867D51932204; Wed, 11 May 2022 16:10:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9C899194975B for ; Wed, 11 May 2022 15:41:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 767F540C1244; Wed, 11 May 2022 15:41:59 +0000 (UTC) Received: from egarver.remote.csb (unknown [10.22.10.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4F74F40C1421; Wed, 11 May 2022 15:41:59 +0000 (UTC) X-MC-Unique: UU9XIZLXPJaHjP1_2QPo7Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Eric Garver To: libvir-list@redhat.com Subject: [PATCH 2/4] network: firewalld: add zone for routed networks Date: Wed, 11 May 2022 11:41:53 -0400 Message-Id: <20220511154156.4036678-3-eric@garver.life> In-Reply-To: <20220511154156.4036678-1-eric@garver.life> References: <20220511154156.4036678-1-eric@garver.life> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mailman-Approved-At: Wed, 11 May 2022 16:10:28 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laine@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1652285442622100002 Content-Type: text/plain; charset="utf-8"; x-default="true" This zone will be used for the routed network by default. Signed-off-by: Eric Garver --- src/network/libvirt-routed.zone | 12 ++++++++++++ src/network/meson.build | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 src/network/libvirt-routed.zone diff --git a/src/network/libvirt-routed.zone b/src/network/libvirt-routed.z= one new file mode 100644 index 000000000000..9cc6cacc2f8a --- /dev/null +++ b/src/network/libvirt-routed.zone @@ -0,0 +1,12 @@ + + + libvirt-routed + + + This zone is intended to be used only by routed libvirt virtual networ= ks - + libvirt will add the bridge devices for all new virtual networks to th= is + zone by default. + + + + diff --git a/src/network/meson.build b/src/network/meson.build index 3dd342639a46..cd52e2a54c28 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -100,6 +100,11 @@ if conf.has('WITH_NETWORK') install_dir: prefix / 'lib' / 'firewalld' / 'zones', rename: [ 'libvirt.xml' ], ) + install_data( + 'libvirt-routed.zone', + install_dir: prefix / 'lib' / 'firewalld' / 'zones', + rename: [ 'libvirt-routed.xml' ], + ) install_data( 'libvirt-to-host.policy', install_dir: prefix / 'lib' / 'firewalld' / 'policies', --=20 2.33.0 From nobody Fri Apr 26 15:25:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1652285441853903.2993051130758; Wed, 11 May 2022 09:10:41 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-624-wUfNSjjJPzWknVEQThNeKQ-1; Wed, 11 May 2022 12:10:37 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D76339F9CC4; Wed, 11 May 2022 16:10:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 491BE401E89; Wed, 11 May 2022 16:10:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 791AA1932227; Wed, 11 May 2022 16:10:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1652F194975B for ; Wed, 11 May 2022 15:42:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EA7C040C1247; Wed, 11 May 2022 15:41:59 +0000 (UTC) Received: from egarver.remote.csb (unknown [10.22.10.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id C263040C1421; Wed, 11 May 2022 15:41:59 +0000 (UTC) X-MC-Unique: wUfNSjjJPzWknVEQThNeKQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Eric Garver To: libvir-list@redhat.com Subject: [PATCH 3/4] network: firewalld: add policy for routed networks Date: Wed, 11 May 2022 11:41:55 -0400 Message-Id: <20220511154156.4036678-5-eric@garver.life> In-Reply-To: <20220511154156.4036678-1-eric@garver.life> References: <20220511154156.4036678-1-eric@garver.life> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mailman-Approved-At: Wed, 11 May 2022 16:10:28 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laine@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1652285442619100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Eric Garver --- src/network/libvirt-routed-out.policy | 12 ++++++++++++ src/network/meson.build | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 src/network/libvirt-routed-out.policy diff --git a/src/network/libvirt-routed-out.policy b/src/network/libvirt-ro= uted-out.policy new file mode 100644 index 000000000000..efa0030569d6 --- /dev/null +++ b/src/network/libvirt-routed-out.policy @@ -0,0 +1,12 @@ + + + libvirt-routed-out + + + This policy is used to allow routed virtual machine traffic to the res= t of + the network. + + + + + diff --git a/src/network/meson.build b/src/network/meson.build index cd52e2a54c28..36d9b51a2cf9 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -115,5 +115,10 @@ if conf.has('WITH_NETWORK') install_dir: prefix / 'lib' / 'firewalld' / 'policies', rename: [ 'libvirt-nat-out.xml' ], ) + install_data( + 'libvirt-routed-out.policy', + install_dir: prefix / 'lib' / 'firewalld' / 'policies', + rename: [ 'libvirt-routed-out.xml' ], + ) endif endif --=20 2.33.0 From nobody Fri Apr 26 15:25:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1652285440796171.30222739466694; Wed, 11 May 2022 09:10:40 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-3-Cd9Gx1C5N9CGgOVeeQlzDw-1; Wed, 11 May 2022 12:10:37 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F2E90100BACD; Wed, 11 May 2022 16:10:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DEAD6400E547; Wed, 11 May 2022 16:10:32 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C40B9193F6F7; Wed, 11 May 2022 16:10:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E02CE194975B for ; Wed, 11 May 2022 15:41:59 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B0713400E118; Wed, 11 May 2022 15:41:59 +0000 (UTC) Received: from egarver.remote.csb (unknown [10.22.10.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88B75400E436; Wed, 11 May 2022 15:41:59 +0000 (UTC) X-MC-Unique: Cd9Gx1C5N9CGgOVeeQlzDw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Eric Garver To: libvir-list@redhat.com Subject: [PATCH 3/4] network: firewalld: add policies for routed networks Date: Wed, 11 May 2022 11:41:54 -0400 Message-Id: <20220511154156.4036678-4-eric@garver.life> In-Reply-To: <20220511154156.4036678-1-eric@garver.life> References: <20220511154156.4036678-1-eric@garver.life> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mailman-Approved-At: Wed, 11 May 2022 16:10:28 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laine@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1652285442623100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Eric Garver --- src/network/libvirt-routed-in.policy | 11 +++++++++++ src/network/libvirt-routed-out.policy | 12 ++++++++++++ src/network/meson.build | 10 ++++++++++ 3 files changed, 33 insertions(+) create mode 100644 src/network/libvirt-routed-in.policy create mode 100644 src/network/libvirt-routed-out.policy diff --git a/src/network/libvirt-routed-in.policy b/src/network/libvirt-rou= ted-in.policy new file mode 100644 index 000000000000..baf8822d747c --- /dev/null +++ b/src/network/libvirt-routed-in.policy @@ -0,0 +1,11 @@ + + + libvirt-routed-out + + + This policy is used to allow routed traffic to the virtual machines. + + + + + diff --git a/src/network/libvirt-routed-out.policy b/src/network/libvirt-ro= uted-out.policy new file mode 100644 index 000000000000..efa0030569d6 --- /dev/null +++ b/src/network/libvirt-routed-out.policy @@ -0,0 +1,12 @@ + + + libvirt-routed-out + + + This policy is used to allow routed virtual machine traffic to the res= t of + the network. + + + + + diff --git a/src/network/meson.build b/src/network/meson.build index cd52e2a54c28..20e411c7eaff 100644 --- a/src/network/meson.build +++ b/src/network/meson.build @@ -115,5 +115,15 @@ if conf.has('WITH_NETWORK') install_dir: prefix / 'lib' / 'firewalld' / 'policies', rename: [ 'libvirt-nat-out.xml' ], ) + install_data( + 'libvirt-routed-out.policy', + install_dir: prefix / 'lib' / 'firewalld' / 'policies', + rename: [ 'libvirt-routed-out.xml' ], + ) + install_data( + 'libvirt-routed-in.policy', + install_dir: prefix / 'lib' / 'firewalld' / 'policies', + rename: [ 'libvirt-routed-in.xml' ], + ) endif endif --=20 2.33.0 From nobody Fri Apr 26 15:25:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1652285444792893.596496257148; Wed, 11 May 2022 09:10:44 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-NlZ5onZ8PVioKy6ohDqpgw-1; Wed, 11 May 2022 12:10:36 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D3F553C62B76; Wed, 11 May 2022 16:10:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BEEDC7AE4; Wed, 11 May 2022 16:10:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B7992193220C; Wed, 11 May 2022 16:10:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 4044C193F6F5 for ; Wed, 11 May 2022 15:42:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 301A840D1B99; Wed, 11 May 2022 15:42:00 +0000 (UTC) Received: from egarver.remote.csb (unknown [10.22.10.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 081A440D1B98; Wed, 11 May 2022 15:41:59 +0000 (UTC) X-MC-Unique: NlZ5onZ8PVioKy6ohDqpgw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Eric Garver To: libvir-list@redhat.com Subject: [PATCH 4/4] network: firewalld: add support for routed networks Date: Wed, 11 May 2022 11:41:56 -0400 Message-Id: <20220511154156.4036678-6-eric@garver.life> In-Reply-To: <20220511154156.4036678-1-eric@garver.life> References: <20220511154156.4036678-1-eric@garver.life> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-Mailman-Approved-At: Wed, 11 May 2022 16:10:28 +0000 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laine@redhat.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1652285446478100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: Eric Garver --- src/network/bridge_driver_linux.c | 6 +++++- src/network/libvirt-to-host.policy | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/network/bridge_driver_linux.c b/src/network/bridge_driver_= linux.c index 98d2a33a1da0..2c8e43b427cb 100644 --- a/src/network/bridge_driver_linux.c +++ b/src/network/bridge_driver_linux.c @@ -859,7 +859,11 @@ int networkAddFirewallRules(virNetworkDef *def) * forwarded (and even DHCP and DNS from guest to host * will probably no be permitted by the default zone */ - if (virFirewallDZoneExists("libvirt")) { + if (def->forward.type =3D=3D VIR_NETWORK_FORWARD_ROUTE && + virFirewallDZoneExists("libvirt-routed")) { + if (virFirewallDInterfaceSetZone(def->bridge, "libvirt-rou= ted") < 0) + return -1; + } else if (virFirewallDZoneExists("libvirt")) { if (virFirewallDInterfaceSetZone(def->bridge, "libvirt") <= 0) return -1; } else { diff --git a/src/network/libvirt-to-host.policy b/src/network/libvirt-to-ho= st.policy index 045b35d58d0d..9ec489dc57b5 100644 --- a/src/network/libvirt-to-host.policy +++ b/src/network/libvirt-to-host.policy @@ -8,6 +8,7 @@ =20 + =20 --=20 2.33.0