UFW - Uncomplicated FireWall
| 2024-07-18 / 2025-10-24 | ||
Quicknotes
Memo Limit Block: https://www.cyberciti.biz/faq/howto-limiting-ssh-connections-with-ufw-on-ubuntu-debian/
Reject sendet
Installation
sudo apt install ufw
Grundkonfiguration
sudo ufw default deny incoming
sudo ufw default allow outgoingRegeln
#bb8
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw allow from 192.168.5.49 to any port 10050
#l0la5*
♯crypt♯
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw allow ftp
sudo ufw allow vnc
sudo ufw allow snmp
sudo ufw allow proto tcp to any port 135 # SAMBA
sudo ufw allow proto tcp to any port 139 # SAMBA
sudo ufw allow proto tcp to any port 445 # SAMBA
sudo ufw allow proto udp to any port 137 # SAMBA
sudo ufw allow proto udp to any port 138 # SAMBA
#r2d2
♯crypt♯
♯crypt♯
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 25 #smtp
#sudo ufw allow 143
sudo ufw allow 465
sudo ufw allow 587
sudo ufw allow 993
#r4g9
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
   #Samba
sudo ufw allow proto tcp to any port 135
sudo ufw allow proto tcp to any port 139
sudo ufw allow proto tcp to any port 445
sudo ufw allow proto udp to any port 137
sudo ufw allow proto udp to any port 138
sudo ufw allow from 172.16.0.0/12 to any port 10053
#l337
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw allow from 192.168.5.45 to any port 8008 #conbee3 http
sudo ufw allow from 192.168.5.45 to any port 8088 #conbee3 websocket (?)
sudo ufw allow from 192.168.5.49 to any port 10050
sudo ufw allow from 192.168.9.3 to any port 5900
sudo ufw allow from 192.168.9.7 to any port 5900
sudo ufw allow from 192.168.9.33 to any port 5900
#k4k1
sudo ufw allow from 192.168.9.3 to any port ssh
sudo ufw allow from 192.168.9.7 to any port sshAktivieren
sudo ufw enableRegeln anzeigen
sudo ufw status verboseRegeln von ...
sudo ufw allow from 203.0.113.4 to any port 22
sudo ufw allow from 203.0.113.0/24 to any port 22IP Blocken
#insert 1 ist wichtig, da die Regeln nach der Reihenfolge abgearbeitet werden...
#kommt vorher ein PORT-Allow würde die IP für den Port nicht geblockt werden!
sudo ufw insert 1 deny from <IP> to anyReihenfolge der Regeln anzeigen
sudo ufw status numberedRegeln löschen
sudo ufw status numbered
sudo ufw delete <number>
#ACHTUNG! Numbered ändert sich wenn man vorne weglöscht!
Zurücksetzen
sudo ufw resetDeaktivieren
sudo ufw disable