Differences between revisions 7 and 9 (spanning 2 versions)
Revision 7 as of 2022-09-16 14:45:41
Size: 1462
Comment:
Revision 9 as of 2022-09-23 18:41:31
Size: 1485
Comment:
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
Note that not all operating systems have strong support for `ufw(8)`. [[Linux/AlpineLinux|Alpine Linux]] prefers its users to use [[Awall]]; [[Linux/Fedora|Fedora]] and [[Linux/CentOS|associated projects]] ship with the incompatible [[firewalld]]. BSDs do not offer `iptables(8)`, so `ufw(8)` is a non-option. Note that not all operating systems have strong support for `ufw(8)`. [[Linux/AlpineLinux|Alpine Linux]] prefers its users to use [[Awall]]; [[Linux/Fedora|Fedora]] and [[Linux/CentOS|associated projects]] ship with the incompatible [[Linux/SystemdFirewalld|firewalld]]. BSDs do not offer `iptables(8)`, so `ufw(8)` is a non-option.

UFW

ufw(8) (meaning Uncomplicated Firewall) is a firewall management program. It is a wrapper around iptables(8).


Installation

Install the ufw package through your preferred package manager. Then start and enable ufw.service.

Note that not all operating systems have strong support for ufw(8). Alpine Linux prefers its users to use Awall; Fedora and associated projects ship with the incompatible firewalld. BSDs do not offer iptables(8), so ufw(8) is a non-option.


Configuration

A basic rule set is:

ufw default deny incoming
ufw default allow outgoing
ufw allow 22

ufw(8) is distributed with app profiles that simplify the configuration process. Instead of allowing ports, consider allowing apps.

ufw allow ssh

Web Servers

The following rules should allow any web server to operate.

ufw allow http
ufw allow https

Additional steps may be required if using certbot on a custom port.

FTP

ufw allow 20/tcp
ufw allow 21/tcp
ufw allow 989/tcp
ufw allow 990/tcp

Passive configuration also utilizes a pool of ports. Recommended to use custom ports, so adjust as needed.

ufw allow 40000:42000/tcp


CategoryRicottone

Ufw (last edited 2023-04-08 13:25:45 by DominicRicottone)