Iptables bash script

view story

http://serverfault.com – i'd like to basically drop all packets, but still allow port 22, 80 and 52533. ATM this firewall doesn't allow pinging, or for me to use yum update. How can I add that? Thanks for advice. Also is there an easier way to open port 80? The current rule seems a bit verbose. #!/bin/sh # # Flush all current rules from iptables # iptables -F iptables -t nat -F # # Allow SSH connections on tcp port 22 # iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT iptables -A OUTPUT -o eth0 -p tcp --sport 22 -j ACCEPT # # Open port 80 # iptables -A INPUT -p tcp -s 0/0 --sport 1024:65535 -d 209.177 (HowTos)