UFW - Uncomplicated Firewall
2024-07-18 / 2024-08-19 | ||
Quicknotes
Installation
sudo apt install ufw
Grundkonfiguration
sudo nano /etc/default/ufw
IPV6=yes
sudo ufw default deny incoming
sudo ufw default allow outgoing
Regeln
#bb8
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
#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♯
sudo ufw allow http
sudo ufw allow https
sudo ufw allow 25
#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
Aktivieren
sudo ufw enable
Regeln anzeigen
sudo ufw status verbose
Regeln 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 22
Regeln löschen
sudo ufw status numbered
sudo ufw delete <number>
#ACHTUNG! Numbered ändert sich wenn man vorne weglöscht!
Zurücksetzen
sudo ufw reset
Deaktivieren
sudo ufw disable