I understand that firewalld is essentially a control layer for iptables underneath it. The command:

# iptables -t nat -nvL

Chain ...


return the chains in the nat table. The result is four empty chains PREROUTING, INPUT, POSTROUTING and OUTPUT. The command for the four other tables raw, security, mangle and filter give their own expected list of empty chains.

when executing

# firewall-cmd --direct --get-all-chains

the command literally gives nothing and returns to the terminal prompt. Is this expected? Is firewalld and iptables less related than I thought?

Ultimately with iptables v1.8.2 and firewalld v0.7.0 in CentOS 8 I am following some commands from here that are as follows:

$ firewall-cmd --permanent --add-masquerade
$ firewall-cmd --permanent --direct --passthrough ipv4 -t nat -A POSTROUTING -s x.x.x.x/x -o x.x.x.x -j MASQUERADE
$ firewall-cmd --reload

The reload command returns an error that the MASQUERADE chain does not exist, thus the origin of this question. I grant that the tutorial is for CentOS 7 and its associated software versions, thus the need to understand this at a deeper level.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.