SHARE
TWEET

iptables tproxy /etc/rc.local

punces Sep 30th, 2016 (edited) 770 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
Top