(E-Mail Removed) wrote:
> Hi,
>
> This is a generic question about how to capture packets on linux for
> testing purpose. I need to capture packets comprising TCP connections
> from multiple IPs to a single host. This is to test my code (in
> verilog). I can capture packets using tcpdump but since I have only two
> machines at home, I will only be getting packets from same source
> address. I am considering two alternatives:
>
> 1) bind different IP addresses to same interface and use each as source
> address. I am not sure if I can indeed bind large number of addresses
> on Linux to single interface. Can someone tell me if it is possible?
>
> 2) follow these steps
> a) capture packets corresponding to a simgle connection from node A
> to node B.
> b) repeat above step, say, 100 times.
> c) Now, I have 100 files, each containing packets for one TCP
> connection.
> d) Overwrite bytes for source IP address in each file.
> e) merge 100 files in some random fashion to simulate concurrent
> connections
>
> I would appreciate it if someone can comment on both these approaches
> and importantly, if they sound plausible. If there is some other way to
> achieve this, please let me know.
>
> Thanks in advance,
> Raghu.
>
The correct place to capture the data is at the target host.
Do you have root access to it?
If not, you need an Ethernet tapping cable between the target
and the node feeding it, and put an extra computer to record
the data from the tap.
--
Tauno Voipio
tauno voipio (at) iki fi