# Mitmproxy in transparent mode with SNAT

**URL:** <https://discourse.mitmproxy.org/t/mitmproxy-in-transparent-mode-with-snat/501>\
**Category:** help\
**Created:** [May 29, 2017, 2:34pm UTC](https://discourse.mitmproxy.org/t/mitmproxy-in-transparent-mode-with-snat/501 "2017-05-29T14:34:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aero-108](https://avatars.discourse-cdn.com/v4/letter/a/43a26b/32.png) [@aero-108](https://discourse.mitmproxy.org/u/aero-108)\
**Post date:** [May 29, 2017, 2:34pm UTC](https://discourse.mitmproxy.org/t/mitmproxy-in-transparent-mode-with-snat/501/1 "2017-05-29T14:34:59Z")

</div>

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

 ![](https://canada1.discourse-cdn.com/flex030/uploads/mitmproxy1/original/1X/0713492bdeeeb01aaf0e879b7831556b47354601.png)

Any suggestions?

Yury
