May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

CentOS / RHEL 7 : How to switch to iptables from firewalld

Question : How to disable firewalld and enable iptables instead?

Answer :
To switch to from firewalld to iptables follow the steps given below.

1. Firstly ensure the iptables-services package is installed.

# yum install -y -q iptables-services
2. Then prepare the iptables rules you wish to use by editing /etc/sysconfig/iptables and /etc/sysconfig/ipt6tables.

3. Next, disable and stop the firewalld service

# systemctl disable firewalld
rm ‘/etc/systemd/system/basic.target.wants/firewalld.service’
rm ‘/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service’
# systemctl stop firewalld
4. Then start iptables services :

# systemctl start iptables
# systemctl start ip6tables
5. Enable iptables service to automatically start at boot :

# systemctl enable iptables
ln -s ‘/usr/lib/systemd/system/iptables.service’ ‘/etc/systemd/system/basic.target.wants/iptables.service’
# systemctl enable ip6tables
ln -s ‘/usr/lib/systemd/system/ip6tables.service’ ‘/etc/systemd/system/basic.target.w

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>