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:
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.
Check the default zone of the firewall using the below command.
you can also check the active zone of the firewall.
Check rules are associated with a firewall. so
Check all zone available using the below command.
We can add any service using the below command. so
firewall-cmd --zone=public --add-service=http
Check services in a specific zone.so
firewall-cmd --zone=public --list-services
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