I have a machine that is like a firewall, I use iptables to route traffic through it, to the router. For ex
Host1 -> Middleman -> gateway -> Internet
Internet -> gateway -> middleman -> Host1
I have this working using these rules:
# 192.168.0.6 = host
# 192.168.0.8 = middleman
iptables -A PREROUTING -t nat -d 192.168.0.6/32 -j DNAT --to 192.168.0.8
iptables -A POSTROUTING -t nat -d 192.168.0.8/32 -j SNAT --to 192.168.0.6
On the middleman machine when I analyse the traffic using Wireshark, I can only see the outbound traffic, I don't see any traffic from gateway->host only host-gateway
The traffic must be passing through both ways because the host has Internet access.
How can I modify the iptables rules to see the traffic both ways?