Guest User

Untitled

a guest
Jan 13th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #!/bin/bash
  2. # Vari�veis
  3. # -------------------------------------------------------
  4. echo "Securing your System"
  5. # -------------------------------------------------------
  6. iptables=/sbin/iptables
  7. IF_EXTERNA=eth0
  8. $iptables -P INPUT ACCEPT
  9. $iptables -P FORWARD ACCEPT
  10.  
  11. $iptables -F
  12. $iptables -X
  13. $iptables -F -t mangle
  14. $iptables -X -t mangle
  15.  
  16. # Determina a pol�tica padr�o
  17. $iptables -A INPUT -p tcp --dport 22003 -j ACCEPT
  18. # -------------------------------------------------------
  19. $iptables -P INPUT DROP
  20. $iptables -P FORWARD DROP
  21.  
  22. $iptables -A INPUT -i lo -j ACCEPT
  23. $iptables -A OUTPUT -o lo -j ACCEPT
  24.  
  25. $iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  26.  
  27. # Libera acesso externo a determinadas portas
  28. # -------------------------------------------------------
  29. $iptables -A INPUT -p tcp --dport 22003 -j ACCEPT
  30. $iptables -A INPUT -p tcp --dport 22253 -j ACCEPT
  31. $iptables -A INPUT -p udp --dport 22253 -j ACCEPT
  32. $iptables -A INPUT -p tcp --dport 80 -j ACCEPT
  33.  
  34. # --------------------------------------
  35. echo "Iptables Firewall Filtering Active"
Add Comment
Please, Sign In to add comment