ufw
Uncomplicated Firewall - frontend for iptables
Overview
UFW provides a user-friendly command-line interface for managing iptables firewall rules. Designed to be easy to use while still being powerful.
Syntax
ufw [--dry-run] [options] [rule syntax]Common Options
enableEnable the firewall.
disableDisable the firewall.
statusShow firewall status.
status verboseShow detailed firewall status.
status numberedShow firewall status with rule numbers.
allowAdd an allow rule.
denyAdd a deny rule.
deleteDelete a rule.
resetReset firewall to default state.
reloadReload firewall rules.
defaultSet default policy.
Examples
Check if the firewall is active and show rules.
Enable the firewall.
Disable the firewall.
Allow SSH connections on port 22.
Allow SSH connections using service name.
Allow HTTP and HTTPS.
Allow all traffic from a subnet.
Block Telnet connections.
Delete the rule allowing port 8080.
Set default to deny incoming connections.
Set default to allow outgoing connections.
Show rules with numbers for easy deletion.
Delete rule number 3.