Guest User

Untitled

a guest
Dec 2nd, 2016
394
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. iptables -t nat -A POSTROUTING -o p5p1 -j MASQUERADE
  3. iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -j MASQUERADE
  4. iptables -I INPUT -p tcp -m tcp --dport 3129 -j ACCEPT
  5. modprobe xt_TPROXY
  6. modprobe xt_socket
  7. modprobe xt_mark
  8. modprobe nf_nat
  9. modprobe nf_conntrack_ipv4
  10. modprobe nf_conntrack
  11. modprobe nf_defrag_ipv4
  12. modprobe ipt_REDIRECT
  13. modprobe iptable_nat
  14. echo 1 > /proc/sys/net/ipv4/ip_forward
  15. echo 0 > /proc/sys/net/ipv4/conf/default/rp_filter
  16. echo 0 > /proc/sys/net/ipv4/conf/all/rp_filter
  17. echo 0 > /proc/sys/net/ipv4/conf/lo/rp_filter
  18. ip rule add fwmark 1 lookup 100
  19. ip route add local 0.0.0.0/0 dev lo table 100
  20. iptables -t mangle -F
  21. iptables -t mangle -X
  22. iptables -t mangle -N DIVERT
  23. iptables -t mangle -A DIVERT -j MARK --set-mark 1
  24. iptables -t mangle -A DIVERT -j ACCEPT
  25. iptables -t mangle -A INPUT -j ACCEPT
  26. iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
  27. iptables -t mangle -A PREROUTING -d <WAN IP> -p tcp -m multiport --dports 22,80,443,3127,3128,3129,8000,8080,10000 -j ACCEPT
  28. iptables -t mangle -A PREROUTING ! -d <WAN IP> -p tcp -m multiport --dports 80,8080,8000 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
  29. iptables -t mangle -A PREROUTING ! -d <WAN IP> -p tcp -m multiport --dports 443 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  30. exit 0
RAW Paste Data