Ubuntu includes its own firewall, known as ufw – short for “uncomplicated firewall.” Ufw is an easier-to-use frontend for the standard Linux iptables commands. You can even control ufw from a graphical interface. I will be done via terminal.
1. To enable ufw type : sudo ufw enable
2. To view the status type: sudo ufw status verbose
3. To disable ufw type: sudo ufw disable
4. to reset ufw type: sudo ufw reset