• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

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

By admin

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.wants/ip6tables.service'

Filed Under: CentOS/RHEL 7

Some more articles you might also be interested in …

  1. How to enable bind query logging to find out Who’s Querying a Name Server
  2. Beginners guide to Apache HTTP Server – Installation and Configuration
  3. How to Configure Logical Volume Manager for Cluster File System
  4. CentOS / RHEL 7 : sysctl kernel parameter doesn’t take effect after reboot
  5. How to Set CPU Affinity for SYSTEMD Process in CentOS/RHEL 7
  6. How to Create Yum Repository For System Packages Installation in CentOS/RHEL
  7. Beginners Guide to Managing Package Module Streams in CentOS/RHEL 8
  8. Apache HTTP server – most commonly used containers (special configuration directives)
  9. How to enable core dump for Applications on CentOS/RHEL
  10. Beginners guide to Kernel Module Configuration in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  • Unable to Start RDMA Services on CentOS/RHEL 7
  • How to rename a KVM VM with virsh
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary