teach you how to turn on/off Ubuntu firewall
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
sudo ufw default deny
Function: Turns on the firewall and shuts down all external access to the local computer (normal external access) with the system boot.
2 Close
sudo ufw disable
2 View firewall status
sudo UFW 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
sudo ufw default deny
This setting is already secure and if you have special needs, you can use sudo ufw allow to turn on the service.
Teach you how to turn on/off Ubuntu firewall