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.
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.
root # pacman -S ufw ufw-dinit gufw
root # pacman -S ufw ufw-openrc gufw
root # pacman -S ufw ufw-runit gufw
root # pacman -S ufw ufw-s6 gufw
root # pacman -S ufw ufw-suite66 gufw
Enable and start ufw
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
Enable ufw
root # ln -s /etc/runit/sv/ufw /run/runit/service
Start ufw
root # sv up/down/restart ufw