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
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
andnft list ruleset
.You can choose which backend you want to use in
/etc/firewalld/firewalld.conf
with the optionFirewallBackend
. 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:
hope it helps for others.