Ubuntu comes with default firewall (already installed) called UFW. UFW stands for Uncomplicated Firewall.
first update the apt package
$ sudo apt-get update
Output something like the below screenshot :-
Now run below command on terminal to install ufw firewall
$ sudo apt-get install ufw
Output something like the below screenshot :-
$ sudo ufw status
Output something like the below screenshot :-
$ sudo ufw enable
Output something like the below screenshot :-
first update the apt package
$ sudo ufw disable
Output something like the below screenshot :-
$ sudo ufw reload
Output something like the below screenshot :-
All Rights Reserved. ReadAndCare