Advertisement
punces

iptables tproxy /etc/rc.local

Sep 30th, 2016
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. echo '#tproxy
  2. iptables -t mangle -N DIVERT
  3. iptables -t mangle -A DIVERT -j MARK --set-mark 1
  4. iptables -t mangle -A DIVERT -j ACCEPT
  5. iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
  6. iptables -t mangle -A PREROUTING -p tcp --dport 80 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  7. iptables -t mangle -A PREROUTING -p tcp --dport 8080 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  8. iptables -t mangle -A PREROUTING -p tcp --dport 182 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  9. iptables -t mangle -A PREROUTING -p tcp --dport 8777 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  10. iptables -t mangle -A PREROUTING -p tcp --dport 5050 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3129
  11. iptables -t mangle -A PREROUTING -p tcp --dport 443 -j TPROXY --tproxy-mark 0x1/0x1 --on-port 3127
  12. ip rule add fwmark 1 lookup 212
  13. ip route add local 0.0.0.0/0 dev lo table 212
  14. exit 0' > /etc/rc.local
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement