Damus
r1w1s1 profile picture
r1w1s1
@r1w1s1
Comparing firewall syntax for SSH (port 22) with default-deny:

#iptables (Linux)
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
iptables -P INPUT DROP

#nftables (Linux)
nft add rule inet my_filter input tcp dport 22 accept
nft add rule inet my_filter input drop

#ufw (Linux - simplified frontend to iptables)
ufw allow 22/tcp
ufw default deny incoming

#pf (OpenBSD)
pass in proto tcp to port 22
block all

pf’s syntax feels so elegant, human-readable, & minimal!

After 20y scripting iptables, I’m ready to try UFW on my laptop.
#firewall #sysadmin #pf #iptables #ufw #nftables
1
kasperd · 68w
The only one of those I know how to read is iptables. And if what you are specifying is your complete firewall configuration, it would definitely not work. There are a number of packets being dropped, which you would still need in order for things to work correctly: Communication with localhost Re...