Skip to content

ufw - program cheatsheet

The Uncomplicated Firewall (ufw)

A frontend for iptables and is particularly well-suited for host-based firewalls. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall. ufw aims to provide an easy to use interface for people unfamiliar with firewall concepts, while at the same time simplifies complicated iptables commands.


allow all inbound traffic from command centre's ip.

export GODIP=
sudo ufw allow from $GODIP

Allow only SSH traffic in from overlay interface (port 22)

export INTERFACE=ztnfaa6wav
ufw allow in on $INTERFACE to any port 22 proto tcp

allow all inbound traffic from private overlay network.

export OVERLAY_INTERFACE=ztnfaa6wav
sudo ufw allow in on $OVERLAY_INTERFACE 

allow a single inbound port

ufw allow 34331

view entries

sudo ufw status numbered

delete an entry

sudo ufw delete ENTRY_NUMBER

How to Configure a Firewall with UFW -