Important List of 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.

Important List of Firewall Commands For Linux User:

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 Solve Printer Spooler Problem In Windows 10

Check the default zone of the firewall using the below command.

firewall-cmd --get-default-zone

firewall command in linux

you can also check the 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 using the below command.

firewall-cmd --get-zones 

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

We can add any service using the below command. so

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

Check services in a specific

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 the particular port added in the zone.

firewall-cmd --zone=public --list-ports

You’re done

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment