# ssh and webChange venet0 to the relevant interface name.
iptables -t filter -A INPUT -p tcp --dport 22 -i venet0 -j ACCEPT
iptables -t filter -A INPUT -p tcp --dport 80 -i venet0 -j ACCEPT
# dns request responses
iptables -t filter -A INPUT -p tcp --sport 53 -i venet0 -j ACCEPT
iptables -t filter -A INPUT -p udp --sport 53 -i venet0 -j ACCEPT
# accept other related sessions
iptables -t filter -A INPUT -m state --state ESTABLISHED,RELATED -i venet0 -p tcp -j ACCEPT
# drop everything else
iptables -t filter -A INPUT -i venet0 -j DROP
Sunday, August 2, 2009
Basic Firewall
These commands will open up ssh and web, but leaves everything else locked off.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment