# Linux fully transparent mode

**URL:** <https://discourse.mitmproxy.org/t/linux-fully-transparent-mode/898>\
**Category:** help\
**Created:** [March 7, 2018, 8:20am UTC](https://discourse.mitmproxy.org/t/linux-fully-transparent-mode/898 "2018-03-07T08:20:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GHXST01](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@GHXST01](https://discourse.mitmproxy.org/u/GHXST01)\
**Post date:** [March 7, 2018, 8:20am UTC](https://discourse.mitmproxy.org/t/linux-fully-transparent-mode/898/1 "2018-03-07T08:20:36Z")

</div>

I’m having a look at the config in the docs, but am wondering if this will work in my setup.

```
CLIENT_NET=192.168.1.0/24
TABLE_ID=100
MARK=1

echo "$TABLE_ID mitmproxy" >> /etc/iproute2/rt_tables
iptables -t mangle -A PREROUTING -d $CLIENT_NET -j MARK --set-mark $MARK
iptables -t nat \
    -A PREROUTING -p tcp -s $CLIENT_NET \
    --match multiport --dports 80,443 -j \
    REDIRECT --to-port 8080

ip rule add fwmark $MARK lookup $TABLE_ID
ip route add local $CLIENT_NET dev lo table $TABLE_ID

```

Mitmproxy is running on my custom configured router.  
The router has 2 NICs.

Internet facing NIC has the address: 192.168.178.40  
The gateway NIC (that the client connects to) has address: 10.0.0.1  
The client address is 10.0.0.12

I’m having a hard time understanding the config so maybe someone can explain it to me?  
Or maybe someone has been in a similar situation? 🙂
