Ufw Schnippsel

NAT

NAT table rules

*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]

Port Forwardings

-A PREROUTING -i eth0 -p tcp --dport 22 -j DNAT --to-destination 192.168.1.10 default

Forward traffic through eth0 - Change to match you out-interface

-A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE

don’t delete the ‘COMMIT’ line or these nat table rules won’t be processed

COMMIT

UFW default

sudo ufw default deny outgoing
sudo ufw default deny incoming
sudo ufw allow 993
sudo ufw allow 6969
sudo ufw allow out 53
sudo ufw allow out http
sudo ufw allow out https
sudo ufw allow out 465
sudo ufw allow out 587
sudo ufw allow out 993
sudo ufw allow out 6969