firewalld / firewalld

Stateful zone based firewall daemon with D-Bus interface
GNU General Public License v2.0
865 stars 272 forks source link

How can I set a rule / policy to allow traffic from one zone to another zone? #1376

Closed kind03 closed 2 weeks ago

kind03 commented 1 month ago

I have reviewed the related documents and manual such as the https://firewalld.org/documentation/man-pages/firewalld.policies.html but cannot find an answer... Could you guys please help. Thanks!

erig0 commented 2 weeks ago

Did you read the concepts page ? It gives an example.

In this example, myPolicy will filter forwarded traffic originating from the internal ingress zone and destined for the external egress zone.

# firewall-cmd --permanent --new-policy myPolicy
# firewall-cmd --permanent --policy myPolicy --add-ingress-zone internal
# firewall-cmd --permanent --policy myPolicy --add-egress-zone external
# firewall-cmd --permanent --policy myPolicy --set-target ACCEPT
# firewall-cmd --reload