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




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s