Guest User

Untitled

a guest
Mar 26th, 2011
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. #############################
  2. ## LIMPANDO TODAS AS REGRAS #
  3. #############################
  4. iptables -F
  5. iptables -t nat -F
  6. iptables -X
  7. iptables -t nat -X
  8.  
  9. ##################
  10. ## REGRA PADRAO #
  11. ##################
  12. iptables -P INPUT ACCEPT
  13. iptables -P OUTPUT ACCEPT
  14. iptables -P FORWARD DROP
  15.  
  16. ###########################
  17. ## ESTABILIZANDO CONEXOES #
  18. ###########################
  19. iptables -t filter -A FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED
  20. iptables -t filter -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED
  21.  
  22. ########################
  23. ## LIBERANDO LOOPBACK #
  24. ########################
  25. iptables -A INPUT -i lo -j ACCEPT
  26. iptables -A FORWARD -i lo -j ACCEPT
  27. iptables -A OUTPUT -o lo -j ACCEPT
  28.  
  29. ##################################################################
  30. ## Compartilhando a nat conexo onde eth0 e a interface com web #
  31. ##################################################################
  32. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
  33.  
  34. #######################################################################
  35. ## REDIRECIONANDO NAVEGACAO PARA SQUID # Coloca o Endereo da REDE#
  36. #######################################################################
  37. iptables -t nat -A PREROUTING -s 192.168.10.0/24 -p tcp -i eth0 -j REDIRECT --to-port 3128
  38.  
  39.  
  40. ####################################
  41. ## LIBERANDO CONEXAO PARA MAQUINAS #
  42. ####################################
  43. iptables -A FORWARD -s 192.168.10.22/32 -d 0/0 -j ACCEPT
  44. iptables -A FORWARD -s 192.168.10.26/32 -d 0/0 -j ACCEPT
  45.  
  46. ################################################
  47. ## LIBERACAO DE ACESSO PARA SITES ESPECIFICOS #
  48. ################################################
  49. iptables -A FORWARD -p tcp -d www.novomundocaminhoes.com.br --dport 2082 -j ACCEPT
  50. iptables -A FORWARD -p tcp -d www.somdaterra.com.br -j ACCEPT
Advertisement
Add Comment
Please, Sign In to add comment