Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ### Setup Routing Table ###
- /sbin/ip route flush cache
- /sbin/ip route flush table 70
- /sbin/ip route add table 70 to 172.24.38.0/24 dev eth0
- /sbin/ip route add table 70 to default via 172.24.38.3 dev eth0
- /sbin/ip rule add from 172.24.38.0/24 table 70 priority 70
- /sbin/ip route flush cache
- ### Required iptables rules for transparent proxy ###
- _input=/etc/squid3/proxy_exception
- IPT=/sbin/iptables
- $IPT -F
- $IPT -X
- $IPT -t nat -F
- $IPT -t nat -X BYPASS
- $IPT -t mangle -F
- $IPT -t nat -N BYPASS
- [ ! -f "$_input" ] && { echo "$0: File $_input not found."; exit 1; }
- egrep -v "^#|^$" $_input | while IFS= read -r ip
- do
- $IPT -t nat -A BYPASS -p tcp --dport 80 -d $ip -j ACCEPT
- done <"$_input"
- $IPT -t nat -A PREROUTING -p tcp --dport 80 -j BYPASS
- $IPT -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3128
- #$IPT -t nat -A PREROUTING -p tcp --dport 443 -j BYPASS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement