From Bob Lamont, 8 Months ago, written in Plain Text.
  1. *filter
  2.  
  3. #  Allow all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
  4. -A INPUT -i lo -j ACCEPT
  5. -A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
  6.  
  7. #  Accept all established inbound connections
  8. -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  9.  
  10. #  Allow all outbound traffic - you can modify this to only allow certain traffic
  11. -A OUTPUT -j ACCEPT
  12.  
  13. #  Allow HTTP and HTTPS connections from anywhere (the normal ports for websites and SSL).
  14. -A INPUT -p tcp --dport 80 -j ACCEPT
  15. -A INPUT -p tcp --dport 443 -j ACCEPT
  16.  
  17. # Allow Webmin
  18. -A INPUT -p tcp -m tcp --dport 10000 -j ACCEPT
  19.  
  20. #  Allow ports for testing
  21. -A INPUT -p tcp --dport 8080:8090 -j ACCEPT
  22.  
  23. #  Allow SSH connections
  24. #  The -dport number should be the same port number you set in sshd_config
  25. -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
  26.  
  27. #  Allow ping
  28. -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
  29.  
  30. #  Log iptables denied calls
  31. -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
  32.  
  33. #  Reject all other inbound - default deny unless explicitly allowed policy
  34. -A INPUT -j REJECT
  35. -A FORWARD -j REJECT
  36.  
  37. COMMIT
  38.  
captcha