Thanks, now I have read those I I'm doing the following which still doesn't work:
On device B I start mitmproxy like this:
sudo mitmproxy -T --host -a -p 80
On my router R I added a static routing rule that tells A to use B as a gateway.
I verified this worked by running
route on A:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default rpi3.local 0.0.0.0 UG 0 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 9 0 0 wlan0
I also verified this by tracerouting a site (the router is a second hop):
traceroute to ynet.co.il (18.104.22.168), 30 hops max, 60 byte packets
1 * * *
2 Netgear (192.168.0.1) 1.808 ms 2.094 ms 1.964 ms
However when I run wget I don't see mitmproxy intercepting it:
What am I missing?