• 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. Failed to start LSB: Bring up/down networking – On restarting network service CentOS/RHEL (DHCP client)
  2. How to Add Network Printer via Command Line in CentOS/RHEL
  3. How to use “btrfs device” comamnd to add/delete device to/from btrfs filesystem
  4. How to use rndc command (command-line administration tool for named)
  5. How to add a Custom Script to systemd in CentOS/RHEL 7
  6. Allow cronjobs to run by pam even if user password is expired
  7. RHEL 7 – RHCSA Notes : Change passwords and adjust password aging for local user accounts
  8. “-bash: route: command not found” on CentOS/RHEL 7
  9. CentOS / RHEL 6,7 : How to recover an interrupted yum package installation
  10. PAM password complexity and pam_cracklib credit system in CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright