0

I have to setup an stateful firewall on centos8 using firewalld. I'm new to firewalld but have experience with old style iptables for this purpose.
since it is recommended by Redhat here I prefer to not combine two methods like firewalld and iptables.
I want to know is there a way to use firewalld in stateful mode? if it is how?

thank you

H. Far
  • 21
  • 5

1 Answers1

1

thanks to setenforce 1 and his excellent answer here.

Firewalld configures iptables or nftables, and the resulting configuration is stateful (based on connstate status: established, related, untrack, invalid, new).

You can check the actual configuration with iptables -L -n -v and nft list ruleset.

You can choose which backend you want to use in /etc/firewalld/firewalld.conf with the option FirewallBackend. If you want Firewalld to use iptables, you have to set: FirewallBackend=iptables

If you want to disable Firewalld to use you standard iptables configurations, you can use:

systemctl disable firewalld --now
systemctl mask firewalld

hope it helps for others.
H. Far
  • 21
  • 5
  • Welcome to Server Fault! Your answer suggests a workable solution to the question is available via another website. The Stack Exchange family of Q&A websites [generally frowns on this type of answer](https://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers), even when the link is to another SE site. Please read [How do I write a good answer?](http://serverfault.com/help/how-to-answer) and consider revising your answer to include the steps required to resolve the issue. – Paul Nov 27 '21 at 16:24