Search code examples
network-programmingethernet

Sniffing data from a switch


I have 2 network devices that talk to each other over Ethernet. I would like to sniff the traffic using Wireshark. But the devices are going through a switch. The switch routes the traffic to only the ports that need the data.

At another location I have a hub. All the traffic is repeated across all the ports.

Is there a way to tell the switch to send the traffic down my port also?

EDIT: This is an unmanaged switch.


Solution

  • Since this is an unmanaged switch, the only way that I can think of is to temporarily put a hub between the switch and one of the devices you want to monitor, then plug a laptop into that hub to do the monitoring. The laptop should now see all traffic between the device and the switch.

    This is pretty easy since you can do it at the location of one of the devices. You just need a hub, two more lengths of CAT cable and the computer you are using to monitor with.