usefull commands of firewall

List of Important Firewall Commands For Linux User

Today we’re going to show you a list of important firewall commands in the Linux machine. We have installed RedHat 7.5 version installed on our system.

Check Out: Deploy Container Using Docker Swarm Cluster On Linux

To check the state of the firewall. you can use a firewall to control your traffic and access to the server with on particular port. you can do this with iptables also in Linux 7 version.

firewall-cmd –state

list of Important Firewall Commands

Check Out: How To Add Ports in firewall On CentOS 7

Check default zone of firewall

firewall-cmd –get-default-zone

firewall command in linux

Check active zone of the firewall

firewall-cmd –get-active-zone

Check Out: How To View The Content of Compressed Files On Linux

Check rules are associated with a firewall   so

firewall-cmd –list-all

linux firewall command

Check all zone available

firewall-cmd –get-zones so

Check Out: How To Enable Firewall Rules and Port On Linux Server

Add service so

firewall-cmd –zone=public –add-service=http

Check services in a specific zone so

firewall-cmd –zone=public –list-services

Check Out: Step To Install Centos 8 Linux Machine On Vmware Workstation

The command to open the ports so

firewall-cmd –zone=public –add-port=4000/tcp

Note: You can use –permanent parameter to added it permanent.

Check particular port added in zone

firewall-cmd –zone=public –list-ports

You’re done

Leave a Reply

Notify of