• 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 create an XFS Filesystem
  2. CentOS / RHEL 7 : How to follow the mount order in /etc/fstab
  3. How to make CentOS/RHEL 7 FIPS 140-2 compliant
  4. CentOS / RHEL 7 : How to Modify GRUB2 Arguments with grubby
  5. User Account “systemd-bus-proxy”
  6. Understanding chroot Jail
  7. CentOS / RHEL : How to Disable and Blacklist Linux Kernel Module to prevent it from loading automatically
  8. CentOS / RHEL 7 : How to Reset root password
  9. CentOS / RHEL 7 : How to configure serial getty with systemd
  10. How to use auditd to monitor a specific SYSCALL

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright