I’m looking for the correct iptables rules for the following scenario:
Router R running ddwrt (so I can set iptables rules, but can’t install mitmproxy / wireshark)
Device A which is sending traffic I want to analyze to the internet. Device B running Ubuntu on which I have mitmproxy and wireshark. Many other devices on the network connected to R which I don’t want to disrupt.
How do I set up the rules so that traffic from A (and only traffic from A) is routed to device B? I don’t have any control over the device A besides setting to which wifi AP it connects.
On ddwrt iptables -t mangle -A PREROUTING -j MARK --set-mark 3 -p tcp -m multiport --dports 80,443 gave me segmentation fault for some reason, but running it twice which each port separately worked.
I’m kind of lost with the iptables rules for my configuration. Here is my set-up:
Set-top-box > Computer running Ubuntu with mitmproxy > Internet
My computer has 2 ethernet NIC (eth0 and eth1). eth0 is connected to the set-top-box and eth1 is connected to an Internet box. I created a network bridge (called br0) between them. How can I redirect the http traffic from my set-top-box to the listening port of mitmproxy?