Guest User

Untitled

a guest
Mar 6th, 2018
68
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.  
  23. # Allows SSH connections
  24. #
  25. # THE -dport NUMBER IS THE SAME ONE YOU SET UP IN THE SSHD_CONFIG FILE
  26. #
  27. -A INPUT -p tcp -m state --state NEW --dport $sshd -j ACCEPT
  28.  
  29.  
  30. # Allow ping
  31. -A INPUT -p icmp -m icmp --icmp-type 8 -j ACCEPT
  32.  
  33.  
  34. # log iptables denied calls
  35. -A INPUT -m limit --limit 5/min -j LOG --log-prefix "iptables denied: " --log-level 7
  36.  
  37.  
  38. # Reject all other inbound - default deny unless explicitly allowed policy
  39. -A INPUT -j REJECT
  40. -A FORWARD -j REJECT
  41.  
  42. COMMIT
Add Comment
Please, Sign In to add comment