Skip to content

Instantly share code, notes, and snippets.

@ashrithr
Created August 2, 2014 21:26
Show Gist options
  • Save ashrithr/2bd1a6318fc5ec484e44 to your computer and use it in GitHub Desktop.
Save ashrithr/2bd1a6318fc5ec484e44 to your computer and use it in GitHub Desktop.
Enabling IPTables in RHEL/CentOS 7

Firewalld, if included in RHEL 7, is a replacement for iptables and is being included as default. Some benefits include not needing to restart the firewall when changes are made, which means your system maintains its firewall during rule modification, and current connections are not lost.

Anyhow, if you are not willing to migrate to Firewalld and want to use iptables as default, follow these steps:

Install iptables service:

yum install -y iptables-services

Set iptables as default:

systemctl mask firewalld
systemctl enable iptables

Stop firewalld and start iptables:

systemctl stop firewalld
systemctl start iptables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment