From FoppaWiki

Jump to: navigation, search

Block on ip:

iptables -I INPUT -s -j DROP

Block on ip and port:

iptables -I INPUT -s -p udp --destination-port 53 -j DROP

Remove block:

iptables -D INPUT -s -j DROP

Flush rules:

iptables -F

Portforwarding - this will forward ports 1024->65536 to 80 on the same host:

iptables -t nat -A PREROUTING -p tcp -d --dport 1024:65535 -j DNAT --to
iptables -A INPUT -p tcp -s 0/0 --dport 1024:65535 -j ACCEPT
Personal tools