UFW is a host-side Iptables class firewall configuration tool that is relatively easy to get started with. General desktop applications using UFW have been able to meet the requirements.
Installation Method
sudo apt-get install UFW
Of course, this is a graphical interface (relatively humble), in the new GUFW to search for a try ...
How to use
1 Enable
sudo UFW enable
Function: Turns on the firewall and shuts down all external access to the local computer (normal external access) with the system boot.
2 Close
2 View firewall status
3 opening/Disabling the appropriate port or service example
sudo UFW allow 80 allows external access to 80 ports
sudo ufw delete allow 80 disallow external access to port 80
sudo ufw allow from 192.168.1.1 allows this IP access to all native ports
sudo UFW deny SMTP prevents external access to the SMTP service
sudo ufw delete allow SMTP to delete a rule established above
sudo ufw deny Proto TCP from 10.0.0.0/8 to 192.168.0.1 Port 22 is going to deny all TCP traffic from 10.0.0.0/8 to 192.168.0.1 Address of 22 port
You can allow all RFC1918 networks (LAN/WLAN) to access this host (/8,/16,/12 is a network rating): sudo ufw allow from 10.0.0.0/8sudo UFW enable from 172.16.0.0/ 12sudo UFW allow from 192.168.0.0/16
Recommended Settings
sudo apt-get install UFW
sudo UFW enable
Ubuntu UFW Firewall Easy tutorial (GO)