This page will list out how to set up a firewall using ufw. Ufw stands for Uncomplicated Firewall, and is a program for managing a netfilter firewall. It provides a command line interface and aims to be uncomplicated and easy to use. See Wikipedia:Uncomplicated_Firewall and ArchWiki:Uncomplicated Firewall for more information.

Installation

Install the ufw package and the service package for your respective init system. Additionally, you can install gufw which is a graphical front end to ufw.

dinit

 root # pacman -S ufw ufw-dinit gufw

OpenRC

 root # pacman -S ufw ufw-openrc gufw

runit

 root # pacman -S ufw ufw-runit gufw

s6

 root # pacman -S ufw ufw-s6 gufw

66

 root # pacman -S ufw ufw-suite66 gufw

Services

Enable and start ufw

OpenRC

To start immediately:

 root # rc-service ufw start

To start the tor service on system boot, add it to the default runlevel

 root # rc-update add ufw default

runit

Enable ufw

 root # ln -s /etc/runit/sv/ufw /run/runit/service

Start ufw

 root # sv up/down/restart ufw

See also