This tutorial comprises of brief description with real time output of various options of the "firewall" command of UNIX.
The details about the various options are listed below :-
1.) The get-zones option lists the available zones in the firewall
firewall-cmd --get-zones
2.) The list-all option lists the details of the available zones
firewall-cmd --list-all
3.) The ---zone options lists or selects a particular zones
firewall-cmd --zone=external --list-all
4.) The set-default command sets the default zone in firewall.
firewall-cmd --set-default=external
5.) The add-service is used to add a service to a zone in firewall.
firewall-cmd --zone=external --add-service=samba
6.) The list-services is used to list the services attached to a particular zone.
sudo firewall-cmd --zone=external --list-services
7.) The firewall is restarted with the following command:-
firewall-cmd --reload
8.) The permanent option is used to make a change permanent.
firewall-cmd --permanent --zone=external --add-service=samba
9.) The remove-service is used to remove a service to a zone in firewall.
firewall-cmd --zone=external --remove-service=samba
10.) The add-port option is used to add a port to a zone.
firewall-cmd --permanent --zone=external --add-port=139/tcp
11.) To list the ports which are added to a zone we use list-ports option.
firewall-cmd --zone=external --list=ports
12.) The remove-port option is used to remove a port to a zone.
firewall-cmd --permanent --zone=external --remove-port=139/tcp
13.) Create a custom zone
firewall-cmd --permanent --new-zone=linuxconfig
14.) Associating a zone with an interface
firewall-cmd --permanent --zone=linuxconfig --add-interface=ens55
15.) To list the interfaces assigned to a zone
firewall-cmd --zone=linuxconfig --list-interfaces
16.) Removing a zone from an interface
firewall-cmd --remove-interface=ens55 --zone=linuxconfig
17.) Turn on panic mode
firewall-cmd --panic-on
18.) Turn off panic mode
firewall-cmd --panic-off
19.) To query panic mode status
firewall-cmd --query-panic
On this page of the site you can watch the video online Linux/Unix Tutorial for Beginners for firewall command with a duration of hours minute second in good quality, which was uploaded by the user Coding GuruJi 31 May 2019, share the link with friends and acquaintances, this video has already been watched 566 times on youtube and it was liked by 5 viewers. Enjoy your viewing!