Let us see how to stop and disable Firewalld on a CentOS or RHEL 7.x based system.

 

Is firewalld running on my system?

Run:

sudo firewall-cmd --state

 

Stop the the firewalld

Again, type:

sudo systemctl stop firewalld

 

Disable the FirewallD service at boot time

sudo systemctl disable firewalld
sudo systemctl mask --now firewalld

 

Verify that the FirewallD is gone

Simply type:

sudo systemctl status firewalld

 

How do enable the firewalld again?

Simply run the following commands:

sudo systemctl unmask --now firewalld
sudo systemctl enable firewalld
sudo systemctl start firewalld
## verify that the firewalld started ##
sudo firewall-cmd --state

 

Linux disable ufw based firewall

ufw is easy to use app for managing a Linux firewall and aims to provide an easy to use interface for the user. It is the default on Ubuntu and can be installed on Debian, CentOS, and other Linux distros.

 

Is the ufw running?

The syntax is:

sudo ufw status

 

Stop the ufw on Linux

sudo ufw disable

 

Disable the ufw on Linux at boot time

sudo systemctl disable ufw

 

Verify that the ufw is gone

sudo ufw status
sudo systemctl status ufw

 

How do enable the ufw again?

Just issue the following two commands to enable the firewall and protect your box again:

sudo systemctl enable ufw
sudo ufw enable
## verify that ufw started ##
sudo ufw status

 

A note about older Linux distro

You need to use the service command and you must be a root user to run the following commands:

 

Stop the iptables service on Linux

service iptables stop

 

Disable the iptables service at boot time on Linux

# chkconfig iptables off
Was this answer helpful? 0 Users Found This Useful (0 Votes)