How to enable or use iptables firewall on centos 7



Iptables is linux kernel firewall implemented as different netfilter module. Different kernel modules and programs are currently used for different protocols iptables applies to IPv4, ip6tables to IPv6, arptables to ARP, and ebtables to Ethernet frames.

While firewalld is default dynamic firewall for centos 7, it also has support for ipv4 and ipv6 with direct firewall rules management.

Here we are discussing about how to switch from firewalld to iptables cause firewalld is comparatively new and advance version of firewall but some system admins still prefers iptables over firewalld.

Before we start

Save current firewalld configurations before switching to iptables, it’s not necessary but it’s good to save old settings.

Dump the current set of rules to standard output and to a file in your home directory called firewalld_iptables_rules by typing

sudo iptables -S | tee ~/firewalld_iptables_rules

Do the same with ip6tables

sudo ip6tables -S | tee ~/firewalld_ip6tables_rules

More from this author

Leave a Reply

Watch Dragon ball super