ufw でファイアーウォール設定

SSH

ufw allow from 192.168.0.0/16 to any app "OpenSSH"
ufw enable

Postfix

ufw allow "Postfix"
ufw allow "Postfix SMTPS"
ufw allow "Postfix Submission"
ufw allow "Dovecot Secure IMAP"
ufw allow "Dovecot IMAP"

Nginx

ufw app list にNginx が無い場合は作る。

vi /etc/ufw/applications.d/nginx

[Nginx]
title=Nginx(80,443)
description=web server
ports=80,443/tcp

DNS

ufw allow 1053/udp comment 'PowerDNS'
ufw allow from 192.168.0.0/16 to any port 53 proto udp comment "PowerDNS recursor"

Mariadb

ufw allow from 192.168.0.0/16 to any port 3306 comment 'Mariadb'

ufw command

ufw allow nginx

FTP

ufw allow from 192.168.0.0/16 to any port ftp
ufw allow from 192.168.0.0/16 to any port ftp-data
ufw allow from 192.168.0.0/16 to any port 11000:11100 proto tcp

Delete command

ufw status numbered
ufw delete 3