Advertisement
albspirit86

tproxy rc.local

Sep 23rd, 2014
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. modprobe xt_TPROXY
  2. modprobe xt_socket
  3. #modprobe nf_tproxy_core
  4. modprobe xt_mark
  5. modprobe nf_nat
  6. modprobe nf_conntrack_ipv4
  7. modprobe nf_conntrack
  8. modprobe nf_defrag_ipv4
  9. modprobe ipt_REDIRECT
  10. modprobe iptable_nat
  11.  
  12. iptables -t mangle -F
  13. iptables -t mangle -X
  14.  
  15. iptables -t mangle -N DIVERT
  16. iptables -t mangle -A DIVERT -j MARK --set-mark 1
  17. iptables -t mangle -A DIVERT -j ACCEPT
  18. iptables -t mangle -A INPUT -j ACCEPT
  19. iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
  20. iptables -t mangle -A PREROUTING ! -d 192.168.5.2/30 -p tcp --dport 80 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3128
  21. iptables -t mangle -A PREROUTING ! -d 192.168.5.2/30 -p tcp --dport 443 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  22.  
  23.  
  24. /sbin/ip rule add fwmark 1 lookup 100
  25. /sbin/ip route add local 0.0.0.0/0 dev lo table 100
  26.  
  27. echo 0 > /proc/sys/net/ipv4/conf/lo/rp_filter
  28. echo 1 > /proc/sys/net/ipv4/ip_forward
  29. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement