Tagged: ufw

Install & Setup UFW on Debian 8 (Firewall)

iptables is old and terrible to interact with. UFW or Uncomplicated Firewall is easy and awesome.


sudo apt-get install ufw

Setup Defaults (Incoming/Outgoing/SSH)

sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw allow ssh

Turn It On

sudo ufw enable

— More Info & Documentation —

Allow Connections

sudo ufw allow www
sudo ufw allow ftp
sudo ufw allow 80/tcp
sudo ufw allow 21/tcp

Deny Connections

sudo ufw deny www
sudo ufw deny 80/tcp


sudo ufw delete allow ssh
sudo ufw delete allow 80/tcp
sudo ufw delete allow 1000:2000/tcp


sudo ufw status
sudo ufw status verbose

Reset Everthing

sudo ufw reset


Reference: https://www.digitalocean.com/community/tutorials/how-to-setup-a-firewall-with-ufw-on-an-ubuntu-and-debian-cloud-server