Ok, for iptables rules you want something like this:
Code:
iptables="/sbin/iptables"
$iptables -F
$iptables -X
$iptables -P INPUT DROP
# Drop some known-evil packets
$iptables -A INPUT -i eth0 -p tcp -m state --state NEW -j DROP
$iptables -A INPUT -m state --state INVALID -j DROP
# Accept established connections
$iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Limit the amount of pings that are accepted
$iptables -A INPUT -i eth0 -p icmp --icmp-type 8 -m limit --limit 1/m -j ACCEPT
# Drop the excess ones
$iptables -A INPUT -i eth0 -p icmp --icmp-type 8 -j DROP
# Accept other kinds of icmp traffic (but not pings)
$iptables -A INPUT -i eth0 -p icmp -j ACCEPT
# Allow local traffic
$iptables -A INPUT -i lo -j ACCEPT
# Drop all extra traffic!
$iptables -A INPUT -i eth0 -j DROP
# Accept all outbound packets
$iptables -P OUTPUT ACCEPT
Put that into a script and have it run by default during system boot. How you go about doing that will vary from distro to distro.
Bookmarks