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

The Geek Diary

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

CentOS / RHEL 7 : Never run the iptables service and FirewallD service at the same time!

by admin

By default, RHEL 7 uses the FirewallD service to provide network security. FirewallD must be stopped and disabled when using the iptables service:

# systemctl stop firewalld.service
# systemctl disable firewalld.service
# systemctl enable iptables.service
# systemctl start iptables.service

The iptables service is now provided by a separate package called iptables-services:

# yum info iptables-services
Name        : iptables-services
Arch        : x86_64
Version     : 1.4.21
Release     : 13.el7
Size        : 23 k
Repo        : installed
From repo   : anaconda
Summary     : iptables and ip6tables services for iptables
URL         : http://www.netfilter.org/
License     : GPLv2
Description : iptables services for IPv4 and IPv6
            : 
            : This package provides the services iptables and ip6tables that have been split
            : out of the base package since they are not active by default anymore.

The iptables-services package may need to be installed 1st:

# systemctl -a|grep iptables
● iptables.service                      not-found inactive dead      iptables.service

Stop and disable the firewalld service first.

# systemctl stop firewalld.service
# systemctl disable firewalld.service
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.

If you try to enable the iptables service, it would fail.

# systemctl enable iptables.service
Failed to execute operation: No such file or directory

Install the iptables-services package.

# yum install iptables-services -y

Enable the iptables service :

# systemctl enable iptables.service
Created symlink from /etc/systemd/system/basic.target.wants/iptables.service to /usr/lib/systemd/system/iptables.service.

Start the iptables service :

# systemctl start iptables.service
#

Filed Under: CentOS/RHEL 7

Some more articles you might also be interested in …

  1. How to enable additional scsi logging in CentOS/RHEL
  2. RHEL 7 – RHCSA Notes – Set enforcing and permissive modes for SELinux
  3. “Authorization not available. Check if polkit service is running or see debug message for more information” – CentOS/RHEL 7 ssh service error
  4. System Log File /var/log/messages Is Getting Deleted or Trimmed Automatically (CentOS/RHEL)
  5. How to Disable “Predictable Network Interface Device Names” in CentOS/RHEL 7
  6. CentOS / RHEL 7 : How to sync chrony to local clock
  7. Understanding Samba utilities – nmblookup, smbstatus, smbtar, testparm, wbinfo, smbget
  8. CentOS / RHEL 7 : How to modify the kernel command line
  9. How to Customize Linux Password Expiration and Complexity Requirements
  10. CentOS / RHE 7 : How to Prevent Users from Using the Last 10 Passwords

You May Also Like

Primary Sidebar

Recent Posts

  • htaccess Cheatsheet
  • PHP cos function – Cosine
  • PHP connection_status function – Returns connection status bitfield
  • PHP ceil function – Round fractions up

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright