I have two computers on the same lan

Comp A: 192.1681.151.15
Comp B: 192.1681.151.19

When I open Wireshark, for all traffic browsed on comp A, I would like Wireshark to capture traffic of comp A and destination address as the one to the server it is connecting too.

I have tried to understand iptables and other related questions, but somehow I still configure this wrongly.

Edit: I use the following iptable rules on comp B

   iptables -t nat -A PREROUTING -p tcp --dport 443 -j DNAT --to-destination 
   iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to-destination 
   iptables -t nat -A POSTROUTING -j MASQUERADE

How to correctly forward traffic from one computer to another ?. Both machines are connected to the Internet on the same lan.

  • How do you configure it then? Do you mind sharing? – user147505 Sep 30 '16 at 21:28
  • Edit: Added the iptable rules that I used – user192795 Sep 30 '16 at 21:59
  • But what is your exact problem? I mean: the iptables rules are not working, they work but you cannot see the traffic in wireshark, etc. – zuazo Oct 1 '16 at 0:51
  • The iptable rules are not working for my setup. I cannot see traffic for wireshark running on the eth0 interface for computer B. – user192795 Oct 1 '16 at 1:26
  • Is comp B your modem / router ? If it isn't, comp A traffic doesn't go through comp B, so you would need to set these rules on the router. – Sanael Oct 4 '16 at 10:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy