check firewall status linux code example
Example 1: firewall status on ubuntu
$ sudo ufw status
[sudo] password for linuxconfig:
Status: inactive
Example 2: RHEL check the firewall status
[root@rhel7 ~]# systemctl status firewalld
Example 3: RHEL check the firewall status
[root@rhel7 ~]# systemctl enable firewalld
Example 4: RHEL check the firewall status
[root@rhel7 ~]# systemctl disable firewalld