Replace firewalld with iptables in CentOS

From DevOps Notebook

Stop and disable firewalld

# systemctl stop firewalld
# systemctl disable firewalld

Install and enable iptables service

# yum install iptables-services
# systemctl enable iptables

Create simple iptables to allow port 22 by editing '`'/etc/sysconfig/iptables

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-port-unreachable
COMMIT

Start iptables and verify that rules have been applied

# systemctl start iptables
# iptables -nL