Install & Setup UFW on Debian 8 (Firewall)

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

Install

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

Deleting

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

Status

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

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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