redirect local traffic to another local IP. ?iptables
Greetings.
I'm trying to redirect (actually, capture) traffic from one internal device to another. They are all on the same network, which is run by a dd-wrt router. I was working with DNSMasq (which allowed me to set the Gateway to my proxy server and collect externally destined traffic), but I wasn't able to catch info between the two devices. From the router I tried a few iptables commands, namely: iptables -A PREROUTING -s 192.168.10.130 -p tcp -j DNAT --to-destination 192.168.15.134 iptables -A PREROUTING -d 192.168.10.114 -p tcp -j DNAT --to-destination 192.168.15.134 iptables -A PREROUTING -d 192.168.10.114 -p tcp -j DNAT --to-destination 192.168.15.134 -t nat without any success. 192.168.10.130 = a device trying to connect to another device, the handshake I'd like to catch. 192.168.10.114 = the second device, to which it is communicating 192.168.10.134 = my personal computer with a proxy set up (could use nc instead but mitmproxy works well for most things) The ports I believe the two devices to talk on are 8080, 9000 and 10000. Any suggestions on how to redirect all internal traffic from 192.168.10.130 to 192.168.10.134? Many thanks! |
Howdy,
Quote:
See: http://www.fclose.com/816/port-forwa...sing-iptables/ Try something like this: Code:
iptables -A PREROUTING -s 192.168.10.130 -p tcp -j DNAT --to-destination 192.168.10.134 |
Quote:
:( |
Maybe your router has a hardware switch which directly send packets to another port. Can you specify which router it is and how these computers are connected to it? You can log traffic and see if anything is going by your router by:
Code:
iptables -t raw -I PREROUTING -s 192.168.10.130 -j LOG Code:
iptables -t nat -A PREROUTING -s 192.168.10.130 -p tcp -j DNAT --to-destination 192.168.15.134 |
Quote:
As far as my equipment: bare bones. Run of the mill Linksys E1200 wireless router, with 4 LAN + 1 WAN port, but it is running dd-wrt. |
All times are GMT -5. The time now is 10:57 PM. |