Guest User

Untitled

a guest
May 27th, 2018
91
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.  
  4. # Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
  5. -A INPUT -i lo -j ACCEPT
  6. -A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
  7.  
  8.  
  9. # Accepts all established inbound connections
  10. -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  11.  
  12.  
  13. # Allows all outbound traffic
  14. # You can modify this to only allow certain traffic
  15. -A OUTPUT -j ACCEPT
  16.  
  17.  
  18. # Allows HTTP and HTTPS connections from anywhere (the normal ports for websites)
  19. -A INPUT -p tcp --dport 80 -j ACCEPT
  20. -A INPUT -p tcp --dport 443 -j ACCEPT
  21.  
  22. # Allows SSH connections
  23. #
  24. # THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE
  25. #
  26. -A INPUT -p tcp -m state --state NEW --dport 22 -j ACCEPT
  27.  
  28.  
  29. # Allow ping
  30. -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
  31.  
  32.  
  33. # log iptables denied calls
  34. -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
  35.  
  36.  
  37. # Reject all other inbound - default deny unless explicitly allowed policy
  38. -A INPUT -j REJECT
  39. -A FORWARD -j REJECT
  40.  
  41. COMMIT
Add Comment
Please, Sign In to add comment