ufw - uncomplicated firewall
ufw - uncomplicated firewall
well, still too complicated from time to time for me. so let’s write it down. see also iptables - or check the ubuntu wiki
enable / disable ufw
ufw enable
ufw disablemanage rules
list rules
ufw status # simple list
ufw status numbered # numbered list, so you can also delete rules
ufw status verbose # some more info, no numbersdelete rules
ufw delete N # where N is the number from the list command aboveallow application / port
ufw allow openssh
ufw allow 22
ufw allow from 1.2.3.4 to any port 22 # allow from 1.2.3.4 port 22
ufw allow from 1.2.3.4 to any port 22 proto tcp # allow from 1.2.3.4 port 22, tcpdeny application / port
ufw deny from 1.2.3.4