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

2
  • @A.B No I didn't. would you please explain more? or share any link for this? I couldn't find anything about that.
    – H. Far
    Nov 24, 2021 at 9:02
  • I've already checked that, didn't help.
    – H. Far
    Nov 24, 2021 at 10:39

1 Answer 1

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.
1
  • 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, even when the link is to another SE site. Please read How do I write a good answer? and consider revising your answer to include the steps required to resolve the issue.
    – Paul
    Nov 27, 2021 at 16:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .