msgbartop
A chronological documentation test project, nothing serious, really!
msgbarbottom

12 Nov 2014 Replace firewalld with iptables in CentOS 7

Posted by

This is a short HOWTO replace or disable firewalld with iptables in CentOS 7.

Install iptables service
# yum -y install iptables-services

If you would like to save the firewall rules you need to run the following command
# iptables-save > iptables-rules.txt

These rules can be added to /etc/sysconfig/iptables but I usually use the rules that come with iptables package and add my rules to better suit my needs.

# systemctl enable iptables
# systemctl enable ip6tables

Stop firewalld
# systemctl stop firewalld

Disable firewalld
# systemctl disable firewalld

Start iptables service
# systemctl start iptables
# systemctl start ip6tables

And thats it.

Note
Always make sure that you are not locking yourself out of your server when starting the iptables firewall.

Tags: , ,

Comments are closed.