Advertisement
Guest User

Untitled

a guest
May 4th, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  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 -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 SSH connections
  18. #
  19. # The -dport number should be the same port number you set in sshd_config
  20. #
  21. -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
  22.  
  23. # Allow ping
  24. -A INPUT -p icmp -j ACCEPT
  25.  
  26. # Log iptables denied calls
  27. -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
  28.  
  29. # Drop all other inbound - default deny unless explicitly allowed policy
  30. -A INPUT -j DROP
  31. -A FORWARD -j DROP
  32.  
  33. COMMIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement