Advertisement
Guest User

my mess

a guest
Dec 10th, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ### Setup Routing Table ###
  4.  
  5.  
  6. /sbin/ip route flush cache
  7.  
  8. /sbin/ip route flush table 70
  9.  
  10. /sbin/ip route add table 70 to 172.24.38.0/24 dev eth0
  11. /sbin/ip route add table 70 to default via 172.24.38.3 dev eth0
  12.  
  13. /sbin/ip rule add from 172.24.38.0/24 table 70 priority 70
  14.  
  15. /sbin/ip route flush cache
  16.  
  17.  
  18. ### Required iptables rules for transparent proxy ###
  19.  
  20. _input=/etc/squid3/proxy_exception
  21. IPT=/sbin/iptables
  22.  
  23. $IPT -F
  24. $IPT -X
  25. $IPT -t nat -F
  26. $IPT -t nat -X BYPASS
  27. $IPT -t mangle -F
  28. $IPT -t nat -N BYPASS
  29.  
  30. [ ! -f "$_input" ] && { echo "$0: File $_input not found."; exit 1; }
  31.  
  32. egrep -v "^#|^$" $_input | while IFS= read -r ip
  33. do
  34. $IPT -t nat -A BYPASS -p tcp --dport 80 -d $ip -j ACCEPT
  35. done <"$_input"
  36.  
  37. $IPT -t nat -A PREROUTING -p tcp --dport 80 -j BYPASS
  38. $IPT -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128
  39. #$IPT -t nat -A PREROUTING -p tcp --dport 443 -j BYPASS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement