This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Changing peer IP in pcap using tcprewrite

0

I'm new to networking, so sorry in advance if my question is unclear. I have auto generated pcaps, each with one TCP flow which I would like to transmit using a traffic generator. The problem is that on those pcaps both the peers have the same IP, which is something the traffic generator does not like.

So, I tried to change the IPs using tcprewrite --endpoints. It worked for some pcaps. For others I got a strange behavior where the sender is always IP1 and the receiver is always IP2, (i.e the traffic always goes from IP1 to IP2, instead of being bidirectional). For example:

21:41:48.477466 IP 127.17.242.242.5901 > localhost.55617: Flags [P.], seq 2055024698:2055024710, ack ... 21:41:48.477907 IP 127.17.242.242.55617 > localhost.5901: Flags [P.], seq 920220669:920220681, ack ... 21:41:48.478148 IP 127.17.242.242.5901 > localhost.55617: Flags [P.], seq 12:14, ack 13, ... 21:41:48.478213 IP 127.17.242.242.55617 > localhost.5901: Flags [P.], seq 12:13, ack 3, ... 21:41:48.478495 IP 127.17.242.242.5901 > localhost.55617: Flags [P.], seq 14:30, ack 14, ... 21:41:51.383253 IP 127.17.242.242.55617 > localhost.5901: Flags [P.], seq 13:29, ack 19, ... 21:41:51.383418 IP 127.17.242.242.5901 > localhost.55617: Flags [P.], seq 30:34, ack 30, ... 21:41:51.383657 IP 127.17.242.242.55617 > localhost.5901: Flags [P.], seq 29:30, ack 23, ...

Also now I have 2 flows, since the IPs got scrambles in relation to the ports (the ports stayed the same as they were).

Any idea what might cause this problem? Or is there a way to achieve what I want without tcprewrite?

Thanks Alot

asked 11 Jun '17, 07:04

eladw's gravatar image

eladw
6112
accept rate: 0%