0

I have two computers connected by wire directly:

PC-1 ============= PC-2

PC-1 configuration:

IP Address: 192.168.1.1 netmask: 255.255.255.0

PC-2 configuration:

IP Address: 192.168.1.2 netmask: 255.255.255.0

PC-1 and PC-2 run some applications communicated with TCP/IP. My primary objective is log the conversations between PC-1 and PC-2 without any data loss.

Now, here is my problem. I removed the cable between two computers, and placed another computer (PC-3) that runs Linux and has two NICs:

PC-1 ============= |(eth0) PC-3 (eth1)| ============= PC-2

I shouldn't make changes (or configure) anything at PC-1 and PC-2. So I set this configuration at PC-3:

  • eth0: IP Address: 192.168.1.2 netmask: 255.255.255.0
  • eth1: IP Address: 192.168.1.1 netmask: 255.255.255.0

But It doesn't work. How should I configure these two NICs?

3
  • What OS do you use?
    – Stone
    Nov 30, 2013 at 13:49
  • All computers use Fedora 19. Nov 30, 2013 at 14:10
  • Have you enabled IP forwarding on PC-3? sysctl -w net.ipv4.ip_forward=1
    – fpmurphy
    Nov 30, 2013 at 15:54

1 Answer 1

3

Why introduce a third machine? Just run tcpdump on either of the two machines and you'll be able to capture all of the traffic between the two.

4
  • I tried tcpdump one of two machines but when I reconstructed pcap file, I saw some bytes are missing. Sniffing is not reliable. I intentionally used "without any data loss". Nov 30, 2013 at 14:09
  • 1. How do you know that some "bytes" are missing"? 2. How do you know that introducing a third machine won't have the same results? 3. You can't assign the same ip addresses to the third machine that you have assigned to the first two machines.
    – joeqwerty
    Nov 30, 2013 at 14:11
  • @joeqwerty I wrote a small scripts. Client script sends exactly 64MB. Server side receives and saves to file. I run tcpdump one of these computers and started the scripts. Two computers sent and received successfully, but tcpdump lost 700 byte. If there is another solution except sniffing, I'll be glad to hear that. Nov 30, 2013 at 14:19
  • The mechanism you'll be using on the third machine is exactly the same as if it were running on either of the two original machines.
    – EEAA
    Nov 30, 2013 at 14:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .