Mitmproxy in transparent mode with SNAT


#1

Hello,
can anyone suggest how to do next configuration:

  1. CLIENT_1 should use WAN_1 LINUX SERVER N1 has next rules: iptables -tmangle -A PREROUTING -s 172.0.0.101 -j MARK --set-mark 1000 iptables -tnat -A POSTROUTING -m mark --mark 1000 -j SNAT --to-source $IP_ADDR_OF_LINUX_SERVER_N1_FOR_WAN1 everything works as expected.
  2. CLIENT_2 should use WAN_2 thru mitmproxy in transparent proxy mode, and here is problems. mitmproxy should be run with –spoof-source-address but I can’t understand how should I config iptables to have correct routing thru WAN_2

Any suggestions?

Yury