aquaballoon

squid

Nov 2nd, 2011
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.72 KB | None | 0 0
  1. nano /etc/iptables.up.rules
  2.  
  3. -A INBOUND -p tcp -m tcp --dport 8888 -j ACCEPT
  4. -A INBOUND -p udp -m udp --dport 8888 -j ACCEPT
  5.  
  6. -A PREROUTING -p tcp -m tcp -i eth0 --dport 80 -j DNAT --to-destination 192.168.15.1:8888  # eth0 -> lan; 192.168.15.1-> squid server
  7. -A PREROUTING -p tcp -m tcp -i eth0 --dport 80 -j REDIRECT --to-ports 8888
  8.  
  9.  
  10. sudo apt-get install squid
  11. #sudo apt-get install squid3
  12.  
  13. nano /etc/squid/squid.conf
  14.  
  15. http_port 8888 transparent
  16.  
  17. visible_hostname hureeict.edu.mn
  18.  
  19. ## Unlimited Access Users ##
  20. #acl BIGBOSS src 192.168.15.19
  21. #http_access allow BIGBOSS
  22.  
  23. ## Time Settings ##
  24. acl biz_hours time M T W T F 9:00-17:00
  25.  
  26. ## Websites/Download/Ports/MAC block ##
  27.  
  28. acl website_block dstdom_regex facebook.com
  29. http_access deny website_block biz_hours
  30.  
  31. acl download_block urlpath_regex .mp3 .avi .mpeg .mov .torrent
  32. http_access deny download_block biz_hours
  33.  
  34. acl ports_block port  6969 6881-6899
  35. http_access deny ports_block biz_hours
  36.  
  37. acl mac_block arp 00:13:45:d3:24:e4
  38. https_access deny mac_block biz_hours
  39.  
  40. ## Access Subnets ##
  41. #acl localnet src 127.0.0.1/255.255.255.255
  42. #http_access allow localnet
  43. acl lan_15 src 192.168.15.0/24 192.168.16.0/24
  44. http_access allow lan_15
  45. # http_access allow lan_15 biz_hours
  46. # http_access deny all
  47. # http_access deny !Safe_ports
  48.  
  49. ## Delay Pools - 74kb/s ##
  50. delay_pools 1
  51. delay_class 1 2
  52. delay_parameters 1 74000/74000 74000/74000
  53. delay_access 1 allow lan_15 biz_hours
  54. #delay_access 1 allow lan_15
  55. #delay_access 1 deny lan_15 !biz_hours
  56. #delay_access 1 deny lan_15 all
  57.  
  58. ## Cache 20GB ##
  59. cache_dir ufs /var/spool/squid 20000 16 256
  60.  
  61.  
  62. sudo /etc/init.d/squid restart
  63.  
  64.  
  65. sudo nano /etc/sysctl.conf
  66.  
  67. net.ipv4.ip_forward=1
  68. net.ipv6.conf.all.forwarding=1
Advertisement
Add Comment
Please, Sign In to add comment