UFW stands for 'Uncomplicated Firewall' and is the default firewall on most Linux systems.
### Check the status of ufw
sudo ufw status
Remember that you have to restart ufw before any changes take effect.
### Turn on the ufw firewall or reload it
sudo ufw enable
### Reset the ufw firewall to default configuration
sudo ufw reset
Many times administrators will start by denying ALL traffic to a host, and then only allowing the traffic that it needs.
### Deny all traffic
sudo ufw default deny incoming
sudo ufw default deny outgoing
You can also deny or allow traffic to specific ports.
### Allow traffic to port 80
sudo ufw allow 80
You may have to delete a rule from time to time
### Delete a ufw firewall rule
sudo ufw delete deny 80