Linux fully transparent mode

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


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:
The gateway NIC (that the client connects to) has address:
The client address is

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? :slight_smile: