
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Great and schematic iptables cheat sheet
Typology: Cheat Sheet
1 / 1
This page cannot be seen from the preview
Don't miss anything!

iptables -L -n -v --line-numbers
Note: Please ensure the default policy is ACCEPT or leave a ssh terminal before issuing
iptables -F iptables -X
iptables -P INPUT DROP iptables -P FORWARD DROP iptables -P OUTPUT DROP
iptables -A INPUT -s aa.bb.cc.dd -j DROP
iptables -A OUTPUT -p tcp -d www.microsoft.com -j DROP
iptables -A INPUT -s 1.2.3.0/24 -p icmp --icmp-type echo-request -j ACCEPT iptables -A INPUT -p icmp --icmp-type echo-request -j DROP
iptables -A INPUT -s 1.2.3.0/24 -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT iptables -A INPUT -p tcp --dport 22 -m state --state NEW,ESTABLISHED -j DROP
iptables -A input -p tcp --dport 80 -j DROP
Forward incoming connection to another internal host (aa.bb.cc.dd:22)
iptables -t nat -A PREROUTING -I eth0 -p tcp --dport 1022 -j DNAT --to aa.bb.cc.dd: iptables -A FORWARD -p tcp -d aa.bb.cc.dd -dport 22 -m state --state NEW,ESTABLISH -j ACCEPT
iptables -L -n -v --line-numbers iptables -D input {line-number}